27670 references to Length
AnalyzerRunner (4)
ApplicationModelWebSite (1)
Aspire.Azure.Security.KeyVault.Tests (2)
Aspire.Components.Common.Tests (1)
Aspire.Dashboard (29)
Aspire.Dashboard.Tests (4)
Aspire.Hosting (6)
Aspire.Hosting.Analyzers (5)
Aspire.Hosting.Azure.AppContainers (4)
Aspire.Hosting.NodeJs (1)
Aspire.Hosting.Testing (1)
Aspire.Hosting.Testing.Tests (5)
Aspire.Hosting.Tests (5)
Aspire.Milvus.Client.Tests (1)
Aspire.Playground.Tests (1)
Aspire.Workload.Tests (5)
AzureFunctionsEndToEnd.Functions (1)
BasicTestApp (5)
Benchmarks (2)
Binding.Http.IntegrationTests (1)
BlazorServerApp (1)
BlazorUnitedApp (1)
BoundTreeGenerator (8)
BuildActionTelemetryTable (5)
ClientSample (4)
CodeGenerator (30)
CodeStyleConfigFileGenerator (2)
ConfigurationSchemaGenerator (2)
Contract.Fault.IntegrationTests (4)
Contract.Message.IntegrationTests (7)
csc (2)
CSharpErrorFactsGenerator (1)
CustomResources.AppHost (2)
DaprServiceB (1)
Diagnostics.EFCore.FunctionalTests (1)
Diagnostics.FunctionalTests (1)
DnnAnalyzer (2)
dotnet-dev-certs (16)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
555Array.Clear(keyBytes, 0, keyBytes.Length);
556Array.Clear(pem, 0, pem.Length);
562Array.Clear(keyBytes, 0, keyBytes.Length);
563Array.Clear(pem, 0, pem.Length);
613Array.Clear(bytes, 0, bytes.Length);
641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
dotnet-getdocument (6)
dotnet-openapi (12)
dotnet-razorpagegenerator (3)
dotnet-sql-cache (5)
dotnet-svcutil.xmlserializer (5)
dotnet-svcutil-lib (1531)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEncodedRawTextWriter.cs (12)
161bufBytes = new byte[bufChars.Length];
179if (bom.Length != 0)
181this.stream.Write(bom, 0, bom.Length);
658Debug.Assert(count >= 0 && index + count <= buffer.Length);
682Debug.Assert(count >= 0 && index + count <= buffer.Length);
860encoder.Convert(bufChars, startOffset, endOffset - startOffset, bufBytes, bufBytesUsed, bufBytes.Length - bufBytesUsed, false, out chEnc, out bEnc, out completed);
863if (bufBytesUsed >= (bufBytes.Length - 16))
885encoder.Convert(bufChars, 1, 0, bufBytes, 0, bufBytes.Length, true, out chEnc, out bEnc, out completed);
1569if (_lastMarkPos + 1 == _textContentMarks.Length)
1578Debug.Assert(_lastMarkPos + 1 == _textContentMarks.Length);
1579int[] newTextContentMarks = new int[_textContentMarks.Length * 2];
1580Array.Copy(_textContentMarks, newTextContentMarks, _textContentMarks.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (39)
1614if (buffer.Length - index < count)
1674if (buffer.Length - index < count)
1733if (buffer.Length - index < count)
1793if (buffer.Length - index < count)
1866if (buffer.Length - index < count)
2912bufferSize = _ps.bytes.Length;
2927if (_ps.bytes == null || _ps.bytes.Length < bufferSize)
2934if (_ps.chars == null || _ps.chars.Length < bufferSize + 1)
2941while (_ps.bytesUsed < 4 && _ps.bytes.Length - _ps.bytesUsed > 0)
2943int read = stream.Read(_ps.bytes, _ps.bytesUsed, _ps.bytes.Length - _ps.bytesUsed);
2961int preambleLen = preamble.Length;
3407if (_ps.charsUsed == _ps.chars.Length - 1)
3415char[] newChars = new char[_ps.chars.Length * 2];
3416BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length);
3425if (_ps.bytes.Length - _ps.bytesUsed < MaxByteSequenceLen)
3427byte[] newBytes = new byte[_ps.bytes.Length * 2];
3434charsRead = _ps.chars.Length - _ps.charsUsed - 1;
3442int charsLen = _ps.chars.Length;
3465char[] newChars = new char[_ps.chars.Length * 2];
3466BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length);
3489charsRead = _ps.chars.Length - _ps.charsUsed - 1;
3497if (_ps.bytePos == _ps.bytesUsed && _ps.bytes.Length - _ps.bytesUsed > 0)
3499int read = _ps.stream.Read(_ps.bytes, _ps.bytesUsed, _ps.bytes.Length - _ps.bytesUsed);
3521charsRead = _ps.textReader.Read(_ps.chars, _ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1);
3533Debug.Assert(_ps.charsUsed < _ps.chars.Length);
3544Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1);
5131if (_attrDuplSortingArray == null || _attrDuplSortingArray.Length < _attrCount)
7771Debug.Assert(nodeIndex < _nodes.Length);
7772Debug.Assert(_nodes[_nodes.Length - 1] == null);
7785Debug.Assert(nodeIndex < _nodes.Length);
7786if (nodeIndex >= _nodes.Length - 1)
7788NodeData[] newNodes = new NodeData[_nodes.Length * 2];
7789Array.Copy(_nodes, 0, newNodes, 0, _nodes.Length);
7792Debug.Assert(nodeIndex < _nodes.Length);
8245else if (_parsingStatesStackTop + 1 == _parsingStatesStack.Length)
8247ParsingState[] newParsingStateStack = new ParsingState[_parsingStatesStack.Length * 2];
8248Array.Copy(_parsingStatesStack, 0, newParsingStateStack, 0, _parsingStatesStack.Length);
8293if (array.Length - index < count)
9689Debug.Assert(endPos < chars.Length);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (41)
355for (int i = 0; i < xmlNodes.Length; i++)
385XmlCustomFormatter.WriteArrayBase64(_w, (byte[])o, 0, ((byte[])o).Length);
1019XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length);
1037XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length);
1059XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length);
1158XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length);
1300int arrayLength = a.Length;
1740for (int i = 0; i < values.Length; i++)
1915for (int i = 0; i < mapping.Members.Length; i++)
1928for (int j = 0; j < mapping.Members.Length; j++)
1968for (int i = 0; i < mapping.Members.Length; i++)
1982for (int j = 0; j < mapping.Members.Length; j++)
2012for (int j = 0; j < mapping.Members.Length; j++)
2031if (isRpc && member.IsReturnValue && member.Elements.Length > 0)
2063Writer.Write(mapping.Members.Length.ToString());
2067WriteExtraMembers(mapping.Members.Length.ToString(), "pLength");
2152if (constants.Length > 0)
2160for (int i = 0; i < constants.Length; i++)
2180for (int i = 0; i < constants.Length; i++)
2191for (int i = 0; i < constants.Length; i++)
2449for (int i = 0; i < members.Length; i++)
2488for (int i = 0; i < members.Length; i++)
2494bool checkShouldPersist = m.CheckShouldPersist && (m.Elements.Length > 0 || m.Text != null);
2750!(elements.Length == 1 && elements[0].Mapping is ArrayMapping))
2759if (elements.Length == 0 && text == null) return;
2877int count = elements.Length + (text == null ? 0 : 1);
2905if (elements.Length == 0 && text == null) return;
2906if (elements.Length == 1 && text == null)
2929for (int i = 0; i < elements.Length; i++)
2993if (elements.Length - anyCount > 0) Writer.Write("else ");
3090if (elements.Length > 0)
3112if (elements.Length > 0)
3606for (int i = 0; i < members.Length; i++)
3663for (int i = 0; i < choiceMapping.Constants.Length; i++)
3737for (int i = 0; i < parameterTypes.Length; i++)
3921for (int i = 0; i < structMapping.Members.Length; i++)
3945for (int i = 0; i < enumFields.Length; i++)
3996for (int i = 0; i < memberInfos.Length; i++)
4044for (int i = 0; i < paramTypes.Length; i++)
4047if (i < (paramTypes.Length - 1))
4109for (int i = 0; i < args.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (15)
489writer.WriteBase64(bytes, 0, bytes.Length);
666for (int i = 0; i < value.Length; i++)
673dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
685for (int i = 0; i < value.Length; i++)
692dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
704for (int i = 0; i < value.Length; i++)
711dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
723for (int i = 0; i < value.Length; i++)
730dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
742for (int i = 0; i < value.Length; i++)
749dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
761for (int i = 0; i < value.Length; i++)
768dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
780for (int i = 0; i < value.Length; i++)
787dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
FrameworkFork\System.Runtime.Serialization\System\Text\Base64Encoding.cs (32)
69if (index > chars.Length)
70throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("index", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)));
73if (count > chars.Length - index)
74throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - index)));
129if (charIndex > chars.Length)
130throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)));
134if (charCount > chars.Length - charIndex)
135throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)));
141if (byteIndex > bytes.Length)
142throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length)));
157byte* pbMax = _bytes + bytes.Length - byteIndex;
212if (charIndex > chars.Length)
213throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)));
217if (charCount > chars.Length - charIndex)
218throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)));
224if (byteIndex > bytes.Length)
225throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length)));
240byte* pbMax = _bytes + bytes.Length - byteIndex;
305if (byteIndex > bytes.Length)
306throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length)));
309if (byteCount > bytes.Length - byteIndex)
310throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)));
317if (charIndex > chars.Length)
318throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)));
319if (charCount < 0 || charCount > chars.Length - charIndex)
399if (byteIndex > bytes.Length)
400throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length)));
403if (byteCount > bytes.Length - byteIndex)
404throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)));
411if (charIndex > chars.Length)
412throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)));
414if (charCount < 0 || charCount > chars.Length - charIndex)
FrameworkFork\System.Runtime.Serialization\System\Text\BinHexEncoding.cs (14)
56if (charIndex > chars.Length)
57throw new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length));
60if (charCount > chars.Length - charIndex)
61throw new ArgumentOutOfRangeException("charCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - charIndex));
66if (byteIndex > bytes.Length)
67throw new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length));
69if (byteCount < 0 || byteCount > bytes.Length - byteIndex)
127if (byteIndex > bytes.Length)
128throw new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length));
131if (byteCount > bytes.Length - byteIndex)
132throw new ArgumentOutOfRangeException("byteCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex));
138if (charIndex > chars.Length)
139throw new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length));
140if (charCount < 0 || charCount > chars.Length - charIndex)
FrameworkFork\System.Runtime.Serialization\System\Xml\ArrayHelper.cs (7)
32while (read < array.Length)
34int actual = ReadArray(reader, localName, namespaceUri, array, read, array.Length - read);
40if (read < array.Length || reader.NodeType == XmlNodeType.EndElement)
47if (totalRead != array.Length || arrayCount > 0)
53Array.Copy(arrays[i], 0, newArray, offset, arrays[i].Length);
54offset += arrays[i].Length;
72int actual = ReadArray(reader, localName, namespaceUri, array, 0, array.Length);
FrameworkFork\System.Runtime.Serialization\System\Xml\EncodingStreamWrapper.cs (13)
210if (bom.Length > 0)
211_stream.Write(bom, 0, bom.Length);
390if (!Compare(s_encodingAttr, buffer, i - s_encodingAttr.Length + 1))
416if (encCount == s_encodingUTF8.Length && CompareCaseInsensitive(s_encodingUTF8, buffer, encStart))
420else if (encCount == s_encodingUnicodeLE.Length && CompareCaseInsensitive(s_encodingUnicodeLE, buffer, encStart))
424else if (encCount == s_encodingUnicodeBE.Length && CompareCaseInsensitive(s_encodingUnicodeBE, buffer, encStart))
428else if (encCount == s_encodingUnicode.Length && CompareCaseInsensitive(s_encodingUnicode, buffer, encStart))
431ThrowEncodingMismatch(s_safeUTF8.GetString(buffer, encStart, encCount), s_safeUTF8.GetString(s_encodingUTF8, 0, s_encodingUTF8.Length));
444for (int i = 0; i < key.Length; i++)
457for (int i = 0; i < key.Length; i++)
629_byteCount = _stream.Read(_bytes, _byteCount, (_chars.Length - 1) * 2);
721int size = _chars.Length < count ? _chars.Length : count;
FrameworkFork\System.Runtime.Serialization\System\Xml\UniqueId.cs (13)
90if (offset > guid.Length)
91throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, guid.Length)));
92if (guidLength > guid.Length - offset)
130if (offset > chars.Length)
131throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)));
134if (count > chars.Length - offset)
135throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - offset)));
274if (offset > chars.Length)
275throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)));
277if (count > chars.Length - offset)
361if (offset > buffer.Length)
362throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, buffer.Length)));
364if (guidLength > buffer.Length - offset)
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (6)
455if (actualLength != buffer.Length)
525return Base64Encoding.GetString(bytes, 0, bytes.Length);
654DiagnosticUtility.DebugAssert(offset + count <= chars.Length, string.Format("offset '{0}' + count '{1}' MUST BE <= chars.Length '{2}'", offset, count, chars.Length));
737DiagnosticUtility.DebugAssert(byteOffset + actualByteCount < bytes.Length,
738string.Format("byteOffset {0} + actualByteCount {1} MUST BE < bytes.Length {2}", byteOffset, actualByteCount, bytes.Length));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseReader.cs (33)
297else if (_elementNodes.Length == _depth)
331else if (_attributeNodes.Length == attributeIndex)
488if (_attributeNodes != null && _attributeNodes.Length > 16)
490if (_elementNodes != null && _elementNodes.Length > 16)
1071for (int i = 0; i < localNames.Length; i++)
1086for (int i = 0; i < localNames.Length; i++)
1113for (int i = 0; i < localNames.Length; i++)
1128for (int i = 0; i < localNames.Length; i++)
1149if (offset > chars.Length)
1150throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)));
1153if (count > chars.Length - offset)
1154throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - offset)));
1179if (offset > buffer.Length)
1180throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, buffer.Length)));
1183if (count > buffer.Length - offset)
1184throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
1295if (value.Length > _quotas.MaxArrayLength)
1303return ReadContentAsBase64(_quotas.MaxArrayLength, _bufferReader.Buffer.Length);
1339if (offset > buffer.Length)
1340throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, buffer.Length)));
1343if (count > buffer.Length - offset)
1344throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
1866if (_chars == null || _chars.Length < count)
2469if (_indeces != null && _indeces.Length > 32)
2479if (_indeces != null && _indeces.Length == _attributeCount && IsSorted())
2483for (int i = 0; i < newIndeces.Length; i++)
2492for (int i = 0; i < _indeces.Length - 1; i++)
2569if (_namespaces != null && _namespaces.Length > 32)
2571if (_attributes != null && _attributes.Length > 4)
2593nameSpace.Uri.SetValue(3, xmlBuffer.Length - 3);
2630for (int i = 0; i < _shortPrefixUri.Length; i++)
2694else if (_attributes.Length == _attributeCount)
2732else if (_namespaces.Length == _nsCount)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryReader.cs (9)
41if (offset > buffer.Length)
42throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, buffer.Length)));
45if (count > buffer.Length - offset)
46throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
1006BufferReader.InsertBytes(buffer, 0, buffer.Length);
1211if (offset > array.Length)
1212throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, array.Length)));
1215if (count > array.Length - offset)
1216throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, array.Length - offset)));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryReader.cs (20)
42return CreateBinaryReader(buffer, 0, buffer.Length, quotas);
84return CreateTextReader(buffer, 0, buffer.Length, quotas);
239for (int i = 0; i < localNames.Length; i++)
265for (int i = 0; i < localNames.Length; i++)
411while (read < buffer.Length)
415actual = ReadContentAsBase64(buffer, read, buffer.Length - read);
417actual = ReadContentAsBinHex(buffer, read, buffer.Length - read);
423if (read < buffer.Length)
431Buffer.BlockCopy(buffers[i], 0, buffer, offset, buffers[i].Length);
432offset += buffers[i].Length;
485Guid[] guids = new Guid[values.Length];
486for (int i = 0; i < values.Length; i++)
493UniqueId[] uniqueIds = new UniqueId[values.Length];
494for (int i = 0; i < values.Length; i++)
507for (int i = 0; i < strings.Length; i++)
527for (int i = 0; i < strings.Length; i++)
897if (offset > array.Length)
898throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, array.Length)));
901if (count > array.Length - offset)
902throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, array.Length - offset)));
FrameworkFork\System.ServiceModel\Internals\System\Runtime\UrlUtility.cs (4)
90return AsciiEncoding.GetString(bytes, 0, bytes.Length);
151bytes = UrlEncodeBytesToBytesInternalNonAscii(bytes, 0, bytes.Length, false);
153return AsciiEncoding.GetString(bytes, 0, bytes.Length);
173return UrlEncodeBytesToBytesInternal(bytes, 0, bytes.Length, false);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingChannels.cs (18)
54Connection.Write(SessionEncoder.EndBytes, 0, SessionEncoder.EndBytes.Length, true, timeout);
59return Connection.WriteAsync(SessionEncoder.EndBytes, 0, SessionEncoder.EndBytes.Length, true, timeout);
90return this.Connection.BeginWrite(SessionEncoder.EndBytes, 0, SessionEncoder.EndBytes.Length,
200int startSize = ClientDuplexEncoder.ModeBytes.Length + SessionEncoder.CalcStartSize(encodedVia, encodedContentType);
205startSize += ClientDuplexEncoder.PreambleEndBytes.Length;
209Buffer.BlockCopy(ClientDuplexEncoder.ModeBytes, 0, startBytes, 0, ClientDuplexEncoder.ModeBytes.Length);
210SessionEncoder.EncodeStart(startBytes, ClientDuplexEncoder.ModeBytes.Length, encodedVia, encodedContentType);
213Buffer.BlockCopy(ClientDuplexEncoder.PreambleEndBytes, 0, startBytes, preambleEndOffset, ClientDuplexEncoder.PreambleEndBytes.Length);
267await connection.WriteAsync(ClientDuplexEncoder.PreambleEndBytes, 0, ClientDuplexEncoder.PreambleEndBytes.Length, true, timeoutHelper.RemainingTime());
270int ackBytesRead = await connection.ReadAsync(ackBuffer, 0, ackBuffer.Length, timeoutHelper.RemainingTime());
301connection.Write(ClientDuplexEncoder.PreambleEndBytes, 0, ClientDuplexEncoder.PreambleEndBytes.Length, true, timeoutHelper.RemainingTime());
305int ackBytesRead = connection.Read(ackBuffer, 0, ackBuffer.Length, timeoutHelper.RemainingTime());
495int size = connection.Read(faultBuffer, offset, faultBuffer.Length, timeoutHelper.RemainingTime());
518size = connection.Read(faultBuffer, offset, faultBuffer.Length, timeoutHelper.RemainingTime());
535connection.Write(encodedUpgrade.EncodedBytes, 0, encodedUpgrade.EncodedBytes.Length, true, timeoutHelper.RemainingTime());
539int size = connection.Read(buffer, 0, buffer.Length, timeoutHelper.RemainingTime());
569await connection.WriteAsync(encodedUpgrade.EncodedBytes, 0, encodedUpgrade.EncodedBytes.Length, true, timeout);
573int size = await connection.ReadAsync(buffer, 0, buffer.Length, timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingEncoders.cs (15)
80(_encodedBytes[_encodedBytes.Length / 2] << 8) |
81_encodedBytes[_encodedBytes.Length - 1];
98if (_encodedBytes.Length != otherBytes.Length)
101for (int i = 0; i < _encodedBytes.Length; i++)
209return via.EncodedBytes.Length + contentType.EncodedBytes.Length;
214Buffer.BlockCopy(via.EncodedBytes, 0, buffer, offset, via.EncodedBytes.Length);
215Buffer.BlockCopy(contentType.EncodedBytes, 0, buffer, offset + via.EncodedBytes.Length, contentType.EncodedBytes.Length);
343return via.EncodedBytes.Length + contentType.EncodedBytes.Length;
348Buffer.BlockCopy(via.EncodedBytes, 0, buffer, offset, via.EncodedBytes.Length);
349Buffer.BlockCopy(contentType.EncodedBytes, 0, buffer, offset + via.EncodedBytes.Length, contentType.EncodedBytes.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SessionConnectionReader.cs (4)
148var result = _connection.BeginRead(0, _buffer.Length, timeoutHelper.RemainingTime(), TaskHelpers.OnAsyncCompletionCallback, tcs);
205(EnvelopeSize - EnvelopeOffset) >= _buffer.Length)
207bytesRead = _connection.Read(EnvelopeBuffer, EnvelopeOffset, _buffer.Length, timeoutHelper.RemainingTime());
212bytesRead = _connection.Read(_buffer, 0, _buffer.Length, timeoutHelper.RemainingTime());
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\PrimitiveOperationFormatter.cs (18)
519if (parts.Length != parameters.Length)
521new ArgumentException(string.Format(SRServiceModel.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters"));
526for (int i = nextPartIndex; i < parts.Length; i++)
584if (parts.Length != parameters.Length)
586new ArgumentException(string.Format(SRServiceModel.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters"));
589for (int i = 0; i < parts.Length; i++)
813writer.WriteBase64(arrayValue, 0, arrayValue.Length);
819writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
825writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
831writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
837writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
843writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
849writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
855writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\DataProtectionSecurityStateEncoder.cs (5)
34_entropy = DiagnosticUtility.Utility.AllocateByteArray(entropy.Length);
35Buffer.BlockCopy(entropy, 0, _entropy, 0, entropy.Length);
52result = DiagnosticUtility.Utility.AllocateByteArray(_entropy.Length);
53Buffer.BlockCopy(_entropy, 0, result, 0, _entropy.Length);
63result.AppendFormat("{0} Entropy Length={1}", Environment.NewLine, (_entropy == null) ? 0 : _entropy.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityUtils.cs (13)
173for (int i = 0; i < s_TokenImpersonationLevelOrder.Length; i++)
436while (read < buffer.Length)
438int actual = reader.ReadContentAsBase64(buffer, read, buffer.Length - read);
446if (read < buffer.Length)
454Buffer.BlockCopy(buffers[i], 0, buffer, offset, buffers[i].Length);
455offset += buffers[i].Length;
852byte[] copy = Fx.AllocateByteArray(buffer.Length);
853Buffer.BlockCopy(buffer, 0, copy, 0, buffer.Length);
859certificate = (rawData == null || rawData.Length == 0) ? null : new X509Certificate2(rawData);
965if (partsWithSlashDelimiter.Length == 2 && partsWithAtDelimiter.Length == 1)
972else if (partsWithSlashDelimiter.Length == 1 && partsWithAtDelimiter.Length == 2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSUtilitySpecificationVersion.cs (6)
98writer.WriteChars(creationTime, 0, creationTime.Length);
103writer.WriteChars(expiryTime, 0, expiryTime.Length);
154stream.Write(_fragment1, 0, _fragment1.Length);
156stream.Write(_fragment2, 0, _fragment2.Length);
158stream.Write(_fragment3, 0, _fragment3.Length);
160stream.Write(_fragment4, 0, _fragment4.Length);
dotnet-svcutil-lib.Tests (2)
dotnet-user-jwts (11)
dotnet-user-secrets (7)
Extensibility.MessageEncoder.IntegrationTests (1)
Extensibility.WebSockets.IntegrationTests (3)
GenerateRulesMissingDocumentation (2)
GetDocument.Insider (8)
HeaderPropagationSample (1)
HostedBlazorWebassemblyApp.Server (1)
HostFilteringSample (1)
http2cat (22)
HttpStress (10)
IdeCoreBenchmarks (4)
Identity.DefaultUI.WebSite (1)
IIS.Common.TestLib (2)
IIS.FunctionalTests (31)
IIS.LongTests (29)
IIS.Microbenchmarks (1)
IIS.NewHandler.FunctionalTests (29)
IIS.NewShim.FunctionalTests (29)
IIS.ShadowCopy.Tests (9)
IIS.Tests (2)
IISExpress.FunctionalTests (34)
illink (39)
ILLink.RoslynAnalyzer (2)
ILLink.Tasks (2)
Infrastructure.Common (9)
InMemory.FunctionalTests (227)
ChunkedRequestTests.cs (9)
29var count = await request.Body.ReadAsync(buffer, 0, buffer.Length);
66response.Headers["Content-Length"] = bytes.Length.ToString(CultureInfo.InvariantCulture);
67await response.Body.WriteAsync(bytes, 0, bytes.Length);
261while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0)
498while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) != 0)
542while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) != 0)
587while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0)
669while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0)
713while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0)
Http2\Http2ConnectionTests.cs (50)
793withLength: _maxData.Length,
841withLength: _maxData.Length,
856withLength: _maxData.Length,
868withLength: _maxData.Length,
883withLength: _maxData.Length,
903var updateSize = ((framesInStreamWindow / 2) + 1) * _maxData.Length;
905updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length;
947for (var i = 0; i < _helloWorldBytes.Length; i++)
1074withLength: _maxData.Length,
1089withLength: _maxData.Length,
1101withLength: _maxData.Length,
1122withLength: _maxData.Length,
1135withLength: _maxData.Length,
1151var updateSize = ((framesInStreamWindow / 2) + 1) * _maxData.Length;
1153updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length;
1265var maxDataMinusPadding = _maxData.AsMemory(0, _maxData.Length - padLength - 1);
1310withLength: _maxData.Length,
1326var updateSize = ((framesInWindow / 2) + 1) * _maxData.Length;
1365var updateSize = ((framesConnectionInWindow / 2) + 1) * _maxData.Length;
1388while (readResult.Buffer.Length != _maxData.Length * 4)
1397Assert.Equal(readResult.Buffer.Length, _maxData.Length * 5);
1437withLength: _maxData.Length,
1462var updateSize = ((framesInStreamWindow / 2) + 1) * _maxData.Length;
1464updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length;
1896var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length;
1897var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length;
1898var remainingBytesAfterBackpressure = _maxData.Length - remainingBytesBeforeBackpressure;
1913await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
1937withLength: _maxData.Length,
3186var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length;
3187var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length;
3217await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
3246withLength: _maxData.Length,
3279withLength: _maxData.Length,
3307var initialWindowSize = _helloWorldBytes.Length / 2;
3331await context.Response.Body.WriteAsync(_helloWorldBytes, 0, _helloWorldBytes.Length);
3419var updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length;
4209var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length;
4210var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length;
4240await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
4269withLength: _maxData.Length,
4314var initialWindowSize = _helloWorldBytes.Length / 2;
4338await context.Response.Body.WriteAsync(_helloWorldBytes, 0, _helloWorldBytes.Length);
4567var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length;
4589await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
4593var lastWriteTask = context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
4620withLength: _maxData.Length,
4625var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length;
4626var remainingBytesAfterBackpressure = _maxData.Length - remainingBytesBeforeBackpressure;
4660var initialWindowSize = _helloWorldBytes.Length / 2;
Http2\Http2StreamTests.cs (24)
878var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
880read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
908var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
910read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
956var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
960read = await context.Request.Body.ReadAsync(buffer, total, buffer.Length - total);
1050var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
1054read = await context.Request.Body.ReadAsync(buffer, total, buffer.Length - total);
1151while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
1186while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
1221while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
1257while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
1867var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
1869read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
1912while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
1953var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
1955read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
1997while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
2058while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
2114var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
2117read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
3429var thrownExTask = Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Request.Body.ReadAsync(buffer, 0, buffer.Length));
3454var thrownExTask = Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Request.Body.ReadAsync(buffer, 0, buffer.Length));
3637for (var i = 0; i < frames.Length; i++)
Http2\Http2TestBase.cs (9)
241while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0)
254while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0)
265while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0)
341received += await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
344var stalledReadTask = context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
819frame.PayloadLength = payload.Length;
894frame.PayloadLength = headerBlock.Length;
959frame.PayloadLength = payload.Length;
1322if (expectedErrorMessage?.Length > 0)
Http2\Http2TimeoutTests.cs (21)
166withLength: _helloWorldBytes.Length,
337while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0)
375AdvanceTime(TimeSpan.FromSeconds((_bytesReceived + _helloWorldBytes.Length) / limits.MinResponseDataRate.BytesPerSecond) +
386withLength: _helloWorldBytes.Length,
427var timeToWriteMaxData = TimeSpan.FromSeconds((_bytesReceived + _maxData.Length) / limits.MinResponseDataRate.BytesPerSecond) +
441withLength: _maxData.Length,
516_clientSettings.InitialWindowSize = (uint)_maxData.Length - 1;
570_clientSettings.InitialWindowSize = (uint)_maxData.Length - 1;
638await StartStreamAsync(1, ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false);
685await StartStreamAsync(1, ReadRateRequestHeaders(_maxData.Length), endStream: false);
700var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5);
736await StartStreamAsync(1, ReadRateRequestHeaders(_maxData.Length), endStream: false);
749await StartStreamAsync(3, ReadRateRequestHeaders(_maxData.Length), endStream: false);
761var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond);
803await StartStreamAsync(1, ReadRateRequestHeaders(_maxData.Length), endStream: false);
821await StartStreamAsync(3, ReadRateRequestHeaders(_maxData.Length), endStream: false);
835var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5);
876await StartStreamAsync(1, ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false);
946await StartStreamAsync(3, ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false);
976var expectedUpdateSize = ((framesConnectionInWindow / 2) + 1) * _maxData.Length + _helloWorldBytes.Length;
Http3\Http3StreamTests.cs (16)
559var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
561read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
588var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
592read = await context.Request.Body.ReadAsync(buffer, total, buffer.Length - total);
726for (var i = 0; i < data.Length; i++)
737while (receivedData.Count < data.Length)
2508var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
2510read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
2546while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
2581var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
2583read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
2618while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
2671while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { }
2719var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
2722read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
2853for (var i = 0; i < sourceData.Length; i++)
Http3\Http3TimeoutTests.cs (14)
351var requestStream = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false);
434while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0)
470Http3Api.AdvanceTime(TimeSpan.FromSeconds((requestStream.BytesReceived + _helloWorldBytes.Length) / limits.MinResponseDataRate.BytesPerSecond) +
481Assert.Equal(_helloWorldBytes.Length, data.Length);
511var timeToWriteMaxData = TimeSpan.FromSeconds((requestStream.BytesReceived + _maxData.Length) / limits.MinResponseDataRate.BytesPerSecond) +
545var requestStream = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false);
554var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5);
591var requestStream1 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false);
597var requestStream2 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false);
603var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond);
648var requestStream1 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false);
657var requestStream2 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false);
665var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5);
709var requestStream = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false);
RequestTests.cs (9)
135var task = context.Request.Body.ReadAsync(data, 0, data.Length, cts.Token);
1130Assert.Equal(22, ms1.ToArray().Length);
1363await duplexStream.WriteAsync(data, 0, data.Length);
1418context.Response.ContentLength = request.Length;
1420await context.Response.Body.WriteAsync(request, 0, request.Length);
1603await duplexStream.WriteAsync(response, 0, response.Length);
1651await stream.WriteAsync(response, 0, response.Length);
2337var mask = Math.Pow(2, lines.Length) - 1;
2345for (var pos = 0; pos < lines.Length; pos++)
ResponseTests.cs (26)
161var writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout();
168writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout();
1041await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length));
1076await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length));
1721httpContext.Response.ContentLength = response.Length - 1;
1724await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length));
1763httpContext.Response.ContentLength = response.Length - 1;
1766await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, 0, response.Length));
1805httpContext.Response.ContentLength = response.Length - 1;
1808await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length / 2));
1809await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2));
1850httpContext.Response.ContentLength = response.Length - 1;
1853await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, 0, response.Length / 2));
1854await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2));
1893httpContext.Response.ContentLength = response.Length - 1;
1896return httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)).AsTask();
1933httpContext.Response.ContentLength = response.Length - 1;
1936await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length / 2));
1937await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2));
2379await stream.WriteAsync(response, 0, response.Length);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
24} while (read != 0 && offset < buffer.Length);
41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
43} while (read != 0 && offset < buffer.Length);
45Assert.True(offset >= buffer.Length);
57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
InProcessWebSite (10)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (9)
631var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
635result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
644var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
649result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
719count += await ctx.Request.Body.ReadAsync(data, count, data.Length - count);
720} while (count != data.Length);
721await ctx.Response.Body.WriteAsync(data, 0, data.Length);
737var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
744result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
installer.tasks (21)
InteractiveHost.UnitTests (1)
InteractiveHost32 (1)
InteractiveHost64 (1)
Interop.FunctionalTests (34)
HttpClientHttp2InteropTests.cs (10)
204for (var i = 0; i < Content.Length; i++)
216await stream.WriteAsync(Content, 0, Content.Length, timer.Token).DefaultTimeout();
236read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout();
242Assert.True(totalRead <= Repetitions * Content.Length, "Too Long");
246Assert.Equal(Content[patternOffset % Content.Length], buffer[offset]);
251read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout();
254Assert.True(totalRead == Repetitions * Content.Length, "Too Short");
1505read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length).DefaultTimeout();
1727var read = await stream.ReadAsync(responseBuffer, totalRead, responseBuffer.Length - totalRead).DefaultTimeout();
1733} while (totalRead < responseBuffer.Length);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
24} while (read != 0 && offset < buffer.Length);
41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
43} while (read != 0 && offset < buffer.Length);
45Assert.True(offset >= buffer.Length);
57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
IOperationGenerator (1)
Keycloak.ApiService (1)
KeyManagementSimulator (4)
Microsoft.Analyzers.Extra (1)
Microsoft.Analyzers.Extra.Tests (1)
Microsoft.Analyzers.Local (3)
Microsoft.Analyzers.Local.Tests (4)
Microsoft.AspNetCore (2)
Microsoft.AspNetCore.Analyzer.Testing (7)
Microsoft.AspNetCore.Antiforgery (14)
Microsoft.AspNetCore.Antiforgery.Test (3)
Microsoft.AspNetCore.App.Analyzers (4)
Microsoft.AspNetCore.App.Analyzers.Test (12)
Microsoft.AspNetCore.App.UnitTests (5)
Microsoft.AspNetCore.Authentication (1)
Microsoft.AspNetCore.Authentication.Abstractions (1)
Microsoft.AspNetCore.Authentication.Certificate (1)
Microsoft.AspNetCore.Authentication.Cookies (1)
Microsoft.AspNetCore.Authentication.Facebook (1)
Microsoft.AspNetCore.Authentication.Google (1)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (2)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
Microsoft.AspNetCore.Authentication.Test (3)
Microsoft.AspNetCore.Authentication.Twitter (1)
Microsoft.AspNetCore.Authentication.WsFederation (1)
Microsoft.AspNetCore.Authorization (3)
Microsoft.AspNetCore.Authorization.Policy (2)
Microsoft.AspNetCore.Components (63)
Microsoft.AspNetCore.Components.Analyzers (2)
Microsoft.AspNetCore.Components.Analyzers.Tests (18)
Microsoft.AspNetCore.Components.Authorization (2)
Microsoft.AspNetCore.Components.Endpoints (19)
Microsoft.AspNetCore.Components.Endpoints.Tests (18)
Binding\FormDataMapperTests.cs (8)
2031Assert.Equal(expectedString, Encoding.UTF8.GetString(buffer, 0, buffer.Length));
2066Assert.Equal(expectedString1, Encoding.UTF8.GetString(buffer1, 0, buffer1.Length));
2073Assert.Equal(expectedString1, Encoding.UTF8.GetString(buffer2, 0, buffer2.Length));
2248if (components.Length != 2)
2296if (components.Length != 2)
2343if (buffer.Count >= buffer.Data.Length)
2345var newBuffer = Rent(buffer.Data.Length * 2);
2346Array.Copy(buffer.Data, newBuffer, buffer.Data.Length);
Microsoft.AspNetCore.Components.Forms (1)
Microsoft.AspNetCore.Components.Forms.Tests (6)
Microsoft.AspNetCore.Components.Performance (5)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (18)
Microsoft.AspNetCore.Components.Server (41)
Microsoft.AspNetCore.Components.Server.Tests (23)
Microsoft.AspNetCore.Components.Tests (19)
Rendering\ArrayBuilderTest.cs (9)
87builder.Append(array, 0, array.Length);
90Assert.Equal(array.Length, builder.Count);
91Assert.Equal(array, builder.Buffer.Take(array.Length));
122builder.Append(array, 0, array.Length);
125Assert.Equal(array.Length, builder.Count);
126Assert.Equal(array, builder.Buffer.Take(array.Length));
313buffer => Assert.Equal(2, buffer.Length),
314buffer => Assert.Equal(4, buffer.Length),
315buffer => Assert.Equal(8, buffer.Length));
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.Components.Web.Tests (6)
Microsoft.AspNetCore.Components.WebAssembly (7)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Components.WebAssembly.Tests (2)
Microsoft.AspNetCore.Components.WebView (22)
Microsoft.AspNetCore.Components.WebViewE2E.Test (1)
Microsoft.AspNetCore.Connections.Abstractions (6)
Microsoft.AspNetCore.CookiePolicy.Test (1)
Microsoft.AspNetCore.Cors (1)
Microsoft.AspNetCore.Cryptography.Internal (1)
Microsoft.AspNetCore.Cryptography.Internal.Tests (5)
Microsoft.AspNetCore.Cryptography.KeyDerivation (15)
Microsoft.AspNetCore.Cryptography.KeyDerivation.Tests (5)
Microsoft.AspNetCore.DataProtection (88)
Cng\DpapiSecretSerializerHelper.cs (9)
55return ProtectWithDpapiCore(pbPlaintextSecret, (uint)plaintextSecret.Length, pbPurpose, (uint)_purpose.Length, fLocalMachine: protectToLocalMachine);
61Array.Clear(plaintextSecret, 0, plaintextSecret.Length);
134cbData: (uint)plaintextSecret.Length);
139Array.Clear(plaintextSecret, 0, plaintextSecret.Length);
204return UnprotectWithDpapiCore(pbProtectedSecret, (uint)protectedSecret.Length, pbPurpose, (uint)_purpose.Length);
268cbData: (uint)protectedData.Length);
329cbData: (uint)protectedData.Length);
Managed\AesGcmAuthenticatedEncryptor.cs (7)
134Array.Clear(decryptedKdk, 0, decryptedKdk.Length);
135Array.Clear(derivedKey, 0, derivedKey.Length);
173Buffer.BlockCopy(keyModifier, 0, retVal, (int)preBufferSize, keyModifier.Length);
174Buffer.BlockCopy(nonceBytes, 0, retVal, (int)preBufferSize + keyModifier.Length, nonceBytes.Length);
210Array.Clear(decryptedKdk, 0, decryptedKdk.Length);
211Array.Clear(derivedKey, 0, derivedKey.Length);
Managed\ManagedAuthenticatedEncryptor.cs (28)
118CryptoUtil.Assert(ciphertext != null && ciphertext.Length == _symmetricAlgorithmBlockSizeInBytes, "ciphertext != null && ciphertext.Length == _symmetricAlgorithmBlockSizeInBytes");
119Buffer.BlockCopy(ciphertext, 0, retVal, idx, ciphertext.Length);
129CryptoUtil.Assert(digest != null && digest.Length == _validationAlgorithmDigestLengthInBytes, "digest != null && digest.Length == _validationAlgorithmDigestLengthInBytes");
130Buffer.BlockCopy(digest, 0, retVal, idx, digest.Length);
134CryptoUtil.Assert(idx == retVal.Length, "idx == retVal.Length");
191Buffer.BlockCopy(protectedPayload.Array!, ivOffset, iv, 0, iv.Length);
199var derivedKeysBuffer = new byte[checked(decryptionSubkey.Length + validationSubkey.Length)];
217Buffer.BlockCopy(derivedKeysBuffer, 0, decryptionSubkey, 0, decryptionSubkey.Length);
218Buffer.BlockCopy(derivedKeysBuffer, decryptionSubkey.Length, validationSubkey, 0, validationSubkey.Length);
237if (!CryptoUtil.TimeConstantBuffersAreEqual(correctHash, 0, correctHash.Length, protectedPayload.Array!, macOffset, eofOffset - macOffset))
261Array.Clear(decryptedKdk, 0, decryptedKdk.Length);
262Array.Clear(decryptionSubkey, 0, decryptionSubkey.Length);
263Array.Clear(validationSubkey, 0, validationSubkey.Length);
264Array.Clear(derivedKeysBuffer, 0, derivedKeysBuffer.Length);
297outputStream.Write(keyModifier, 0, keyModifier.Length);
298outputStream.Write(iv, 0, iv.Length);
308var derivedKeysBuffer = new byte[checked(encryptionSubkey.Length + validationSubkey.Length)];
326Buffer.BlockCopy(derivedKeysBuffer, 0, encryptionSubkey, 0, encryptionSubkey.Length);
327Buffer.BlockCopy(derivedKeysBuffer, encryptionSubkey.Length, validationSubkey, 0, validationSubkey.Length);
350outputStream.Write(mac, 0, mac.Length);
361Array.Clear(decryptedKdk, 0, decryptedKdk.Length);
362Array.Clear(encryptionSubkey, 0, encryptionSubkey.Length);
363Array.Clear(validationSubkey, 0, validationSubkey.Length);
364Array.Clear(derivedKeysBuffer, 0, derivedKeysBuffer.Length);
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (9)
26prfInput[prfInput.Length - 4] = (byte)(outputSizeInBits >> 24);
27prfInput[prfInput.Length - 3] = (byte)(outputSizeInBits >> 16);
28prfInput[prfInput.Length - 2] = (byte)(outputSizeInBits >> 8);
29prfInput[prfInput.Length - 1] = (byte)(outputSizeInBits);
46CryptoUtil.Assert(prfOutputSizeInBytes == prfOutput.Length, "prfOutputSizeInBytes == prfOutput.Length");
49Array.Clear(prfOutput, 0, prfOutput.Length); // contains key material, so delete it
60var combinedContext = new byte[checked(contextHeader.Length + context.Count)];
61Buffer.BlockCopy(contextHeader, 0, combinedContext, 0, contextHeader.Length);
62Buffer.BlockCopy(context.Array!, context.Offset, combinedContext, contextHeader.Length, context.Count);
Microsoft.AspNetCore.DataProtection.Abstractions (7)
Microsoft.AspNetCore.DataProtection.Extensions (6)
Microsoft.AspNetCore.DataProtection.Tests (16)
SP800_108\SP800_108Tests.cs (11)
81for (int i = 0; i < kdk.Length; i++)
105for (int i = 0; i < kdk.Length; i++)
129for (int i = 0; i < kdk.Length; i++)
151ISP800_108_CTR_HMACSHA512Provider provider = factory(pbKdk, (uint)kdk.Length);
152provider.DeriveKeyWithContextHeader(pbLabel, (uint)label.Length, contextHeader, pbContext, (uint)context.Length, pbDerivedSubkey, (uint)derivedSubkey.Length);
160var labelSegment = new ArraySegment<byte>(new byte[label.Length + 10], 3, label.Length);
162var contextSegment = new ArraySegment<byte>(new byte[context.Length + 10], 5, context.Length);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (11)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
555Array.Clear(keyBytes, 0, keyBytes.Length);
556Array.Clear(pem, 0, pem.Length);
562Array.Clear(keyBytes, 0, keyBytes.Length);
563Array.Clear(pem, 0, pem.Length);
613Array.Clear(bytes, 0, bytes.Length);
641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
Microsoft.AspNetCore.Diagnostics (7)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
Microsoft.AspNetCore.Diagnostics.Middleware (15)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (12)
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (4)
Microsoft.AspNetCore.HeaderParsing (1)
Microsoft.AspNetCore.HostFiltering (2)
Microsoft.AspNetCore.Hosting (26)
Microsoft.AspNetCore.Hosting.Tests (4)
Microsoft.AspNetCore.Http (12)
Microsoft.AspNetCore.Http.Abstractions (46)
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (4)
Microsoft.AspNetCore.Http.Abstractions.Tests (7)
Microsoft.AspNetCore.Http.Connections (10)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.Http.Connections.Tests (29)
HttpConnectionDispatcherTests.cs (8)
216requestBody.Write(bytes, 0, bytes.Length);
586requestBody.Write(bytes, 0, bytes.Length);
650requestBody.Write(bytes, 0, bytes.Length);
2576requestBody.Write(buffer, 0, buffer.Length);
2636requestBody.Write(buffer, 0, buffer.Length);
2640await connection.ApplicationStream.WriteAsync(buffer, 0, buffer.Length).DefaultTimeout();
2693requestBody.Write(buffer, 0, buffer.Length);
2697await connection.ApplicationStream.WriteAsync(buffer, 0, buffer.Length).DefaultTimeout();
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20];
37Array.Copy(data, 0, startSegment, 10, data.Length);
38return new ReadOnlySequence<byte>(startSegment, 10, data.Length);
51var startSegment = new byte[data.Length + 20];
52Array.Copy(data, 0, startSegment, 10, data.Length);
53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length));
66var startSegment = new byte[data.Length + 20];
67Array.Copy(data, 0, startSegment, 10, data.Length);
68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory);
94var segments = new List<byte[]>((data.Length * 2) + 1);
109if (inputs == null || inputs.Length == 0)
122int length = s.Length;
144} while (i < inputs.Length);
Microsoft.AspNetCore.Http.Extensions (54)
src\Shared\PropertyAsParameterInfo.cs (16)
69if (parameters.Length == 0)
77for (var i = 0; i < parameters.Length; i++)
91List<ParameterInfo> list = new(parameters.Length);
107if (constructor is not null && constructorParameters is { Length: > 0 })
144if (constructorAttributes == null || constructorAttributes is { Length: 0 })
151var mergedAttributes = new Attribute[constructorAttributes.Length + propertyAttributes.Length];
152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length);
153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
162if (constructorAttributes == null || constructorAttributes is { Length: 0 })
171var mergedAttributes = new object[constructorAttributes.Length + propertyAttributes.Length];
172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length);
173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
Microsoft.AspNetCore.Http.Extensions.Tests (37)
Microsoft.AspNetCore.Http.Microbenchmarks (3)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (18)
Microsoft.AspNetCore.Http.Results (2)
Microsoft.AspNetCore.Http.Results.Tests (9)
Microsoft.AspNetCore.Http.Tests (12)
Features\FormFeatureTests.cs (7)
620var toWrite = Math.Min(size - written, bytes.Length);
641stream.Write(bytes, 0, bytes.Length);
647stream.Write(bytes, 0, bytes.Length);
656var readA = streamA.Read(bytesA, 0, bytesA.Length);
657var readB = streamB.Read(bytesB, 0, bytesB.Length);
670readA = streamA.Read(bytesA, 0, bytesA.Length);
671readB = streamB.Read(bytesB, 0, bytesB.Length);
Microsoft.AspNetCore.HttpLogging (14)
Microsoft.AspNetCore.HttpLogging.Tests (11)
Microsoft.AspNetCore.HttpOverrides (33)
Microsoft.AspNetCore.Identity (5)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (2)
Microsoft.AspNetCore.Identity.FunctionalTests (7)
Microsoft.AspNetCore.Identity.InMemory.Test (2)
Microsoft.AspNetCore.Identity.Test (2)
Microsoft.AspNetCore.Identity.UI (3)
Microsoft.AspNetCore.InternalTesting (1)
Microsoft.AspNetCore.InternalTesting.Tests (1)
Microsoft.AspNetCore.JsonPatch (3)
Microsoft.AspNetCore.Localization (4)
Microsoft.AspNetCore.Localization.Tests (1)
Microsoft.AspNetCore.Mvc.Abstractions (15)
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
Microsoft.AspNetCore.Mvc.ApiExplorer (16)
src\Shared\PropertyAsParameterInfo.cs (15)
69if (parameters.Length == 0)
77for (var i = 0; i < parameters.Length; i++)
91List<ParameterInfo> list = new(parameters.Length);
144if (constructorAttributes == null || constructorAttributes is { Length: 0 })
151var mergedAttributes = new Attribute[constructorAttributes.Length + propertyAttributes.Length];
152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length);
153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
162if (constructorAttributes == null || constructorAttributes is { Length: 0 })
171var mergedAttributes = new object[constructorAttributes.Length + propertyAttributes.Length];
172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length);
173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
Microsoft.AspNetCore.Mvc.Core (114)
Microsoft.AspNetCore.Mvc.Core.Test (32)
Microsoft.AspNetCore.Mvc.Core.TestCommon (2)
Microsoft.AspNetCore.Mvc.Cors (1)
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (48)
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
Microsoft.AspNetCore.Mvc.Localization (1)
Microsoft.AspNetCore.Mvc.Localization.Test (2)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (5)
Microsoft.AspNetCore.Mvc.Razor (9)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (8)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (3)
Microsoft.AspNetCore.Mvc.Razor.Test (3)
RazorPageTest.cs (3)
1032page.BeginAddHtmlAttributeValues(executionContext, "someattr", attributeValues.Length, HtmlAttributeValueStyle.SingleQuotes);
1078page.BeginAddHtmlAttributeValues(executionContext, "someattr", attributeValues.Length, HtmlAttributeValueStyle.SingleQuotes);
1246page.BeginWriteAttribute("someattr", prefix, 0, suffix, 0, attributeValues.Length);
Microsoft.AspNetCore.Mvc.RazorPages (20)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Microsoft.AspNetCore.Mvc.TagHelpers (14)
Cache\DistributedCacheTagHelperService.cs (10)
168var keyLength = BitConverter.GetBytes(serializedKey.Length);
170buffer.Write(keyLength, 0, keyLength.Length);
171buffer.Write(serializedKey, 0, serializedKey.Length);
172buffer.Write(value, 0, value.Length);
185buffer.Read(keyLengthBuffer, 0, keyLengthBuffer.Length);
189buffer.Read(serializedKeyBuffer, 0, serializedKeyBuffer.Length);
194decoded = new byte[value.Length - keyLengthBuffer.Length - serializedKeyBuffer.Length];
195buffer.Read(decoded, 0, decoded.Length);
Microsoft.AspNetCore.Mvc.Test (7)
Microsoft.AspNetCore.Mvc.Testing (6)
Microsoft.AspNetCore.Mvc.ViewFeatures (37)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (19)
Buffers\PagedCharBufferTest.cs (7)
339buffer.Append(laterChars, 0, laterChars.Length);
340buffer.Append(laterChars, 0, laterChars.Length);
369buffer.Append(laterChars, 0, laterChars.Length);
370buffer.Append(laterChars, 0, laterChars.Length);
398buffer.Append(laterChars, 0, laterChars.Length);
399buffer.Append(laterChars, 0, laterChars.Length);
418buffer.Append(arrayToAppend, 0, arrayToAppend.Length);
Microsoft.AspNetCore.OpenApi (44)
src\Shared\PropertyAsParameterInfo.cs (16)
69if (parameters.Length == 0)
77for (var i = 0; i < parameters.Length; i++)
91List<ParameterInfo> list = new(parameters.Length);
107if (constructor is not null && constructorParameters is { Length: > 0 })
144if (constructorAttributes == null || constructorAttributes is { Length: 0 })
151var mergedAttributes = new Attribute[constructorAttributes.Length + propertyAttributes.Length];
152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length);
153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
162if (constructorAttributes == null || constructorAttributes is { Length: 0 })
171var mergedAttributes = new object[constructorAttributes.Length + propertyAttributes.Length];
172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length);
173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
Microsoft.AspNetCore.OutputCaching (17)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
Microsoft.AspNetCore.OutputCaching.Tests (5)
Microsoft.AspNetCore.Owin (2)
Microsoft.AspNetCore.RateLimiting (1)
Microsoft.AspNetCore.RateLimiting.Tests (1)
Microsoft.AspNetCore.Razor (1)
Microsoft.AspNetCore.Razor.Runtime (3)
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Microsoft.AspNetCore.RequestDecompression.Tests (5)
Microsoft.AspNetCore.ResponseCaching (10)
Microsoft.AspNetCore.ResponseCaching.Tests (2)
Microsoft.AspNetCore.ResponseCompression (5)
Microsoft.AspNetCore.ResponseCompression.Tests (8)
Microsoft.AspNetCore.Rewrite (5)
Microsoft.AspNetCore.Routing (91)
Microsoft.AspNetCore.Routing.Abstractions (6)
Microsoft.AspNetCore.Routing.Microbenchmarks (35)
Microsoft.AspNetCore.Routing.Tests (43)
Microsoft.AspNetCore.Server.HttpSys (15)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (119)
Listener\RequestBodyTests.cs (13)
31Assert.Throws<InvalidOperationException>(() => context.Request.Body.Read(input, 0, input.Length));
36var read = context.Request.Body.Read(input, 0, input.Length);
59Task<int> task = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
81int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
84read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
106int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
109read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
130int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
132var readTask = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
155int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
158var readTask = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
182int read = await context.Request.Body.ReadAsync(input, 0, input.Length, context.DisconnectToken);
185var assertTask = Assert.ThrowsAsync<IOException>(async () => await context.Request.Body.ReadAsync(input, 0, input.Length, context.DisconnectToken));
Listener\ResponseBodyTests.cs (11)
72Assert.Equal(20, (await response.Content.ReadAsByteArrayAsync()).Length);
256context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
261Assert.Throws<ObjectDisposedException>(() => context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length));
292await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
297await Assert.ThrowsAsync<ObjectDisposedException>(() => context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length));
325context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
352await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
390context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
429await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
466context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
500await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
RequestBodyLimitTests.cs (24)
31int read = httpContext.Request.Body.Read(input, 0, input.Length);
54int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
75int read = httpContext.Request.Body.EndRead(httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null));
98int read = httpContext.Request.Body.Read(input, 0, input.Length);
121int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
142int read = httpContext.Request.Body.EndRead(httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null));
165var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length));
168ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length));
190var ex = Assert.Throws<BadHttpRequestException>(() => { var t = httpContext.Request.Body.ReadAsync(input, 0, input.Length); });
193ex = Assert.Throws<BadHttpRequestException>(() => { var t = httpContext.Request.Body.ReadAsync(input, 0, input.Length); });
215var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null));
218ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null));
241var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length));
244ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length));
266var ex = await Assert.ThrowsAsync<BadHttpRequestException>(() => httpContext.Request.Body.ReadAsync(input, 0, input.Length));
269ex = await Assert.ThrowsAsync<BadHttpRequestException>(() => httpContext.Request.Body.ReadAsync(input, 0, input.Length));
291var ex = Assert.Throws<BadHttpRequestException>(() => body.EndRead(body.BeginRead(input, 0, input.Length, null, null)));
294ex = Assert.Throws<BadHttpRequestException>(() => body.EndRead(body.BeginRead(input, 0, input.Length, null, null)));
318int read = httpContext.Request.Body.Read(input, 0, input.Length);
321var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length));
344int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
347var ex = await Assert.ThrowsAsync<BadHttpRequestException>(() => httpContext.Request.Body.ReadAsync(input, 0, input.Length));
370int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
394int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
RequestBodyTests.cs (17)
32int read = httpContext.Request.Body.Read(input, 0, input.Length);
54read = httpContext.Request.Body.Read(input, 0, input.Length);
73int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
93read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
110int read = httpContext.Request.Body.EndRead(httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null));
131Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, input.Length + 1, 1));
133Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 1, input.Length));
134Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 0, input.Length + 1));
152int read = httpContext.Request.Body.Read(input, 0, input.Length);
155read = httpContext.Request.Body.Read(input, 0, input.Length);
173int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
176read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
192int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
194read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
202Assert.Equal(13, lines.Length);
229int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
322await stream.WriteAsync(requestBytes, 0, requestBytes.Length);
RequestTests.cs (5)
59httpContext.Response.Body.Write(body, 0, body.Length);
123httpContext.Response.Body.Write(body, 0, body.Length);
186httpContext.Response.Body.Write(body, 0, body.Length);
230httpContext.Response.Body.Write(body, 0, body.Length);
327httpContext.Response.Body.Write(body, 0, body.Length);
ResponseSendFileTests.cs (11)
76Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length);
95Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length);
114Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length);
134Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length);
153Assert.Equal(FileLength / 2, (await response.Content.ReadAsByteArrayAsync()).Length);
231Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length);
252Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length);
301Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length);
324Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length);
346Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length);
364Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length);
Microsoft.AspNetCore.Server.IIS (17)
Core\IISHttpContext.cs (4)
420(uint)buffer.Length,
614NativeMethods.HttpResponseSetUnknownHeader(_requestNativeHandle, pHeaderName, pHeaderValue, (ushort)headerValueBytes.Length, fReplace: isFirst);
619NativeMethods.HttpResponseSetKnownHeader(_requestNativeHandle, knownHeaderIndex, pHeaderValue, (ushort)headerValueBytes.Length, fReplace: isFirst);
653NativeMethods.HttpResponseSetTrailer(_requestNativeHandle, pHeaderName, pHeaderValue, (ushort)headerValueBytes.Length, replace: isFirst);
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
Microsoft.AspNetCore.Server.Kestrel.Core (154)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
555Array.Clear(keyBytes, 0, keyBytes.Length);
556Array.Clear(pem, 0, pem.Length);
562Array.Clear(keyBytes, 0, keyBytes.Length);
563Array.Clear(pem, 0, pem.Length);
613Array.Clear(bytes, 0, bytes.Length);
641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (161)
MessageBodyTests.cs (27)
44var count = stream.Read(buffer, 0, buffer.Length);
48count = stream.Read(buffer, 0, buffer.Length);
170var count = await stream.ReadAsync(buffer, 0, buffer.Length);
174count = await stream.ReadAsync(buffer, 0, buffer.Length);
197var count = stream.Read(buffer, 0, buffer.Length);
203count = stream.Read(buffer, 0, buffer.Length);
222var task = stream.ReadAsync(buffer, 0, buffer.Length);
247var task = stream.ReadAsync(buffer, 0, buffer.Length);
280await stream.ReadAsync(buffer, 0, buffer.Length);
318var count = await stream.ReadAsync(buffer, 0, buffer.Length);
324count = await stream.ReadAsync(buffer, 0, buffer.Length);
344var readTask = stream.ReadAsync(buffer, 0, buffer.Length);
353var res = await stream.ReadAsync(buffer, 0, buffer.Length);
379await stream.ReadAsync(buffer, 0, buffer.Length));
403await stream.ReadAsync(buffer, 0, buffer.Length));
430var count = stream.Read(buffer, 0, buffer.Length);
457var count = await stream.ReadAsync(buffer, 0, buffer.Length);
485Assert.Equal(0, stream.Read(buffer, 0, buffer.Length));
507Assert.Equal(0, await stream.ReadAsync(buffer, 0, buffer.Length));
535Assert.Equal(8197, requestArray.Length);
536AssertASCII(largeInput + "Hello", new ArraySegment<byte>(requestArray, 0, requestArray.Length));
666Assert.Equal(5, await stream.ReadAsync(buffer, 0, buffer.Length));
693Assert.Equal(5, await stream.ReadAsync(buffer, 0, buffer.Length));
1404Assert.Equal(bytes.Length, actual.Count);
1405for (var index = 0; index < bytes.Length; index++)
1416Assert.Equal(bytes.Length, actual.Length);
1417for (var index = 0; index < bytes.Length; index++)
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
24} while (read != 0 && offset < buffer.Length);
41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
43} while (read != 0 && offset < buffer.Length);
45Assert.True(offset >= buffer.Length);
57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20];
37Array.Copy(data, 0, startSegment, 10, data.Length);
38return new ReadOnlySequence<byte>(startSegment, 10, data.Length);
51var startSegment = new byte[data.Length + 20];
52Array.Copy(data, 0, startSegment, 10, data.Length);
53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length));
66var startSegment = new byte[data.Length + 20];
67Array.Copy(data, 0, startSegment, 10, data.Length);
68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory);
94var segments = new List<byte[]>((data.Length * 2) + 1);
109if (inputs == null || inputs.Length == 0)
122int length = s.Length;
144} while (i < inputs.Length);
src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (15)
68private static readonly byte[] _headerName = new byte[] { (byte)_headerNameBytes.Length }
78private static readonly byte[] _headerNameHuffman = new byte[] { (byte)(0x80 | _headerNameHuffmanBytes.Length) }
82private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length }
86private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) }
162Assert.InRange(_dynamicTable.MaxSize, 1, _literalHeaderNameBytes.Length); // Assert that our string will be too big
558_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler);
559_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler);
574_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler);
575_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler);
747for (int i = 0; i < encoded.Length; i++)
749bool end = i + 1 == encoded.Length;
772for (int i = 0; i < segments.Length; i++)
774bool end = i + 1 == segments.Length;
934for (int i = 0; i < encoded.Length; i++)
936bool end = i + 1 == encoded.Length;
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (24)
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (5)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (34)
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
24} while (read != 0 && offset < buffer.Length);
41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
43} while (read != 0 && offset < buffer.Length);
45Assert.True(offset >= buffer.Length);
57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
Microsoft.AspNetCore.Session (13)
DistributedSession.cs (7)
146if (encodedKey.KeyBytes.Length > KeyLengthLimit)
157var copy = new byte[value.Length];
158Buffer.BlockCopy(src: value, srcOffset: 0, dst: copy, dstOffset: 0, count: value.Length);
326SerializeNumAs2Bytes(output, keyBytes.Length);
327output.Write(keyBytes, 0, keyBytes.Length);
328SerializeNumAs4Bytes(output, entry.Value.Length);
329output.Write(entry.Value, 0, entry.Value.Length);
Microsoft.AspNetCore.Shared.Tests (149)
runtime\Http2\HPackDecoderTest.cs (15)
68private static readonly byte[] _headerName = new byte[] { (byte)_headerNameBytes.Length }
78private static readonly byte[] _headerNameHuffman = new byte[] { (byte)(0x80 | _headerNameHuffmanBytes.Length) }
82private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length }
86private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) }
162Assert.InRange(_dynamicTable.MaxSize, 1, _literalHeaderNameBytes.Length); // Assert that our string will be too big
558_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler);
559_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler);
574_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler);
575_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler);
747for (int i = 0; i < encoded.Length; i++)
749bool end = i + 1 == encoded.Length;
772for (int i = 0; i < segments.Length; i++)
774bool end = i + 1 == segments.Length;
934for (int i = 0; i < encoded.Length; i++)
936bool end = i + 1 == encoded.Length;
SegmentWriteStreamTests.cs (12)
55Assert.Equal(WriteData.Length, stream.Length);
56Assert.Equal((WriteData.Length + segmentSize - 1) / segmentSize, segments.Count);
58for (var i = 0; i < WriteData.Length; i += segmentSize)
60var expectedSegmentSize = Math.Min(segmentSize, WriteData.Length - i);
68Assert.Equal(expectedSegmentSize, segment.Length);
82for (var i = 0; i < WriteData.Length; i += writeSize)
84stream.Write(WriteData, i, Math.Min(writeSize, WriteData.Length - i));
88Assert.Equal(WriteData.Length, stream.Length);
89Assert.Equal((WriteData.Length + segmentSize - 1) / segmentSize, segments.Count);
91for (var i = 0; i < WriteData.Length; i += segmentSize)
93var expectedSegmentSize = Math.Min(segmentSize, WriteData.Length - i);
101Assert.Equal(expectedSegmentSize, segment.Length);
Microsoft.AspNetCore.SignalR.Client.Core (15)
HubConnection.cs (12)
765var newArgsCount = args.Length;
767Span<bool> isStreaming = args.Length <= MaxStackSize
768? stackalloc bool[MaxStackSize].Slice(0, args.Length)
769: new bool[args.Length];
770for (var i = 0; i < args.Length; i++)
795if (newArgsCount == args.Length)
805for (var i = 0; i < args.Length; i++)
872Debug.Assert(genericTypes.Length == 1);
1131Log.PreparingBlockingInvocation(_logger, irq.InvocationId, methodName, irq.ResultType.FullName!, args.Length);
1162Log.PreparingStreamingInvocation(_logger, irq.InvocationId, methodName, irq.ResultType.FullName!, args.Length);
1236Log.PreparingNonBlockingInvocation(_logger, methodName, args.Length);
2417if (handlers.Length > 0)
Microsoft.AspNetCore.SignalR.Client.Tests (16)
Microsoft.AspNetCore.SignalR.Common (5)
Microsoft.AspNetCore.SignalR.Common.Tests (68)
Internal\Protocol\MemoryBufferWriterTests.cs (27)
22MinimumSegmentSize = buffer.Length;
86bufferWriter.Write(input, 0, input.Length);
105bufferWriter.Write(input, 0, input.Length);
125bufferWriter.Write(input, 0, input.Length);
146bufferWriter.Write(input, 0, input.Length);
169bufferWriter.Write(input, 0, input.Length);
170Assert.Equal(input.Length, bufferWriter.Length);
185bufferWriter.Write(input, 0, input.Length);
186Assert.Equal(input.Length, bufferWriter.Length);
203bufferWriter.Write(input, 0, input.Length);
204Assert.Equal(input.Length, bufferWriter.Length);
219bufferWriter.Write(input, 0, input.Length);
220Assert.Equal(input.Length, bufferWriter.Length);
236bufferWriter.Write(input, 0, input.Length);
237Assert.Equal(input.Length, bufferWriter.Length);
255bufferWriter.Write(input, 0, input.Length);
256Assert.Equal(input.Length, bufferWriter.Length);
273bufferWriter.Write(input, 0, input.Length);
274Assert.Equal(input.Length, bufferWriter.Length);
293bufferWriter.Write(input, 0, input.Length);
294Assert.Equal(input.Length, bufferWriter.Length);
304Array.Clear(data, 0, data.Length);
320bufferWriter.Write(input, 0, input.Length);
321Assert.Equal(input.Length, bufferWriter.Length);
340bufferWriter.Write(input, 0, input.Length);
341Assert.Equal(input.Length, bufferWriter.Length);
351Array.Clear(data, 0, data.Length);
Internal\Protocol\Utf8BufferTextReaderTests.cs (11)
23var read = reader.Read(chars, 0, chars.Length);
36var read = reader.Read(chars, 0, chars.Length);
41read = reader.Read(chars, 0, chars.Length);
54var read = reader.Read(chars, 10, chars.Length - 10);
68var read = reader.Read(chars, 0, chars.Length);
73read = reader.Read(chars, 0, chars.Length);
78read = reader.Read(chars, 0, chars.Length);
83read = reader.Read(chars, 0, chars.Length);
100var read = reader.Read(chars, 0, chars.Length);
105read = reader.Read(chars, 0, chars.Length);
110read = reader.Read(chars, 0, chars.Length);
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20];
37Array.Copy(data, 0, startSegment, 10, data.Length);
38return new ReadOnlySequence<byte>(startSegment, 10, data.Length);
51var startSegment = new byte[data.Length + 20];
52Array.Copy(data, 0, startSegment, 10, data.Length);
53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length));
66var startSegment = new byte[data.Length + 20];
67Array.Copy(data, 0, startSegment, 10, data.Length);
68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory);
94var segments = new List<byte[]>((data.Length * 2) + 1);
109if (inputs == null || inputs.Length == 0)
122int length = s.Length;
144} while (i < inputs.Length);
Microsoft.AspNetCore.SignalR.Core (22)
Microsoft.AspNetCore.SignalR.Microbenchmarks (18)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20];
37Array.Copy(data, 0, startSegment, 10, data.Length);
38return new ReadOnlySequence<byte>(startSegment, 10, data.Length);
51var startSegment = new byte[data.Length + 20];
52Array.Copy(data, 0, startSegment, 10, data.Length);
53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length));
66var startSegment = new byte[data.Length + 20];
67Array.Copy(data, 0, startSegment, 10, data.Length);
68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory);
94var segments = new List<byte[]>((data.Length * 2) + 1);
109if (inputs == null || inputs.Length == 0)
122int length = s.Length;
144} while (i < inputs.Length);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (8)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (5)
Microsoft.AspNetCore.SignalR.Specification.Tests (5)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (5)
Microsoft.AspNetCore.SignalR.Tests (18)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.StaticFiles (4)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
Microsoft.AspNetCore.StaticFiles.Tests (7)
Microsoft.AspNetCore.TestHost (4)
Microsoft.AspNetCore.TestHost.Tests (17)
ResponseBodyTests.cs (6)
29Assert.Equal(length, bytes.Length);
46Assert.Equal(length, bytes.Length);
56httpContext.Response.Body.Write(contentBytes, 0, contentBytes.Length);
72httpContext.Response.Body.Write(contentBytes, 0, contentBytes.Length);
91await httpContext.Response.Body.WriteAsync(contentBytes, 0, contentBytes.Length);
110await httpContext.Response.Body.WriteAsync(contentBytes, 0, contentBytes.Length);
Microsoft.AspNetCore.Tests (3)
Microsoft.AspNetCore.WebSockets (3)
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Microsoft.AspNetCore.WebSockets.Tests (20)
WebSocketMiddlewareTests.cs (18)
95var serverBuffer = new byte[originalData.Length];
98Assert.Equal(originalData.Length, result.Count);
120var serverBuffer = new byte[originalData.Length];
123Assert.Equal(originalData.Length, result.Count);
146var serverBuffer = new byte[originalData.Length];
177var serverBuffer = new byte[originalData.Length];
186new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None);
194new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None);
232var clientBuffer = new byte[originalData.Length];
235Assert.Equal(originalData.Length, result.Count);
257var clientBuffer = new byte[originalData.Length];
260Assert.Equal(originalData.Length, result.Count);
282var clientBuffer = new byte[originalData.Length];
287result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer, receivedCount, clientBuffer.Length - receivedCount), CancellationToken.None);
293Assert.Equal(originalData.Length, receivedCount);
317var clientBuffer = new byte[originalData.Length];
325new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None);
332new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None);
Microsoft.AspNetCore.WebUtilities (24)
BufferedReadStream.cs (7)
253_bufferCount = _inner.Read(_buffer, 0, _buffer.Length);
281if (minCount > _buffer.Length)
283throw new ArgumentOutOfRangeException(nameof(minCount), minCount, "The value must be smaller than the buffer size: " + _buffer.Length);
296int read = _inner.Read(_buffer, _bufferOffset + _bufferCount, _buffer.Length - _bufferCount - _bufferOffset);
314if (minCount > _buffer.Length)
316throw new ArgumentOutOfRangeException(nameof(minCount), minCount, "The value must be smaller than the buffer size: " + _buffer.Length);
329int read = await _inner.ReadAsync(_buffer.AsMemory(_bufferOffset + _bufferCount, _buffer.Length - _bufferCount - _bufferOffset), cancellationToken);
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (14)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20];
37Array.Copy(data, 0, startSegment, 10, data.Length);
38return new ReadOnlySequence<byte>(startSegment, 10, data.Length);
51var startSegment = new byte[data.Length + 20];
52Array.Copy(data, 0, startSegment, 10, data.Length);
53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length));
66var startSegment = new byte[data.Length + 20];
67Array.Copy(data, 0, startSegment, 10, data.Length);
68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory);
94var segments = new List<byte[]>((data.Length * 2) + 1);
109if (inputs == null || inputs.Length == 0)
122int length = s.Length;
144} while (i < inputs.Length);
Microsoft.AspNetCore.WebUtilities.Tests (129)
FileBufferingReadStreamTests.cs (57)
54var read1 = stream.Read(bytes, 0, bytes.Length);
55Assert.Equal(bytes.Length, read1);
61var read2 = stream.Read(bytes, 0, bytes.Length);
68var read3 = stream.Read(bytes, 0, bytes.Length);
80var read0 = stream.Read(bytes, 0, bytes.Length);
81Assert.Equal(bytes.Length, read0);
87var read1 = stream.Read(bytes, 0, bytes.Length);
88Assert.Equal(bytes.Length, read1);
94var read2 = stream.Read(bytes, 0, bytes.Length);
101var read3 = stream.Read(bytes, 0, bytes.Length);
114var read0 = stream.Read(bytes, 0, bytes.Length);
115Assert.Equal(bytes.Length, read0);
121var read1 = stream.Read(bytes, 0, bytes.Length);
122Assert.Equal(bytes.Length, read1);
130var read2 = stream.Read(bytes, 0, bytes.Length);
138var read3 = stream.Read(bytes, 0, bytes.Length);
152var read0 = stream.Read(bytes, 0, bytes.Length);
153Assert.Equal(bytes.Length, read0);
159var exception = Assert.Throws<IOException>(() => stream.Read(bytes, 0, bytes.Length));
175var read0 = stream.Read(bytes, 0, bytes.Length);
176Assert.Equal(bytes.Length, read0);
182var read1 = stream.Read(bytes, 0, bytes.Length);
183Assert.Equal(bytes.Length, read1);
191var exception = Assert.Throws<IOException>(() => stream.Read(bytes, 0, bytes.Length));
216var read1 = await stream.ReadAsync(bytes, 0, bytes.Length);
217Assert.Equal(bytes.Length, read1);
223var read2 = await stream.ReadAsync(bytes, 0, bytes.Length);
230var read3 = await stream.ReadAsync(bytes, 0, bytes.Length);
242var read0 = await stream.ReadAsync(bytes, 0, bytes.Length);
243Assert.Equal(bytes.Length, read0);
249var read1 = await stream.ReadAsync(bytes, 0, bytes.Length);
250Assert.Equal(bytes.Length, read1);
256var read2 = await stream.ReadAsync(bytes, 0, bytes.Length);
263var read3 = await stream.ReadAsync(bytes, 0, bytes.Length);
276var read0 = await stream.ReadAsync(bytes, 0, bytes.Length);
277Assert.Equal(bytes.Length, read0);
283var read1 = await stream.ReadAsync(bytes, 0, bytes.Length);
284Assert.Equal(bytes.Length, read1);
292var read2 = await stream.ReadAsync(bytes, 0, bytes.Length);
300var read3 = await stream.ReadAsync(bytes, 0, bytes.Length);
328var read1 = await stream.ReadAsync(bytes, 0, bytes.Length);
329Assert.Equal(bytes.Length, read1);
332var read2 = await stream.ReadAsync(bytes, 0, bytes.Length);
333Assert.Equal(bytes.Length, read2);
336var read3 = await stream.ReadAsync(bytes, 0, bytes.Length);
341var read4 = await stream.ReadAsync(bytes, 0, bytes.Length);
355var read0 = await stream.ReadAsync(bytes, 0, bytes.Length);
356Assert.Equal(bytes.Length, read0);
362var exception = await Assert.ThrowsAsync<IOException>(() => stream.ReadAsync(bytes, 0, bytes.Length));
378var read0 = await stream.ReadAsync(bytes, 0, bytes.Length);
379Assert.Equal(bytes.Length, read0);
385var read1 = await stream.ReadAsync(bytes, 0, bytes.Length);
386Assert.Equal(bytes.Length, read1);
394var exception = await Assert.ThrowsAsync<IOException>(() => stream.ReadAsync(bytes, 0, bytes.Length));
612var read0 = stream.Read(bytes, 0, bytes.Length);
613Assert.Equal(bytes.Length, read0);
619var read1 = stream.Read(bytes, 0, bytes.Length);
FileBufferingWriteStreamTests.cs (19)
27bufferingStream.Write(input, 0, input.Length);
30Assert.Equal(input.Length, bufferingStream.Length);
54Assert.Equal(input.Length, bufferingStream.Length);
96bufferingStream.Write(input, 0, input.Length);
142await bufferingStream.WriteAsync(input, 0, input.Length);
207await bufferingStream.WriteAsync(input, 0, input.Length);
241Assert.Equal(input.Length, bufferingStream.Length);
255var exception = Assert.Throws<IOException>(() => bufferingStream.Write(input, 0, input.Length));
269bufferingStream.Write(input, 0, input.Length);
270var exception = Assert.Throws<IOException>(() => bufferingStream.Write(input, 0, input.Length));
285bufferingStream.Write(input, 0, input.Length);
286bufferingStream.Write(input, 0, input.Length); // Should get to exactly the buffer limit, which is fine
299var exception = await Assert.ThrowsAsync<IOException>(() => bufferingStream.WriteAsync(input, 0, input.Length));
313await bufferingStream.WriteAsync(input, 0, input.Length);
314var exception = await Assert.ThrowsAsync<IOException>(() => bufferingStream.WriteAsync(input, 0, input.Length));
329await bufferingStream.WriteAsync(input, 0, input.Length);
330await bufferingStream.WriteAsync(input, 0, input.Length); // Should get to exactly the buffer limit, which is fine
341bufferingStream.Write(input, 0, input.Length);
358bufferingStream.Write(input, 0, input.Length);
MultipartReaderTests.cs (6)
293var read = section.Body.Read(buffer, 0, buffer.Length);
302read = section.Body.Read(buffer, 0, buffer.Length);
326stream.Write(bytes, 0, bytes.Length);
332stream.Write(bytes, 0, bytes.Length);
361stream.Write(bytes, 0, bytes.Length);
367stream.Write(bytes, 0, bytes.Length);
PagedByteBufferTest.cs (14)
20buffer.Add(input, 0, input.Length);
24Assert.Equal(input.Length, buffer.Length);
35buffer.Add(input1, 0, input1.Length);
38buffer.Add(input2, 0, input2.Length);
69buffer.Add(input1, 0, input1.Length);
88buffer.Add(input, 0, input.Length);
102buffer.Add(input, 0, input.Length);
113buffer.Add(newInput, 0, newInput.Length);
127buffer.Add(input, 0, input.Length);
138buffer.Add(newInput, 0, newInput.Length);
151buffer.Add(input, 0, input.Length);
181buffer.Add(input, 0, input.Length);
206buffer.Add(input, 0, input.Length);
229buffer.Add(input, 0, input.Length);
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20];
37Array.Copy(data, 0, startSegment, 10, data.Length);
38return new ReadOnlySequence<byte>(startSegment, 10, data.Length);
51var startSegment = new byte[data.Length + 20];
52Array.Copy(data, 0, startSegment, 10, data.Length);
53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length));
66var startSegment = new byte[data.Length + 20];
67Array.Copy(data, 0, startSegment, 10, data.Length);
68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory);
94var segments = new List<byte[]>((data.Length * 2) + 1);
109if (inputs == null || inputs.Length == 0)
122int length = s.Length;
144} while (i < inputs.Length);
Microsoft.Build (301)
BackEnd\Client\MSBuildClientPacketPump.cs (4)
196IAsyncResult result = localStream.BeginRead(headerByte, 0, headerByte.Length, null, null);
236if ((headerBytesRead != headerByte.Length) && !localPacketPumpShutdownEvent.WaitOne(0))
251ErrorUtilities.ThrowInternalError("Incomplete header read. {0} of {1} bytes read", headerBytesRead, headerByte.Length);
295result = localStream.BeginRead(headerByte, 0, headerByte.Length, null, null);
BackEnd\Components\RequestBuilder\TaskHost.cs (26)
291ErrorUtilities.VerifyThrowArgument((targetOutputsPerProject == null) || (projectFileNames.Length == targetOutputsPerProject.Length), "General.TwoVectorsMustHaveSameLength", projectFileNames.Length, targetOutputsPerProject?.Length ?? 0, "projectFileNames", "targetOutputsPerProject");
293BuildEngineResult result = BuildProjectFilesInParallel(projectFileNames, targetNames, globalProperties, new List<String>[projectFileNames.Length], toolsVersion, includeTargetOutputs);
299ErrorUtilities.VerifyThrow(targetOutputsPerProject.Length == result.TargetOutputsPerProject.Count, "{0} != {1}", targetOutputsPerProject.Length, result.TargetOutputsPerProject.Count);
301for (int i = 0; i < targetOutputsPerProject.Length; i++)
973if (projectFileNames.Length == 1 && projectFileNames[0] == null && globalProperties[0] == null && (undefineProperties == null || undefineProperties[0] == null) && toolsVersion[0] == null)
987for (int i = 0; i < targetNames.Length; i++)
1153if (projectFileNames.Length == 1 && projectFileNames[0] == null && globalProperties[0] == null && (undefineProperties == null || undefineProperties[0] == null) && toolsVersion[0] == null)
1166for (int i = 0; i < targetNames.Length; i++)
1178PropertyDictionary<ProjectPropertyInstance>[] propertyDictionaries = new PropertyDictionary<ProjectPropertyInstance>[projectFileNames.Length];
1180for (int i = 0; i < projectFileNames.Length; i++)
1214ErrorUtilities.VerifyThrow(results.Length == projectFileNames.Length, "{0}!={1}.", results.Length, projectFileNames.Length);
1218targetOutputsPerProject = new List<IDictionary<string, ITaskItem[]>>(results.Length);
1222for (int i = 0; i < results.Length; i++)
1233ITaskItem[] clonedTaskItem = new ITaskItem[resultEntry.Value.Items.Length];
1234for (int j = 0; j < resultEntry.Value.Items.Length; j++)
1259ErrorUtilities.VerifyThrow(results.Length == projectFileNames.Length || !overallSuccess, "The number of results returned {0} cannot be less than the number of project files {1} unless one of the results indicated failure.", results.Length, projectFileNames.Length);
Evaluation\Expander.cs (79)
2346ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2394ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2441ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2465ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2541ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2608ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2680ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2699ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2708ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2791ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2808ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2842ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2875ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
2908ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length);
3488args = new object[_arguments.Length];
3491for (int n = 0; n < _arguments.Length; n++)
3525if (objectInstance != null && args.Length == 1 && (String.Equals("Equals", _methodMethodName, StringComparison.OrdinalIgnoreCase) || String.Equals("CompareTo", _methodMethodName, StringComparison.OrdinalIgnoreCase)))
3544if (_methodMethodName.Equals("GetPathOfFileAbove") && args.Length == 1)
3602IEnumerable<MethodInfo> methods = _receiverType.GetMethods(_bindingFlags).Where(m => m.Name.Equals(_methodMethodName) && m.GetParameters().Length == args.Length);
3707for (int i = index; i < args.Length; i++)
3726ErrorUtilities.ThrowArgument("CouldNotDifferentiateBetweenCompatibleMethods", _methodMethodName, args.Length);
3791if (args.Length == 0)
3799if (args.Length == 0)
3815if (args.Length == 0)
3865if (args.Length == 0)
4046if (args.Length >= 4 &&
4049returnVal = IntrinsicFunctions.GetRegistryValueFromView(arg0, arg1, args[2], new ArraySegment<object>(args, 3, args.Length - 3));
4055if (args.Length == 0)
4122if (args.Length == 0)
4130if (args.Length == 0)
4138if (args.Length == 0)
4146if (args.Length == 0)
4154if (args.Length == 0)
4162if (args.Length == 0)
4170if (args.Length == 0)
4410switch (args.Length)
4453if (args.Length == 0)
4477if (args.Length == 0)
4523if (args.Length == 0)
4530else if (string.Equals(_methodMethodName, nameof(Regex.Replace), StringComparison.OrdinalIgnoreCase) && args.Length == 3)
4576if (args.Length == 0)
4592for (var i = 0; i < args.Length; i++)
4608if (enforceLength && args.Length != 2)
4631if (args.Length != 3)
4657if (args.Length != 4)
4683if (args.Length != 2)
4706if (args.Length != 3)
4728if (args.Length != 1)
4739if (args.Length != 1)
4856if (args.Length != 1)
4868if (args.Length != 2)
4898if (args.Length != 1)
4911if (args.Length != 2)
4925if (args.Length != 2)
4939if (args.Length != 2)
4964if (args.Length != 2)
4990if (args.Length != 2)
5353object[] coercedArguments = new object[args.Length];
5358for (int n = 0; n < parameters.Length; n++)
5523Type[] types = new Type[_arguments.Length];
5524for (int n = 0; n < _arguments.Length; n++)
5569if (parameters.Length == _arguments.Length)
5646return parameters.Length > 0
NodeEndpointOutOfProcBase.cs (5)
398for (int i = 0; i < handshakeComponents.Length; i++)
524IAsyncResult result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null);
568if (bytesRead != headerByte.Length)
588CommunicationsUtilities.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length);
613result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null);
Microsoft.Build.CommandLine.UnitTests (11)
Microsoft.Build.Engine.OM.UnitTests (19)
Microsoft.Build.Engine.UnitTests (110)
Microsoft.Build.Framework (53)
Microsoft.Build.Framework.UnitTests (2)
Microsoft.Build.Tasks.CodeAnalysis (16)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (7)
Microsoft.Build.Tasks.Core (223)
AssemblyDependency\ResolveAssemblyReference.cs (29)
1314var buffer = new StringBuilder(a.Length * 2);
1315for (int i = 0; i < a.Length; ++i)
2055if (_cache == null && AssemblyInformationCachePaths != null && AssemblyInformationCachePaths.Length > 0)
2194for (int i = 0; i < _targetFrameworkDirectories.Length; i++)
2207if (installedAssemblyTableInfo?.Length > 0)
2218bool targetingProfile = !String.IsNullOrEmpty(ProfileName) && ((FullFrameworkFolders.Length > 0) || (FullFrameworkAssemblyTables.Length > 0));
2232if (inclusionListSubsetTableInfo.Length > 0 && (redistList?.Count > 0))
2286for (int i = 0; i < redistList.Errors.Length; ++i)
2648MSBuildEventSource.Log.RarOverallStop(_assemblyNames?.Length ?? -1, _assemblyFiles?.Length ?? -1, _resolvedFiles?.Length ?? -1, _resolvedDependencyFiles?.Length ?? -1, _copyLocalFiles?.Length ?? -1, _findDependencies);
2665MSBuildEventSource.Log.RarOverallStop(_assemblyNames?.Length ?? -1, _assemblyFiles?.Length ?? -1, _resolvedFiles?.Length ?? -1, _resolvedDependencyFiles?.Length ?? -1, _copyLocalFiles?.Length ?? -1, _findDependencies);
2771if (fullRedistAssemblyTableInfo.Length > 0)
2802for (int i = 0; i < fullFrameworkRedistList.Errors.Length; ++i)
2855bool targetFrameworkSubsetIsSet = TargetFrameworkSubsets.Length != 0 || InstalledAssemblySubsetTables.Length != 0;
2859bool fullFrameworkFoldersIsSet = FullFrameworkFolders.Length > 0;
2860bool fullFrameworkTableLocationsIsSet = FullFrameworkAssemblyTables.Length > 0;
2958if (IgnoreDefaultInstalledAssemblySubsetTables && _installedAssemblySubsetTables.Length == 0)
2965if (_targetFrameworkSubsets.Length == 0 && _installedAssemblySubsetTables.Length == 0)
3048if (TargetFrameworkDirectories?.Length == 1)
BootstrapperUtil\ResourceUpdater.cs (6)
75if (!NativeMethods.UpdateResourceW(hUpdate, (IntPtr)resource.Type, resource.Name, 0, data, data.Length))
87if (!NativeMethods.UpdateResourceW(hUpdate, (IntPtr)42, "COUNT", 0, countArray, countArray.Length))
119if (!NativeMethods.UpdateResourceW(hUpdate, (IntPtr)42, keyName, 0, data, data.Length))
147byte[] data = new byte[strBytes.Length + 2];
149data[data.Length - 2] = 0;
150data[data.Length - 1] = 0;
Microsoft.Build.Tasks.UnitTests (128)
GetSDKReference_Tests.cs (27)
432Assert.Equal(9, t.CopyLocalFiles.Length);
433Assert.Equal(8, t.References.Length);
508Assert.Equal(8, t.References.Length);
519Assert.Equal(8, t.References.Length);
557Assert.Equal(8, t.References.Length);
650Assert.Equal(2, allCacheFiles.Length);
675Assert.Equal(8, t.References.Length);
724Assert.Equal(5, t.References.Length);
816Assert.Equal(8, t.References.Length);
868Assert.Equal(8, t.References.Length);
919Assert.Equal(8, t.References.Length);
956Assert.Equal(8, t.References.Length);
957Assert.Equal(5, t.RedistFiles.Length);
1018Assert.Equal(5, t.RedistFiles.Length);
1049Assert.Equal(5, t.RedistFiles.Length);
1081Assert.Equal(5, t.RedistFiles.Length);
1112Assert.Equal(8, t.References.Length);
1141Assert.Equal(8, t.References.Length);
1169Assert.Equal(5, t.RedistFiles.Length);
1197Assert.Equal(5, t.RedistFiles.Length);
1234Assert.Equal(8, t.References.Length);
1235Assert.Equal(6, t.RedistFiles.Length);
1280Assert.Equal(8, t.References.Length);
1281Assert.Equal(6, t.RedistFiles.Length);
1323Assert.Equal(8, t.References.Length);
1324Assert.Equal(6, t.RedistFiles.Length);
1368Assert.Equal(7, t.RedistFiles.Length);
Microsoft.Build.UnitTests.Shared (37)
Microsoft.Build.Utilities.Core (76)
ToolLocationHelper.cs (10)
1051if (winmdPaths.Length > 0)
1053ErrorUtilities.DebugTraceMessage("GetLegacyTargetPlatformReferences", "Found {0} contract winmds in '{1}'", winmdPaths.Length, winmdLocation);
1138if (winmdPaths.Length > 0)
1140ErrorUtilities.DebugTraceMessage("GetApiContractReferences", "Found {0} contract winmds in '{1}'", winmdPaths.Length, contractPath);
2524ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Found '{0}' sdkName directories under '{1}'", sdkNameDirectories.Length, extensionSdksDirectory.FullName);
2530ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Found '{0}' sdkVersion directories under '{1}'", sdkVersionDirectories.Length, sdkNameFolders.FullName);
2946if (diskRoots?.Length > 0)
2971if (sdkDiskRoots.Count == 0 && diskRoots?.Length > 0)
3028ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", "Found '{0}' platform identifier directories under '{1}'", platformIdentifiers.Length, platformsRoot);
3034ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", "Found '{0}' platform version directories under '{1}'", platformVersions.Length, platformIdentifier.FullName);
Microsoft.Build.Utilities.UnitTests (10)
Microsoft.Cci.Extensions (10)
Microsoft.CodeAnalysis (338)
DiaSymReader\Writer\SymUnmanagedWriterImpl.cs (15)
224if (count < 0 || count > startLines.Length || count > startColumns.Length || count > endLines.Length || count > endColumns.Length)
387encodedLength = bytes.Length;
388value = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
547if (metadata.Length == 0)
552if (metadata.Length > CustomMetadataByteLimit)
557metadata.Length,
568symWriter.SetSymAttribute(0, "MD2", metadata.Length, pb);
612if (data.Length == 0)
623symWriter.SetSourceServerData(dataPtr, data.Length);
639if (data.Length == 0)
650symWriter.SetSourceLinkData(dataPtr, data.Length);
761Buffer.BlockCopy(data, 4, guidBytes, 0, guidBytes.Length);
InternalUtilities\ArrayExtensions.cs (26)
17Debug.Assert(start <= array.Length);
19if (start + length > array.Length)
21length = array.Length - start;
31T[] newArray = new T[array.Length + 1];
37if (position < array.Length)
39Array.Copy(array, position, newArray, position + 1, array.Length - position);
48return InsertAt(array, array.Length, item);
53T[] newArray = new T[array.Length + items.Length];
59if (position < array.Length)
61Array.Copy(array, position, newArray, position + items.Length, array.Length - position);
70return InsertAt(array, array.Length, items);
80if (position + length > array.Length)
82length = array.Length - position;
85T[] newArray = new T[array.Length - length];
91if (position < newArray.Length)
93Array.Copy(array, position + length, newArray, position, newArray.Length - position);
101T[] newArray = new T[array.Length];
102Array.Copy(array, newArray, array.Length);
114ReverseContents(array, 0, array.Length);
132var high = array.Length - 1;
165if (first == null || second == null || first.Length != second.Length)
170for (var i = 0; i < first.Length; i++)
191int high = array.Length - 1;
Microsoft.CodeAnalysis.CodeStyle (149)
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (26)
17Debug.Assert(start <= array.Length);
19if (start + length > array.Length)
21length = array.Length - start;
31T[] newArray = new T[array.Length + 1];
37if (position < array.Length)
39Array.Copy(array, position, newArray, position + 1, array.Length - position);
48return InsertAt(array, array.Length, item);
53T[] newArray = new T[array.Length + items.Length];
59if (position < array.Length)
61Array.Copy(array, position, newArray, position + items.Length, array.Length - position);
70return InsertAt(array, array.Length, items);
80if (position + length > array.Length)
82length = array.Length - position;
85T[] newArray = new T[array.Length - length];
91if (position < newArray.Length)
93Array.Copy(array, position + length, newArray, position, newArray.Length - position);
101T[] newArray = new T[array.Length];
102Array.Copy(array, newArray, array.Length);
114ReverseContents(array, 0, array.Length);
132var high = array.Length - 1;
165if (first == null || second == null || first.Length != second.Length)
170for (var i = 0; i < first.Length; i++)
191int high = array.Length - 1;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
118where nameSplit.Length == 3
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (6)
23=> CreateReadableStream(bytes, bytes.Length);
81for (long c = 0; c < chunks.Length; c++)
218Read(this.chunks, 0, this.length, array, 0, array.Length);
232var copyCount = Math.Min(chunk.Length, count);
315Array.Clear(chunk, 0, chunk.Length);
338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset);
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
Microsoft.CodeAnalysis.Collections.Package (34)
Microsoft.CodeAnalysis.CSharp (102)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (9)
CommandLineTests.cs (9)
720Assert.Equal(4, resolvedSourceFiles.Length);
725Assert.Equal(4, resolvedSourceFiles.Length);
8740stream.Write(buffer, 0, buffer.Length);
8747stream.Write(buffer, 0, buffer.Length);
8781stream.Read(buffer, 0, buffer.Length);
8783for (int i = 0; i < buffer.Length; i++)
9360for (int i = 0; i < compileDiagnostics.Length; i++)
14380Assert.Equal(2, touchedFiles.Length);
14383Assert.Equal(2, writtenText.Length);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (14)
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (37)
Emit\CompilationEmitTests.cs (19)
220Assert.True(mdOnlyImage.Length > 0, "no metadata emitted");
243Assert.True(output.ToArray().Length > 0, "no metadata emitted");
278Assert.True(mdOnlyImage.Length > 0, "no metadata emitted");
324Assert.True(mdOnlyImage.Length > 0, "no metadata emitted");
377Assert.True(mdOnlyImage.Length > 0, "no metadata emitted");
431Assert.True(mdOnlyImage.Length > 0, "no metadata emitted");
484Assert.True(mdOnlyImage.Length > 0, "no metadata emitted");
533Assert.True(mdOnlyImage.Length > 0, "no metadata emitted");
2714Assert.True(dllImage.Length > 0, "no metadata emitted");
3883for (int i = 0; i < System.Math.Max(expectedGlobalMembers.Length, actualGlobalMembers.Length); i++)
3905for (int i = 0; i < System.Math.Max(expectedAMembers.Length, actualAMembers.Length); i++)
3913for (int i = 0; i < System.Math.Max(expectedBMembers.Length, actualBMembers.Length); i++)
5102for (int i = 0; i < pattern.Length; i++)
5116int end = buffer.Length - pattern.Length;
5145Assert.Equal(bytes.Length, stream.Read(bytes, 0, bytes.Length));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (9)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2222)
Attributes\AttributeTests_Synthesized.cs (13)
670Assert.Equal(15, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute.
691Assert.Equal(2, equals.Length);
699Assert.Equal(2, ctor.Length);
740Assert.Equal(11, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute.
758Assert.Equal(2, equals.Length);
803Assert.Equal(17, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute.
833Assert.Equal(2, equals.Length);
841Assert.Equal(2, ctor.Length);
876Assert.Equal(14, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute.
882Assert.Equal(2, ctor.Length);
910Assert.Equal(2, equals.Length);
943Assert.Equal(7, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute.
961Assert.Equal(2, equals.Length);
Diagnostics\DiagnosticAnalyzerTests.cs (21)
324Assert.Equal(diags.Length, effectiveDiags.Length);
340Assert.Equal(0, effectiveDiags.Length);
352Assert.Equal(diags.Length, effectiveDiags.Length);
402Assert.Equal(4, effectiveDiags.Length);
407Assert.Equal(4, effectiveDiags.Length);
413Assert.Equal(4, effectiveDiags.Length);
420Assert.Equal(4, effectiveDiags.Length);
427Assert.Equal(4, effectiveDiags.Length);
434Assert.Equal(2, effectiveDiags.Length);
454Assert.Equal(1, effectiveDiags.Length);
465Assert.Equal(1, effectiveDiags.Length);
1492for (var i = 0; i < autoGeneratedPrefixes.Length; i++)
2766for (int i = 0; i < expectedFlowGraphs.Length; i++)
2992var analyzers = new DiagnosticAnalyzer[symbolKinds.Length];
2993for (int i = 0; i < symbolKinds.Length; i++)
3086var analyzers = new DiagnosticAnalyzer[symbolKinds.Length];
3087for (int i = 0; i < symbolKinds.Length; i++)
3146var analyzers = new DiagnosticAnalyzer[symbolKinds.Length];
3147for (int i = 0; i < symbolKinds.Length; i++)
Semantics\OutVarTests.cs (1074)
827Assert.Equal(count, nameRef.Length);
1888Assert.Equal(1, x1Decl.Length);
1889Assert.Equal(1, x1Ref.Length);
2017Assert.Equal(2, x5Decl.Length);
2023Assert.Equal(2, x6Decl.Length);
2024Assert.Equal(2, x6Ref.Length);
2030Assert.Equal(3, x7Ref.Length);
2127Assert.Equal(2, x5Decl.Length);
2133Assert.Equal(2, x6Decl.Length);
2134Assert.Equal(2, x6Ref.Length);
2140Assert.Equal(3, x7Ref.Length);
2238Assert.Equal(2, x5Decl.Length);
2244Assert.Equal(2, x6Decl.Length);
2245Assert.Equal(2, x6Ref.Length);
2251Assert.Equal(3, x7Ref.Length);
2348Assert.Equal(2, x5Decl.Length);
2354Assert.Equal(2, x6Decl.Length);
2355Assert.Equal(2, x6Ref.Length);
2361Assert.Equal(3, x7Ref.Length);
2642Assert.Equal(2, x1Ref.Length);
2647Assert.Equal(3, x4Ref.Length);
2653Assert.Equal(2, x6Ref.Length);
2658Assert.Equal(2, x7Ref.Length);
2664Assert.Equal(3, x8Ref.Length);
2670Assert.Equal(2, x9Decl.Length);
2671Assert.Equal(4, x9Ref.Length);
2676Assert.Equal(2, y10Ref.Length);
2682Assert.Equal(2, x14Decl.Length);
2683Assert.Equal(2, x14Ref.Length);
2689Assert.Equal(2, x15Ref.Length);
2859Assert.Equal(2, x1Ref.Length);
2864Assert.Equal(3, x4Ref.Length);
2870Assert.Equal(2, x6Ref.Length);
2875Assert.Equal(2, x7Ref.Length);
2881Assert.Equal(3, x8Ref.Length);
2887Assert.Equal(2, x9Decl.Length);
2888Assert.Equal(4, x9Ref.Length);
2893Assert.Equal(2, y10Ref.Length);
2899Assert.Equal(2, x14Decl.Length);
2900Assert.Equal(2, x14Ref.Length);
2906Assert.Equal(2, x15Ref.Length);
2954Assert.Equal(2, x1Ref.Length);
3214Assert.Equal(2, x5Decl.Length);
3220Assert.Equal(2, x6Decl.Length);
3221Assert.Equal(2, x6Ref.Length);
3227Assert.Equal(3, x7Ref.Length);
3316Assert.Equal(2, x5Decl.Length);
3322Assert.Equal(2, x6Decl.Length);
3323Assert.Equal(2, x6Ref.Length);
3329Assert.Equal(3, x7Ref.Length);
3380Assert.Equal(2, x1Ref.Length);
3432Assert.Equal(2, x1Ref.Length);
3656Assert.Equal(2, x5Decl.Length);
3869Assert.Equal(2, x1Ref.Length);
3874Assert.Equal(2, x2Ref.Length);
3879Assert.Equal(3, x4Ref.Length);
3885Assert.Equal(2, x6Ref.Length);
3890Assert.Equal(2, x7Ref.Length);
3896Assert.Equal(3, x8Ref.Length);
3902Assert.Equal(2, x9Decl.Length);
3903Assert.Equal(4, x9Ref.Length);
3908Assert.Equal(2, y10Ref.Length);
3917Assert.Equal(2, x14Decl.Length);
3918Assert.Equal(2, x14Ref.Length);
4011Assert.Equal(1, x1Ref.Length);
4057Assert.Equal(1, x1Decl.Length);
4058Assert.Equal(1, x1Ref.Length);
4101Assert.Equal(1, x1Ref.Length);
4152Assert.Equal(2, x1Decl.Length);
4153Assert.Equal(2, x1Ref.Length);
4212Assert.Equal(1, x1Decl.Length);
4213Assert.Equal(2, x1Ref.Length);
4286Assert.Equal(2, x5Decl.Length);
4292Assert.Equal(2, x6Decl.Length);
4293Assert.Equal(2, x6Ref.Length);
4299Assert.Equal(3, x7Ref.Length);
4512Assert.Equal(2, x5Decl.Length);
4518Assert.Equal(2, x6Decl.Length);
4519Assert.Equal(2, x6Ref.Length);
4525Assert.Equal(3, x7Ref.Length);
4532Assert.Equal(2, x11Ref.Length);
4538Assert.Equal(2, x12Ref.Length);
4688Assert.Equal(2, x5Decl.Length);
4694Assert.Equal(2, x6Decl.Length);
4695Assert.Equal(2, x6Ref.Length);
4701Assert.Equal(3, x7Ref.Length);
4921Assert.Equal(3, x1Decl.Length);
4922Assert.Equal(3, x1Ref.Length);
4937Assert.Equal(2, x4Ref.Length);
4944Assert.Equal(2, x5Ref.Length);
4949Assert.Equal(2, x8Decl.Length);
4950Assert.Equal(2, x8Ref.Length);
4951for (int i = 0; i < x8Decl.Length; i++)
4967Assert.Equal(2, x11Ref.Length);
4972Assert.Equal(2, x12Ref.Length);
5023Assert.Equal(2, x1Decl.Length);
5024Assert.Equal(2, x1Ref.Length);
5070Assert.Equal(1, x1Decl.Length);
5071Assert.Equal(1, x1Ref.Length);
5117Assert.Equal(1, x1Ref.Length);
5193Assert.Equal(2, x5Decl.Length);
5199Assert.Equal(2, x6Decl.Length);
5200Assert.Equal(2, x6Ref.Length);
5206Assert.Equal(3, x7Ref.Length);
5296Assert.Equal(2, x5Decl.Length);
5302Assert.Equal(2, x6Decl.Length);
5303Assert.Equal(2, x6Ref.Length);
5309Assert.Equal(2, x7Ref.Length);
5423Assert.Equal(2, x5Decl.Length);
5429Assert.Equal(2, x6Decl.Length);
5430Assert.Equal(2, x6Ref.Length);
5436Assert.Equal(3, x7Ref.Length);
5525Assert.Equal(4, x5Ref.Length);
5753Assert.Equal(2, x1Ref.Length);
5914Assert.Equal(2, x1Ref.Length);
5919Assert.Equal(2, x2Ref.Length);
5924Assert.Equal(3, x4Ref.Length);
5930Assert.Equal(2, x6Ref.Length);
5935Assert.Equal(2, x7Ref.Length);
5941Assert.Equal(3, x8Ref.Length);
5947Assert.Equal(2, x9Decl.Length);
5948Assert.Equal(4, x9Ref.Length);
5953Assert.Equal(2, y10Ref.Length);
5962Assert.Equal(2, x14Decl.Length);
5963Assert.Equal(2, x14Ref.Length);
6055Assert.Equal(2, x1Ref.Length);
6062Assert.Equal(2, x2Ref.Length);
6067Assert.Equal(2, x3Ref.Length);
6074Assert.Equal(2, x4Decl.Length);
6075Assert.Equal(3, x4Ref.Length);
6332Assert.Equal(2, x1Ref.Length);
6337Assert.Equal(2, x2Ref.Length);
6342Assert.Equal(3, x4Ref.Length);
6348Assert.Equal(2, x6Ref.Length);
6353Assert.Equal(2, x7Ref.Length);
6359Assert.Equal(3, x8Ref.Length);
6365Assert.Equal(2, x9Decl.Length);
6366Assert.Equal(4, x9Ref.Length);
6371Assert.Equal(2, y10Ref.Length);
6380Assert.Equal(2, x14Decl.Length);
6381Assert.Equal(2, x14Ref.Length);
6567Assert.Equal(2, x1Ref.Length);
6572Assert.Equal(2, x2Ref.Length);
6577Assert.Equal(3, x4Ref.Length);
6583Assert.Equal(2, x6Ref.Length);
6588Assert.Equal(2, x7Ref.Length);
6594Assert.Equal(3, x8Ref.Length);
6600Assert.Equal(2, x9Decl.Length);
6601Assert.Equal(4, x9Ref.Length);
6606Assert.Equal(2, y10Ref.Length);
6615Assert.Equal(2, x14Decl.Length);
6616Assert.Equal(2, x14Ref.Length);
6823Assert.Equal(2, x1Ref.Length);
6829Assert.Equal(2, x2Ref.Length);
6835Assert.Equal(3, x4Ref.Length);
6842Assert.Equal(2, x6Ref.Length);
6848Assert.Equal(2, x7Ref.Length);
6854Assert.Equal(3, x8Ref.Length);
6861Assert.Equal(2, x9Decl.Length);
6862Assert.Equal(4, x9Ref.Length);
6869Assert.Equal(2, y10Ref.Length);
6878Assert.Equal(2, x14Decl.Length);
6879Assert.Equal(2, x14Ref.Length);
7069Assert.Equal(2, x1Ref.Length);
7074Assert.Equal(2, x2Ref.Length);
7079Assert.Equal(3, x4Ref.Length);
7085Assert.Equal(2, x6Ref.Length);
7090Assert.Equal(2, x7Ref.Length);
7096Assert.Equal(3, x8Ref.Length);
7102Assert.Equal(2, x9Decl.Length);
7103Assert.Equal(4, x9Ref.Length);
7108Assert.Equal(2, y10Ref.Length);
7117Assert.Equal(2, x14Decl.Length);
7118Assert.Equal(2, x14Ref.Length);
7307Assert.Equal(2, x1Ref.Length);
7312Assert.Equal(2, x2Ref.Length);
7317Assert.Equal(3, x4Ref.Length);
7323Assert.Equal(2, x6Ref.Length);
7328Assert.Equal(2, x7Ref.Length);
7334Assert.Equal(3, x8Ref.Length);
7340Assert.Equal(2, x9Decl.Length);
7341Assert.Equal(4, x9Ref.Length);
7346Assert.Equal(2, y10Ref.Length);
7355Assert.Equal(2, x14Decl.Length);
7356Assert.Equal(2, x14Ref.Length);
7660Assert.Equal(4, x8Decl.Length);
7661Assert.Equal(4, x8Ref.Length);
7669Assert.Equal(3, x9Decl.Length);
7670Assert.Equal(4, x9Ref.Length);
7677Assert.Equal(3, x10Decl.Length);
7678Assert.Equal(4, x10Ref.Length);
7686Assert.Equal(3, x11Decl.Length);
7687Assert.Equal(4, x11Ref.Length);
7695Assert.Equal(2, x12Decl.Length);
7696Assert.Equal(4, x12Ref.Length);
7703Assert.Equal(2, x13Decl.Length);
7704Assert.Equal(4, x13Ref.Length);
7712Assert.Equal(2, x14Decl.Length);
7713Assert.Equal(4, x14Ref.Length);
7721Assert.Equal(4, x15Ref.Length);
7778Assert.Equal(2, x1Ref.Length);
7783Assert.Equal(2, x2Decl.Length);
7784Assert.Equal(2, x2Ref.Length);
7838Assert.Equal(2, x0Ref.Length);
7843Assert.Equal(2, x1Ref.Length);
7848Assert.Equal(2, x2Ref.Length);
7900Assert.Equal(2, x0Ref.Length);
7905Assert.Equal(2, x1Ref.Length);
7910Assert.Equal(2, x2Ref.Length);
7966Assert.Equal(1, x0Decl.Length);
7967Assert.Equal(4, x0Ref.Length);
7972Assert.Equal(1, x1Decl.Length);
7973Assert.Equal(2, x1Ref.Length);
8030Assert.Equal(1, x0Decl.Length);
8031Assert.Equal(4, x0Ref.Length);
8036Assert.Equal(1, x1Decl.Length);
8037Assert.Equal(2, x1Ref.Length);
8097Assert.Equal(1, x0Decl.Length);
8098Assert.Equal(5, x0Ref.Length);
8103Assert.Equal(1, x1Decl.Length);
8104Assert.Equal(3, x1Ref.Length);
8159Assert.Equal(1, x1Decl.Length);
8160Assert.Equal(2, x1Ref.Length);
8214Assert.Equal(1, x1Decl.Length);
8215Assert.Equal(2, x1Ref.Length);
8392Assert.Equal(2, x1Ref.Length);
8397Assert.Equal(2, x2Ref.Length);
8402Assert.Equal(3, x4Ref.Length);
8408Assert.Equal(2, x6Ref.Length);
8413Assert.Equal(2, x7Ref.Length);
8419Assert.Equal(3, x8Ref.Length);
8425Assert.Equal(2, x9Decl.Length);
8426Assert.Equal(4, x9Ref.Length);
8431Assert.Equal(2, y10Ref.Length);
8440Assert.Equal(2, x14Decl.Length);
8441Assert.Equal(2, x14Ref.Length);
8447Assert.Equal(2, x15Ref.Length);
8492Assert.Equal(2, x1Ref.Length);
8664Assert.Equal(2, x1Ref.Length);
8669Assert.Equal(2, x2Ref.Length);
8674Assert.Equal(2, x3Ref.Length);
8680Assert.Equal(2, x4Ref.Length);
8691Assert.Equal(2, x6Ref.Length);
8696Assert.Equal(2, x7Ref.Length);
8702Assert.Equal(2, x8Ref.Length);
8707Assert.Equal(2, x9Decl.Length);
8708Assert.Equal(2, x9Ref.Length);
8713Assert.Equal(2, y10Ref.Length);
8811Assert.Equal(1, x1Ref.Length);
8874Assert.Equal(1, x1Decl.Length);
8875Assert.Equal(4, x1Ref.Length);
8924Assert.Equal(2, x1Decl.Length);
8925Assert.Equal(2, x1Ref.Length);
9174Assert.Equal(2, x5Decl.Length);
9180Assert.Equal(2, x6Decl.Length);
9181Assert.Equal(2, x6Ref.Length);
9187Assert.Equal(5, x7Ref.Length);
9196Assert.Equal(2, x8Ref.Length);
9201Assert.Equal(2, x9Decl.Length);
9202Assert.Equal(2, x9Ref.Length);
9208Assert.Equal(2, x10Decl.Length);
9209Assert.Equal(2, x10Ref.Length);
9215Assert.Equal(3, x11Ref.Length);
9222Assert.Equal(3, x12Ref.Length);
9343Assert.Equal(2, x4Ref.Length);
9354Assert.Equal(2, x8Ref.Length);
9359Assert.Equal(2, x14Decl.Length);
9436Assert.Equal(2, x4Ref.Length);
9447Assert.Equal(2, x8Ref.Length);
9452Assert.Equal(2, x14Decl.Length);
9512Assert.Equal(2, x1Ref.Length);
9519Assert.Equal(2, x2Ref.Length);
9588Assert.Equal(3, x1Ref.Length);
9593Assert.Equal(2, x2Decl.Length);
9594Assert.Equal(2, x2Ref.Length);
9600Assert.Equal(2, x3Ref.Length);
9605Assert.Equal(2, x4Ref.Length);
9650Assert.Equal(1, x1Ref.Length);
9698Assert.Equal(2, x1Ref.Length);
9763Assert.Equal(1, x1Decl.Length);
9764Assert.Equal(2, x1Ref.Length);
9820Assert.Equal(1, x1Decl.Length);
9821Assert.Equal(1, x1Ref.Length);
9899Assert.Equal(2, x4Ref.Length);
9910Assert.Equal(2, x8Ref.Length);
9915Assert.Equal(2, x14Decl.Length);
9994Assert.Equal(2, x4Ref.Length);
10005Assert.Equal(2, x8Ref.Length);
10010Assert.Equal(2, x14Decl.Length);
10072Assert.Equal(2, x1Ref.Length);
10079Assert.Equal(2, x2Ref.Length);
10153Assert.Equal(3, x1Ref.Length);
10161Assert.Equal(2, x2Decl.Length);
10162Assert.Equal(2, x2Ref.Length);
10168Assert.Equal(2, x3Ref.Length);
10173Assert.Equal(2, x4Ref.Length);
10218Assert.Equal(1, x1Ref.Length);
10265Assert.Equal(2, x1Ref.Length);
10332Assert.Equal(1, x1Decl.Length);
10333Assert.Equal(2, x1Ref.Length);
10391Assert.Equal(1, x1Decl.Length);
10392Assert.Equal(2, x1Ref.Length);
10463Assert.Equal(1, x1Decl.Length);
10464Assert.Equal(2, x1Ref.Length);
10469Assert.Equal(1, x2Decl.Length);
10470Assert.Equal(2, x2Ref.Length);
10475Assert.Equal(1, x3Decl.Length);
10476Assert.Equal(2, x3Ref.Length);
10547Assert.Equal(1, x1Decl.Length);
10548Assert.Equal(2, x1Ref.Length);
10553Assert.Equal(1, x2Decl.Length);
10554Assert.Equal(2, x2Ref.Length);
10559Assert.Equal(1, x3Decl.Length);
10560Assert.Equal(2, x3Ref.Length);
10725Assert.Equal(2, x1Ref.Length);
10730Assert.Equal(2, x2Ref.Length);
10735Assert.Equal(3, x4Ref.Length);
10743Assert.Equal(2, x6Ref.Length);
10748Assert.Equal(2, x7Ref.Length);
10754Assert.Equal(3, x8Ref.Length);
10759Assert.Equal(2, x9Decl.Length);
10760Assert.Equal(4, x9Ref.Length);
10765Assert.Equal(2, y10Ref.Length);
10774Assert.Equal(2, x14Decl.Length);
10775Assert.Equal(2, x14Ref.Length);
10867Assert.Equal(1, x1Ref.Length);
10913Assert.Equal(1, x1Decl.Length);
10914Assert.Equal(3, x1Ref.Length);
10963Assert.Equal(2, x1Decl.Length);
10964Assert.Equal(2, x1Ref.Length);
11059Assert.Equal(2, x5Decl.Length);
11065Assert.Equal(2, x6Decl.Length);
11066Assert.Equal(2, x6Ref.Length);
11072Assert.Equal(3, x7Ref.Length);
11196Assert.Equal(2, x5Decl.Length);
11202Assert.Equal(2, x6Decl.Length);
11203Assert.Equal(2, x6Ref.Length);
11209Assert.Equal(3, x7Ref.Length);
11278Assert.Equal(2, x5Decl.Length);
11284Assert.Equal(2, x6Decl.Length);
11285Assert.Equal(2, x6Ref.Length);
11291Assert.Equal(3, x7Ref.Length);
11472Assert.Equal(2, x1Ref.Length);
11720Assert.Equal(4, y1Ref.Length);
11725Assert.Equal(3, y2Ref.Length);
11730Assert.Equal(4, z2Ref.Length);
11737Assert.Equal(3, y3Ref.Length);
11742Assert.Equal(3, z3Ref.Length);
11749Assert.Equal(5, y4Ref.Length);
11754Assert.Equal(6, z4Ref.Length);
11759Assert.Equal(4, u4Ref.Length);
11767Assert.Equal(4, v4Ref.Length);
11775Assert.Equal(5, y5Ref.Length);
11780Assert.Equal(6, z5Ref.Length);
11785Assert.Equal(4, u5Ref.Length);
11793Assert.Equal(4, v5Ref.Length);
11801Assert.Equal(3, y6Ref.Length);
11806Assert.Equal(3, z6Ref.Length);
11813Assert.Equal(4, y7Ref.Length);
11818Assert.Equal(4, z7Ref.Length);
11826Assert.Equal(4, u7Ref.Length);
11834Assert.Equal(2, y8Ref.Length);
11839Assert.Equal(2, z8Ref.Length);
11845Assert.Equal(3, y9Ref.Length);
11850Assert.Equal(3, z9Ref.Length);
11857Assert.Equal(3, u9Ref.Length);
11864Assert.Equal(2, y10Ref.Length);
11870Assert.Equal(2, y11Ref.Length);
11977Assert.Equal(5, y4Ref.Length);
11982Assert.Equal(6, z4Ref.Length);
11987Assert.Equal(4, u4Ref.Length);
11995Assert.Equal(4, v4Ref.Length);
12003Assert.Equal(5, y5Ref.Length);
12008Assert.Equal(6, z5Ref.Length);
12013Assert.Equal(4, u5Ref.Length);
12021Assert.Equal(4, v5Ref.Length);
12132Assert.Equal(3, yRef.Length);
12282Assert.Equal(2, yDecl.Length);
12283Assert.Equal(2, yRef.Length);
12357Assert.Equal(2, yDecl.Length);
12358Assert.Equal(2, yRef.Length);
12666Assert.Equal(i == 10 ? 1 : 2, yRef.Length);
12783Assert.Equal(2, y1Decl.Length);
12788Assert.Equal(2, y2Decl.Length);
13022Assert.Equal(2, x1Ref.Length);
13206Assert.Equal(3, x1Decl.Length);
13207Assert.Equal(3, x1Ref.Length);
13222Assert.Equal(2, x4Ref.Length);
13229Assert.Equal(2, x5Ref.Length);
13234Assert.Equal(2, x8Decl.Length);
13235Assert.Equal(2, x8Ref.Length);
13249Assert.Equal(2, x11Ref.Length);
13254Assert.Equal(2, x12Ref.Length);
13300Assert.Equal(1, x1Decl.Length);
13301Assert.Equal(1, x1Ref.Length);
13347Assert.Equal(1, x1Ref.Length);
13390Assert.Equal(1, x1Decl.Length);
13391Assert.Equal(1, x1Ref.Length);
13444Assert.Equal(2, x2Decl.Length);
13445Assert.Equal(2, x2Ref.Length);
13610Assert.Equal(3, x1Ref.Length);
13615Assert.Equal(3, x4Ref.Length);
13623Assert.Equal(2, x5Ref.Length);
13628Assert.Equal(3, x6Ref.Length);
13633Assert.Equal(2, x7Ref.Length);
13639Assert.Equal(2, x9Decl.Length);
13640Assert.Equal(4, x9Ref.Length);
13645Assert.Equal(2, y10Ref.Length);
13651Assert.Equal(2, x14Decl.Length);
13652Assert.Equal(2, x14Ref.Length);
13746Assert.Equal(1, x1Ref.Length);
13801Assert.Equal(1, x1Decl.Length);
13802Assert.Equal(3, x1Ref.Length);
13851Assert.Equal(2, x1Decl.Length);
13852Assert.Equal(2, x1Ref.Length);
14132Assert.Equal(3, x1Decl.Length);
14133Assert.Equal(6, x1Ref.Length);
14134for (int i = 0; i < x1Decl.Length; i++)
14141Assert.Equal(2, x2Ref.Length);
14146Assert.Equal(2, x3Ref.Length);
14151Assert.Equal(4, x4Ref.Length);
14158Assert.Equal(3, x5Ref.Length);
14164Assert.Equal(2, x8Decl.Length);
14165Assert.Equal(3, x8Ref.Length);
14166for (int i = 0; i < x8Ref.Length; i++)
14174Assert.Equal(6, x9Ref.Length);
14183Assert.Equal(5, x11Ref.Length);
14191Assert.Equal(5, x12Ref.Length);
14199Assert.Equal(2, x13Decl.Length);
14200Assert.Equal(5, x13Ref.Length);
14206Assert.Equal(2, x14Decl.Length);
14207Assert.Equal(4, x14Ref.Length);
14213Assert.Equal(2, x15Decl.Length);
14214Assert.Equal(3, x15Ref.Length);
14215for (int i = 0; i < x15Ref.Length; i++)
14947Assert.Equal(3, x8Ref.Length);
14948for (int i = 0; i < x8Ref.Length; i++)
14956Assert.Equal(5, x13Ref.Length);
14963Assert.Equal(4, x14Ref.Length);
14972Assert.Equal(3, x16Ref.Length);
14973for (int i = 0; i < x16Ref.Length; i++)
14981Assert.Equal(3, x17Ref.Length);
15127Assert.Equal(3, x1Decl.Length);
15128Assert.Equal(3, x1Ref.Length);
15143Assert.Equal(2, x4Ref.Length);
15150Assert.Equal(2, x5Ref.Length);
15155Assert.Equal(2, x8Decl.Length);
15156Assert.Equal(2, x8Ref.Length);
15170Assert.Equal(2, x11Ref.Length);
15175Assert.Equal(2, x12Ref.Length);
15220Assert.Equal(1, x1Decl.Length);
15221Assert.Equal(1, x1Ref.Length);
15267Assert.Equal(1, x1Ref.Length);
15316Assert.Equal(1, x2Decl.Length);
15317Assert.Equal(1, x2Ref.Length);
15374Assert.Equal(2, x2Decl.Length);
15375Assert.Equal(2, x2Ref.Length);
15535Assert.Equal(2, x1Ref.Length);
15540Assert.Equal(2, x2Ref.Length);
15545Assert.Equal(3, x4Ref.Length);
15551Assert.Equal(2, x6Ref.Length);
15556Assert.Equal(2, x7Ref.Length);
15562Assert.Equal(3, x8Ref.Length);
15568Assert.Equal(2, x9Decl.Length);
15569Assert.Equal(4, x9Ref.Length);
15578Assert.Equal(2, y10Ref.Length);
15587Assert.Equal(2, x14Decl.Length);
15588Assert.Equal(2, x14Ref.Length);
15748Assert.Equal(2, x1Ref.Length);
15753Assert.Equal(2, x2Ref.Length);
15758Assert.Equal(3, x4Ref.Length);
15764Assert.Equal(2, x6Ref.Length);
15769Assert.Equal(2, x7Ref.Length);
15775Assert.Equal(3, x8Ref.Length);
15781Assert.Equal(2, x9Decl.Length);
15782Assert.Equal(4, x9Ref.Length);
15791Assert.Equal(2, y10Ref.Length);
15800Assert.Equal(2, x14Decl.Length);
15801Assert.Equal(2, x14Ref.Length);
15961Assert.Equal(2, x1Ref.Length);
15966Assert.Equal(2, x2Ref.Length);
15971Assert.Equal(3, x4Ref.Length);
15977Assert.Equal(2, x6Ref.Length);
15982Assert.Equal(2, x7Ref.Length);
15988Assert.Equal(3, x8Ref.Length);
15994Assert.Equal(2, x9Decl.Length);
15995Assert.Equal(4, x9Ref.Length);
16004Assert.Equal(2, y10Ref.Length);
16013Assert.Equal(2, x14Decl.Length);
16014Assert.Equal(2, x14Ref.Length);
16076Assert.Equal(2, x1Ref.Length);
16083Assert.Equal(2, x2Ref.Length);
16163Assert.Equal(3, x1Ref.Length);
16168Assert.Equal(2, x2Decl.Length);
16169Assert.Equal(3, x2Ref.Length);
16175Assert.Equal(3, x3Ref.Length);
16180Assert.Equal(3, x4Ref.Length);
16404Assert.Equal(2, x1Ref.Length);
16409Assert.Equal(2, x2Ref.Length);
16414Assert.Equal(3, x4Ref.Length);
16420Assert.Equal(2, x6Ref.Length);
16425Assert.Equal(2, x7Ref.Length);
16431Assert.Equal(3, x8Ref.Length);
16437Assert.Equal(2, x9Decl.Length);
16438Assert.Equal(4, x9Ref.Length);
16443Assert.Equal(2, y10Ref.Length);
16452Assert.Equal(2, x14Decl.Length);
16453Assert.Equal(2, x14Ref.Length);
16545Assert.Equal(1, x1Ref.Length);
16593Assert.Equal(1, x1Decl.Length);
16594Assert.Equal(2, x1Ref.Length);
16647Assert.Equal(2, x1Decl.Length);
16648Assert.Equal(2, x1Ref.Length);
16707Assert.Equal(1, x1Decl.Length);
16708Assert.Equal(2, x1Ref.Length);
16767Assert.Equal(1, x1Decl.Length);
16768Assert.Equal(2, x1Ref.Length);
16830Assert.Equal(1, x1Decl.Length);
16831Assert.Equal(3, x1Ref.Length);
16964Assert.Equal(3, x1Decl.Length);
16965Assert.Equal(3, x1Ref.Length);
16980Assert.Equal(2, x4Ref.Length);
16987Assert.Equal(2, x5Ref.Length);
16992Assert.Equal(2, x8Decl.Length);
16993Assert.Equal(2, x8Ref.Length);
16994for (int i = 0; i < x8Decl.Length; i++)
17006Assert.Equal(2, x11Ref.Length);
17011Assert.Equal(2, x12Ref.Length);
17104Assert.Equal(1, x1Ref.Length);
17153Assert.Equal(1, x1Decl.Length);
17154Assert.Equal(2, x1Ref.Length);
17207Assert.Equal(2, x1Decl.Length);
17208Assert.Equal(2, x1Ref.Length);
17391Assert.Equal(3, x1Decl.Length);
17392Assert.Equal(3, x1Ref.Length);
17407Assert.Equal(2, x4Ref.Length);
17414Assert.Equal(2, x5Ref.Length);
17419Assert.Equal(2, x8Decl.Length);
17420Assert.Equal(2, x8Ref.Length);
17421for (int i = 0; i < x8Decl.Length; i++)
17437Assert.Equal(2, x11Ref.Length);
17442Assert.Equal(2, x12Ref.Length);
17493Assert.Equal(1, x1Decl.Length);
17494Assert.Equal(1, x1Ref.Length);
17540Assert.Equal(1, x1Ref.Length);
17594Assert.Equal(1, x1Decl.Length);
17595Assert.Equal(2, x1Ref.Length);
17647Assert.Equal(1, x1Decl.Length);
17648Assert.Equal(1, x1Ref.Length);
18784Assert.Equal(2, x1Ref.Length);
18828Assert.Equal(2, x1Ref.Length);
19016Assert.Equal(2, x1Ref.Length);
19061Assert.Equal(2, x1Ref.Length);
19104Assert.Equal(2, x1Ref.Length);
19158Assert.Equal(3, x1Ref.Length);
19207Assert.Equal(3, x1Ref.Length);
19254Assert.Equal(3, x1Ref.Length);
20051Assert.Equal(3, yRef.Length);
20361Assert.Equal(1, x1Ref.Length);
20367Assert.Equal(1, x2Ref.Length);
20373Assert.Equal(1, x3Ref.Length);
20379Assert.Equal(1, x4Ref.Length);
20927Assert.Equal(2, x4Ref.Length);
20940Assert.Equal(2, x8Ref.Length);
20946Assert.Equal(2, x14Decl.Length);
21038Assert.Equal(2, x1Ref.Length);
21046Assert.Equal(2, x2Ref.Length);
21054Assert.Equal(2, x2Ref.Length);
21133Assert.Equal(3, x1Ref.Length);
21139Assert.Equal(2, x2Decl.Length);
21140Assert.Equal(2, x2Ref.Length);
21147Assert.Equal(2, x3Ref.Length);
21153Assert.Equal(2, x4Ref.Length);
21237Assert.Equal(3, x1Ref.Length);
21243Assert.Equal(2, x2Decl.Length);
21244Assert.Equal(2, x2Ref.Length);
21251Assert.Equal(2, x3Ref.Length);
21257Assert.Equal(2, x4Ref.Length);
21303Assert.Equal(1, x1Ref.Length);
21362Assert.Equal(2, x1Ref.Length);
21613Assert.Equal(2, x1Ref.Length);
21619Assert.Equal(2, x2Ref.Length);
21625Assert.Equal(3, x4Ref.Length);
21632Assert.Equal(2, x6Ref.Length);
21638Assert.Equal(2, x7Ref.Length);
21645Assert.Equal(3, x8Ref.Length);
21652Assert.Equal(2, x9Decl.Length);
21653Assert.Equal(4, x9Ref.Length);
21659Assert.Equal(2, y10Ref.Length);
21668Assert.Equal(2, x14Decl.Length);
21669Assert.Equal(2, x14Ref.Length);
21784Assert.Equal(4, x8Decl.Length);
21785Assert.Equal(4, x8Ref.Length);
21795Assert.Equal(3, x9Decl.Length);
21796Assert.Equal(4, x9Ref.Length);
21968Assert.Equal(2, x1Ref.Length);
21974Assert.Equal(2, x2Ref.Length);
21980Assert.Equal(3, x4Ref.Length);
21987Assert.Equal(2, x6Ref.Length);
21993Assert.Equal(2, x7Ref.Length);
22000Assert.Equal(3, x8Ref.Length);
22007Assert.Equal(2, x9Decl.Length);
22008Assert.Equal(4, x9Ref.Length);
22019Assert.Equal(2, y10Ref.Length);
22028Assert.Equal(2, x14Decl.Length);
22029Assert.Equal(2, x14Ref.Length);
22095Assert.Equal(2, x1Ref.Length);
22104Assert.Equal(2, x2Ref.Length);
22193Assert.Equal(3, x1Ref.Length);
22199Assert.Equal(2, x2Decl.Length);
22200Assert.Equal(3, x2Ref.Length);
22207Assert.Equal(3, x3Ref.Length);
22213Assert.Equal(3, x4Ref.Length);
22381Assert.Equal(2, x1Ref.Length);
22387Assert.Equal(2, x2Ref.Length);
22393Assert.Equal(3, x4Ref.Length);
22400Assert.Equal(2, x6Ref.Length);
22406Assert.Equal(2, x7Ref.Length);
22413Assert.Equal(3, x8Ref.Length);
22420Assert.Equal(2, x9Decl.Length);
22421Assert.Equal(4, x9Ref.Length);
22427Assert.Equal(2, y10Ref.Length);
22436Assert.Equal(2, x14Decl.Length);
22437Assert.Equal(2, x14Ref.Length);
22536Assert.Equal(2, x1Ref.Length);
22544Assert.Equal(2, x2Ref.Length);
22550Assert.Equal(2, x3Ref.Length);
22558Assert.Equal(2, x4Decl.Length);
22559Assert.Equal(3, x4Ref.Length);
22625Assert.Equal(2, x5Decl.Length);
22632Assert.Equal(2, x6Decl.Length);
22633Assert.Equal(2, x6Ref.Length);
22640Assert.Equal(3, x7Ref.Length);
22748Assert.Equal(2, x5Decl.Length);
22755Assert.Equal(2, x6Decl.Length);
22756Assert.Equal(2, x6Ref.Length);
22763Assert.Equal(3, x7Ref.Length);
22830Assert.Equal(2, x5Decl.Length);
22837Assert.Equal(2, x6Decl.Length);
22838Assert.Equal(2, x6Ref.Length);
22845Assert.Equal(3, x7Ref.Length);
22914Assert.Equal(2, x5Decl.Length);
22921Assert.Equal(2, x6Decl.Length);
22922Assert.Equal(2, x6Ref.Length);
22929Assert.Equal(3, x7Ref.Length);
23166Assert.Equal(2, x1Ref.Length);
23171Assert.Equal(3, x4Ref.Length);
23177Assert.Equal(2, x6Ref.Length);
23182Assert.Equal(2, x7Ref.Length);
23188Assert.Equal(3, x8Ref.Length);
23194Assert.Equal(2, x9Decl.Length);
23195Assert.Equal(4, x9Ref.Length);
23200Assert.Equal(2, y10Ref.Length);
23206Assert.Equal(2, x14Decl.Length);
23207Assert.Equal(2, x14Ref.Length);
23213Assert.Equal(2, x15Ref.Length);
23260Assert.Equal(2, x1Ref.Length);
23265Assert.Equal(3, x4Ref.Length);
23271Assert.Equal(2, x6Ref.Length);
23276Assert.Equal(2, x7Ref.Length);
23282Assert.Equal(3, x8Ref.Length);
23288Assert.Equal(2, x9Decl.Length);
23289Assert.Equal(4, x9Ref.Length);
23294Assert.Equal(2, y10Ref.Length);
23300Assert.Equal(2, x14Decl.Length);
23301Assert.Equal(2, x14Ref.Length);
23307Assert.Equal(2, x15Ref.Length);
23350Assert.Equal(2, x1Ref.Length);
23398Assert.Equal(1, x1Ref.Length);
23431Assert.Equal(1, x1Ref.Length);
23482Assert.Equal(2, x1Ref.Length);
23626Assert.Equal(2, x1Ref.Length);
23631Assert.Equal(2, x2Ref.Length);
23636Assert.Equal(3, x4Ref.Length);
23642Assert.Equal(2, x6Ref.Length);
23647Assert.Equal(2, x7Ref.Length);
23653Assert.Equal(3, x8Ref.Length);
23659Assert.Equal(2, x9Decl.Length);
23660Assert.Equal(4, x9Ref.Length);
23665Assert.Equal(2, y10Ref.Length);
23674Assert.Equal(2, x14Decl.Length);
23675Assert.Equal(2, x14Ref.Length);
23724Assert.Equal(2, x1Ref.Length);
23729Assert.Equal(2, x2Ref.Length);
23734Assert.Equal(3, x4Ref.Length);
23740Assert.Equal(2, x6Ref.Length);
23745Assert.Equal(2, x7Ref.Length);
23751Assert.Equal(3, x8Ref.Length);
23757Assert.Equal(2, x9Decl.Length);
23758Assert.Equal(4, x9Ref.Length);
23763Assert.Equal(2, y10Ref.Length);
23772Assert.Equal(2, x14Decl.Length);
23773Assert.Equal(2, x14Ref.Length);
23822Assert.Equal(2, x0Ref.Length);
23827Assert.Equal(2, x1Ref.Length);
23832Assert.Equal(2, x2Ref.Length);
23964Assert.Equal(2, x1Ref.Length);
23969Assert.Equal(2, x2Ref.Length);
23974Assert.Equal(3, x4Ref.Length);
23980Assert.Equal(2, x6Ref.Length);
23985Assert.Equal(2, x7Ref.Length);
23991Assert.Equal(3, x8Ref.Length);
23997Assert.Equal(2, x9Decl.Length);
23998Assert.Equal(4, x9Ref.Length);
24003Assert.Equal(2, y10Ref.Length);
24012Assert.Equal(2, x14Decl.Length);
24013Assert.Equal(2, x14Ref.Length);
24019Assert.Equal(2, x15Ref.Length);
24068Assert.Equal(2, x1Ref.Length);
24073Assert.Equal(2, x2Ref.Length);
24078Assert.Equal(3, x4Ref.Length);
24084Assert.Equal(2, x6Ref.Length);
24089Assert.Equal(2, x7Ref.Length);
24095Assert.Equal(3, x8Ref.Length);
24101Assert.Equal(2, x9Decl.Length);
24102Assert.Equal(4, x9Ref.Length);
24107Assert.Equal(2, y10Ref.Length);
24116Assert.Equal(2, x14Decl.Length);
24117Assert.Equal(2, x14Ref.Length);
24123Assert.Equal(2, x15Ref.Length);
24163Assert.Equal(2, x1Ref.Length);
24259Assert.Equal(2, x5Decl.Length);
24265Assert.Equal(2, x6Decl.Length);
24266Assert.Equal(2, x6Ref.Length);
24272Assert.Equal(5, x7Ref.Length);
24281Assert.Equal(2, x8Ref.Length);
24286Assert.Equal(2, x9Decl.Length);
24287Assert.Equal(2, x9Ref.Length);
24293Assert.Equal(2, x10Decl.Length);
24294Assert.Equal(2, x10Ref.Length);
24300Assert.Equal(3, x11Ref.Length);
24307Assert.Equal(3, x12Ref.Length);
24365Assert.Equal(2, x5Decl.Length);
24371Assert.Equal(2, x6Decl.Length);
24372Assert.Equal(2, x6Ref.Length);
24378Assert.Equal(5, x7Ref.Length);
24387Assert.Equal(2, x8Ref.Length);
24392Assert.Equal(2, x9Decl.Length);
24393Assert.Equal(2, x9Ref.Length);
24399Assert.Equal(2, x10Decl.Length);
24400Assert.Equal(2, x10Ref.Length);
24406Assert.Equal(3, x11Ref.Length);
24413Assert.Equal(3, x12Ref.Length);
24683Assert.Equal(4, y1Ref.Length);
24688Assert.Equal(3, y2Ref.Length);
24693Assert.Equal(4, z2Ref.Length);
24700Assert.Equal(3, y3Ref.Length);
24705Assert.Equal(3, z3Ref.Length);
24712Assert.Equal(5, y4Ref.Length);
24717Assert.Equal(6, z4Ref.Length);
24722Assert.Equal(4, u4Ref.Length);
24730Assert.Equal(4, v4Ref.Length);
24738Assert.Equal(5, y5Ref.Length);
24743Assert.Equal(6, z5Ref.Length);
24748Assert.Equal(4, u5Ref.Length);
24756Assert.Equal(4, v5Ref.Length);
24764Assert.Equal(3, y6Ref.Length);
24769Assert.Equal(3, z6Ref.Length);
24776Assert.Equal(4, y7Ref.Length);
24781Assert.Equal(4, z7Ref.Length);
24789Assert.Equal(4, u7Ref.Length);
24797Assert.Equal(2, y8Ref.Length);
24802Assert.Equal(2, z8Ref.Length);
24808Assert.Equal(3, y9Ref.Length);
24813Assert.Equal(3, z9Ref.Length);
24820Assert.Equal(3, u9Ref.Length);
24827Assert.Equal(2, y10Ref.Length);
24833Assert.Equal(2, y11Ref.Length);
24942Assert.Equal(4, y1Ref.Length);
24947Assert.Equal(3, y2Ref.Length);
24952Assert.Equal(4, z2Ref.Length);
24959Assert.Equal(3, y3Ref.Length);
24964Assert.Equal(3, z3Ref.Length);
24971Assert.Equal(5, y4Ref.Length);
24976Assert.Equal(6, z4Ref.Length);
24981Assert.Equal(4, u4Ref.Length);
24989Assert.Equal(4, v4Ref.Length);
24997Assert.Equal(5, y5Ref.Length);
25002Assert.Equal(6, z5Ref.Length);
25007Assert.Equal(4, u5Ref.Length);
25015Assert.Equal(4, v5Ref.Length);
25023Assert.Equal(3, y6Ref.Length);
25028Assert.Equal(3, z6Ref.Length);
25035Assert.Equal(4, y7Ref.Length);
25040Assert.Equal(4, z7Ref.Length);
25048Assert.Equal(4, u7Ref.Length);
25056Assert.Equal(2, y8Ref.Length);
25061Assert.Equal(2, z8Ref.Length);
25067Assert.Equal(3, y9Ref.Length);
25072Assert.Equal(3, z9Ref.Length);
25079Assert.Equal(3, u9Ref.Length);
25086Assert.Equal(2, y10Ref.Length);
25092Assert.Equal(2, y11Ref.Length);
25246Assert.Equal(2, x1Ref.Length);
25251Assert.Equal(2, x2Ref.Length);
25256Assert.Equal(3, x4Ref.Length);
25262Assert.Equal(2, x6Ref.Length);
25267Assert.Equal(2, x7Ref.Length);
25273Assert.Equal(3, x8Ref.Length);
25279Assert.Equal(2, x9Decl.Length);
25280Assert.Equal(4, x9Ref.Length);
25289Assert.Equal(2, y10Ref.Length);
25298Assert.Equal(2, x14Decl.Length);
25299Assert.Equal(2, x14Ref.Length);
25345Assert.Equal(2, x1Ref.Length);
25350Assert.Equal(2, x2Ref.Length);
25355Assert.Equal(3, x4Ref.Length);
25361Assert.Equal(2, x6Ref.Length);
25366Assert.Equal(2, x7Ref.Length);
25372Assert.Equal(3, x8Ref.Length);
25378Assert.Equal(2, x9Decl.Length);
25379Assert.Equal(4, x9Ref.Length);
25388Assert.Equal(2, y10Ref.Length);
25397Assert.Equal(2, x14Decl.Length);
25398Assert.Equal(2, x14Ref.Length);
25524Assert.Equal(2, x1Ref.Length);
25537Assert.Equal(2, x4Decl.Length);
25568Assert.Equal(2, x1Ref.Length);
25582Assert.Equal(2, x4Decl.Length);
25649Assert.Equal(2, x1Ref.Length);
25662Assert.Equal(2, x4Decl.Length);
25693Assert.Equal(2, x1Ref.Length);
25707Assert.Equal(2, x4Decl.Length);
25748Assert.Equal(2, x1Ref.Length);
25829Assert.Equal(2, x1Ref.Length);
25842Assert.Equal(2, x4Decl.Length);
25848Assert.Equal(2, x5Decl.Length);
25849Assert.Equal(3, x5Ref.Length);
25889Assert.Equal(2, x1Ref.Length);
25903Assert.Equal(2, x4Decl.Length);
25909Assert.Equal(2, x5Decl.Length);
25910Assert.Equal(3, x5Ref.Length);
25986Assert.Equal(2, x1Ref.Length);
25999Assert.Equal(2, x4Decl.Length);
26005Assert.Equal(2, x5Decl.Length);
26006Assert.Equal(3, x5Ref.Length);
26043Assert.Equal(2, x1Ref.Length);
26057Assert.Equal(2, x4Decl.Length);
26063Assert.Equal(2, x5Decl.Length);
26064Assert.Equal(3, x5Ref.Length);
26110Assert.Equal(2, x1Decl.Length);
26111Assert.Equal(3, x1Ref.Length);
26158Assert.Equal(2, x1Decl.Length);
26159Assert.Equal(3, x1Ref.Length);
26239Assert.Equal(2, x1Ref.Length);
26252Assert.Equal(2, x4Decl.Length);
26286Assert.Equal(2, x1Ref.Length);
26300Assert.Equal(2, x4Decl.Length);
26381Assert.Equal(2, x1Ref.Length);
26395Assert.Equal(2, x4Decl.Length);
26429Assert.Equal(2, x1Ref.Length);
26443Assert.Equal(2, x4Decl.Length);
26513Assert.Equal(2, x1Ref.Length);
26526Assert.Equal(2, x4Decl.Length);
26573Assert.Equal(2, x1Ref.Length);
26587Assert.Equal(2, x4Decl.Length);
26657Assert.Equal(2, x1Ref.Length);
26670Assert.Equal(2, x4Decl.Length);
26717Assert.Equal(2, x1Ref.Length);
26731Assert.Equal(2, x4Decl.Length);
26778Assert.Equal(3, x1Ref.Length);
26848Assert.Equal(2, x1Ref.Length);
26861Assert.Equal(2, x4Decl.Length);
26892Assert.Equal(2, x1Ref.Length);
26906Assert.Equal(2, x4Decl.Length);
26978Assert.Equal(2, x1Ref.Length);
26992Assert.Equal(2, x4Decl.Length);
27023Assert.Equal(2, x1Ref.Length);
27037Assert.Equal(2, x4Decl.Length);
27115Assert.Equal(2, x1Ref.Length);
27128Assert.Equal(2, x4Decl.Length);
27134Assert.Equal(2, x5Decl.Length);
27135Assert.Equal(3, x5Ref.Length);
27169Assert.Equal(2, x1Ref.Length);
27183Assert.Equal(2, x4Decl.Length);
27189Assert.Equal(2, x5Decl.Length);
27190Assert.Equal(3, x5Ref.Length);
27268Assert.Equal(2, x1Ref.Length);
27281Assert.Equal(2, x4Decl.Length);
27287Assert.Equal(2, x5Decl.Length);
27288Assert.Equal(3, x5Ref.Length);
27322Assert.Equal(2, x1Ref.Length);
27336Assert.Equal(2, x4Decl.Length);
27342Assert.Equal(2, x5Decl.Length);
27343Assert.Equal(3, x5Ref.Length);
27391Assert.Equal(2, x1Decl.Length);
27392Assert.Equal(3, x1Ref.Length);
27468Assert.Equal(2, x1Ref.Length);
27485Assert.Equal(2, x4Decl.Length);
27492Assert.Equal(2, x5Decl.Length);
27493Assert.Equal(3, x5Ref.Length);
27541Assert.Equal(2, x1Ref.Length);
27558Assert.Equal(2, x4Decl.Length);
27565Assert.Equal(2, x5Decl.Length);
27566Assert.Equal(3, x5Ref.Length);
27645Assert.Equal(2, x1Ref.Length);
27662Assert.Equal(2, x4Decl.Length);
27669Assert.Equal(2, x5Decl.Length);
27670Assert.Equal(3, x5Ref.Length);
27718Assert.Equal(2, x1Ref.Length);
27735Assert.Equal(2, x4Decl.Length);
27742Assert.Equal(2, x5Decl.Length);
27743Assert.Equal(3, x5Ref.Length);
27781Assert.Equal(1, x1Decl.Length);
27782Assert.Equal(1, x1Ref.Length);
27858Assert.Equal(2, x1Ref.Length);
27875Assert.Equal(2, x4Decl.Length);
27882Assert.Equal(2, x5Decl.Length);
27883Assert.Equal(3, x5Ref.Length);
27931Assert.Equal(2, x1Ref.Length);
27948Assert.Equal(2, x4Decl.Length);
27955Assert.Equal(2, x5Decl.Length);
27956Assert.Equal(3, x5Ref.Length);
28036Assert.Equal(2, x1Ref.Length);
28053Assert.Equal(2, x4Decl.Length);
28060Assert.Equal(2, x5Decl.Length);
28061Assert.Equal(3, x5Ref.Length);
28109Assert.Equal(2, x1Ref.Length);
28126Assert.Equal(2, x4Decl.Length);
28133Assert.Equal(2, x5Decl.Length);
28134Assert.Equal(3, x5Ref.Length);
28182Assert.Equal(1, x1Decl.Length);
28183Assert.Equal(1, x1Ref.Length);
28257Assert.Equal(2, x1Ref.Length);
28270Assert.Equal(2, x4Decl.Length);
28276Assert.Equal(2, x5Decl.Length);
28277Assert.Equal(3, x5Ref.Length);
28311Assert.Equal(2, x1Ref.Length);
28325Assert.Equal(2, x4Decl.Length);
28331Assert.Equal(2, x5Decl.Length);
28332Assert.Equal(3, x5Ref.Length);
28408Assert.Equal(2, x1Ref.Length);
28421Assert.Equal(2, x4Decl.Length);
28427Assert.Equal(2, x5Decl.Length);
28428Assert.Equal(3, x5Ref.Length);
28462Assert.Equal(2, x1Ref.Length);
28476Assert.Equal(2, x4Decl.Length);
28482Assert.Equal(2, x5Decl.Length);
28483Assert.Equal(3, x5Ref.Length);
28529Assert.Equal(2, x1Decl.Length);
28530Assert.Equal(3, x1Ref.Length);
28577Assert.Equal(2, x1Decl.Length);
28578Assert.Equal(3, x1Ref.Length);
28661Assert.Equal(2, x1Ref.Length);
28674Assert.Equal(2, x4Decl.Length);
28680Assert.Equal(1, x5Ref.Length);
28685Assert.Equal(1, x6Ref.Length);
28722Assert.Equal(2, x1Ref.Length);
28736Assert.Equal(2, x4Decl.Length);
28742Assert.Equal(1, x5Ref.Length);
28748Assert.Equal(1, x6Ref.Length);
28829Assert.Equal(2, x1Ref.Length);
28842Assert.Equal(2, x4Decl.Length);
28885Assert.Equal(2, x1Ref.Length);
28899Assert.Equal(2, x4Decl.Length);
28980Assert.Equal(2, x1Ref.Length);
28993Assert.Equal(2, x4Decl.Length);
29036Assert.Equal(2, x1Ref.Length);
29050Assert.Equal(2, x4Decl.Length);
29101Assert.Equal(2, x1Ref.Length);
29187Assert.Equal(2, x1Ref.Length);
29200Assert.Equal(2, x4Decl.Length);
29206Assert.Equal(2, x5Ref.Length);
29254Assert.Equal(2, x1Ref.Length);
29268Assert.Equal(2, x4Decl.Length);
29274Assert.Equal(2, x5Ref.Length);
29363Assert.Equal(2, x1Ref.Length);
29376Assert.Equal(2, x4Decl.Length);
29382Assert.Equal(2, x5Ref.Length);
29430Assert.Equal(2, x1Ref.Length);
29444Assert.Equal(2, x4Decl.Length);
29450Assert.Equal(2, x5Ref.Length);
29503Assert.Equal(2, x1Ref.Length);
29650Assert.Equal(2, x1Ref.Length);
29663Assert.Equal(2, x4Decl.Length);
29669Assert.Equal(1, x5Ref.Length);
29674Assert.Equal(1, x6Ref.Length);
29726Assert.Equal(2, x1Ref.Length);
29740Assert.Equal(2, x4Decl.Length);
29851Assert.Equal(2, x1Ref.Length);
29864Assert.Equal(2, x4Decl.Length);
29870Assert.Equal(1, x5Ref.Length);
29875Assert.Equal(1, x6Ref.Length);
29927Assert.Equal(2, x1Ref.Length);
29941Assert.Equal(2, x4Decl.Length);
30005Assert.Equal(2, x1Ref.Length);
30091Assert.Equal(2, x1Ref.Length);
30104Assert.Equal(2, x4Decl.Length);
30152Assert.Equal(2, x1Ref.Length);
30166Assert.Equal(2, x4Decl.Length);
30263Assert.Equal(2, x1Ref.Length);
30276Assert.Equal(2, x4Decl.Length);
30324Assert.Equal(2, x1Ref.Length);
30338Assert.Equal(2, x4Decl.Length);
30388Assert.Equal(2, x1Ref.Length);
30443Assert.Equal(4, x1Ref.Length);
30487Assert.Equal(2, x1Ref.Length);
30531Assert.Equal(2, x1Ref.Length);
30652Assert.Equal(2, x1Ref.Length);
30665Assert.Equal(2, x4Decl.Length);
30721Assert.Equal(2, x1Ref.Length);
30738Assert.Equal(2, x4Decl.Length);
30823Assert.Equal(2, x1Ref.Length);
30836Assert.Equal(2, x4Decl.Length);
30892Assert.Equal(2, x1Ref.Length);
30909Assert.Equal(2, x4Decl.Length);
30956Assert.Equal(2, x1Ref.Length);
31011Assert.Equal(4, x1Ref.Length);
31055Assert.Equal(2, x1Ref.Length);
31099Assert.Equal(2, x1Ref.Length);
31183Assert.Equal(2, x1Ref.Length);
31196Assert.Equal(2, x4Decl.Length);
31242Assert.Equal(2, x1Ref.Length);
31259Assert.Equal(2, x4Decl.Length);
31356Assert.Equal(2, x1Ref.Length);
31369Assert.Equal(2, x4Decl.Length);
31415Assert.Equal(2, x1Ref.Length);
31432Assert.Equal(2, x4Decl.Length);
31484Assert.Equal(2, x1Ref.Length);
31539Assert.Equal(4, x1Ref.Length);
31583Assert.Equal(2, x1Ref.Length);
31627Assert.Equal(2, x1Ref.Length);
31722Assert.Equal(2, x1Ref.Length);
31756Assert.Equal(2, x1Ref.Length);
31809Assert.Equal(2, x1Ref.Length);
31849Assert.Equal(2, x1Ref.Length);
31899Assert.Equal(2, x1Ref.Length);
31933Assert.Equal(2, x1Ref.Length);
31989Assert.Equal(2, x1Ref.Length);
32029Assert.Equal(2, x1Ref.Length);
32152Assert.Equal(1, x1Ref.Length);
32438Assert.Equal(1, x1Ref.Length);
33501Assert.Equal(3, x6Decl.Length);
33502Assert.Equal(3, x6Ref.Length);
33568Assert.Equal(4, refs.Length);
33654Assert.Equal(4, refs.Length);
33744Assert.Equal(2, x5Decl.Length);
33750Assert.Equal(2, x6Decl.Length);
33751Assert.Equal(2, x6Ref.Length);
33757Assert.Equal(3, x7Ref.Length);
33842Assert.Equal(2, x5Decl.Length);
33848Assert.Equal(2, x6Decl.Length);
33849Assert.Equal(2, x6Ref.Length);
33855Assert.Equal(3, x7Ref.Length);
33941Assert.Equal(2, x5Decl.Length);
33947Assert.Equal(2, x6Decl.Length);
33948Assert.Equal(2, x6Ref.Length);
33954Assert.Equal(3, x7Ref.Length);
34039Assert.Equal(2, x5Decl.Length);
34045Assert.Equal(2, x6Decl.Length);
34046Assert.Equal(2, x6Ref.Length);
34052Assert.Equal(3, x7Ref.Length);
34108Assert.Equal(2, x2Decl.Length);
34109Assert.Equal(2, x2Ref.Length);
34164Assert.Equal(2, x2Decl.Length);
34165Assert.Equal(2, x2Ref.Length);
34353Assert.Equal(2, x1Ref.Length);
34358Assert.Equal(2, x2Ref.Length);
34363Assert.Equal(3, x3Ref.Length);
34444Assert.Equal(2, x1Ref.Length);
34449Assert.Equal(3, x2Ref.Length);
34551Assert.Equal(2, x1Ref.Length);
34556Assert.Equal(3, x2Ref.Length);
34672Assert.Equal(2, x1Ref.Length);
34677Assert.Equal(2, x2Ref.Length);
34682Assert.Equal(3, x3Ref.Length);
34713Assert.Equal(1, refs.Length);
34791Assert.Equal(4, refs.Length);
34846Assert.Equal(2, refs.Length);
34900Assert.Equal(2, refs.Length);
34958Assert.Equal(2, refs.Length);
35008Assert.Equal(2, refs.Length);
35062Assert.Equal(2, refs.Length);
35100Assert.Equal(2, refs.Length);
Semantics\PatternMatchingTests.cs (95)
697Assert.Equal(1, x1Decl.Length);
698Assert.Equal(4, x1Ref.Length);
741Assert.Equal(2, x1Decl.Length);
742Assert.Equal(2, x1Ref.Length);
1156Assert.Equal(2, x1Decl.Length);
1157Assert.Equal(2, x1Ref.Length);
1225Assert.Equal(2, x1Decl.Length);
1226Assert.Equal(2, x1Ref.Length);
1275Assert.Equal(1, x1Decl.Length);
1276Assert.Equal(3, x1Ref.Length);
1319Assert.Equal(2, x1Decl.Length);
1320Assert.Equal(2, x1Ref.Length);
1434Assert.Equal(1, x1Decl.Length);
1435Assert.Equal(2, x1Ref.Length);
1484Assert.Equal(1, x1Decl.Length);
1485Assert.Equal(1, x1Ref.Length);
1541Assert.Equal(1, x1Decl.Length);
1542Assert.Equal(2, x1Ref.Length);
1593Assert.Equal(1, x1Decl.Length);
1594Assert.Equal(2, x1Ref.Length);
1658Assert.Equal(1, x1Decl.Length);
1659Assert.Equal(2, x1Ref.Length);
1664Assert.Equal(1, x2Decl.Length);
1665Assert.Equal(2, x2Ref.Length);
1670Assert.Equal(1, x3Decl.Length);
1671Assert.Equal(2, x3Ref.Length);
1735Assert.Equal(1, x1Decl.Length);
1736Assert.Equal(2, x1Ref.Length);
1741Assert.Equal(1, x2Decl.Length);
1742Assert.Equal(2, x2Ref.Length);
1747Assert.Equal(1, x3Decl.Length);
1748Assert.Equal(2, x3Ref.Length);
1788Assert.Equal(1, x1Decl.Length);
1789Assert.Equal(2, x1Ref.Length);
1832Assert.Equal(2, x1Decl.Length);
1833Assert.Equal(2, x1Ref.Length);
1886Assert.Equal(1, x1Decl.Length);
1887Assert.Equal(2, x1Ref.Length);
1940Assert.Equal(1, x1Decl.Length);
1941Assert.Equal(2, x1Ref.Length);
1997Assert.Equal(1, x1Decl.Length);
1998Assert.Equal(3, x1Ref.Length);
2035Assert.Equal(1, x1Decl.Length);
2036Assert.Equal(1, x1Ref.Length);
2081Assert.Equal(2, x1Decl.Length);
2082Assert.Equal(2, x1Ref.Length);
2135Assert.Equal(1, x1Decl.Length);
2136Assert.Equal(2, x1Ref.Length);
2183Assert.Equal(2, x0Ref.Length);
2188Assert.Equal(2, x1Ref.Length);
2193Assert.Equal(2, x2Ref.Length);
2239Assert.Equal(2, x0Ref.Length);
2244Assert.Equal(2, x1Ref.Length);
2249Assert.Equal(2, x2Ref.Length);
2299Assert.Equal(1, x0Decl.Length);
2300Assert.Equal(4, x0Ref.Length);
2305Assert.Equal(1, x1Decl.Length);
2306Assert.Equal(2, x1Ref.Length);
2357Assert.Equal(1, x0Decl.Length);
2358Assert.Equal(4, x0Ref.Length);
2363Assert.Equal(1, x1Decl.Length);
2364Assert.Equal(2, x1Ref.Length);
2418Assert.Equal(1, x0Decl.Length);
2419Assert.Equal(5, x0Ref.Length);
2424Assert.Equal(1, x1Decl.Length);
2425Assert.Equal(3, x1Ref.Length);
2463Assert.Equal(2, x1Ref.Length);
2502Assert.Equal(1, x1Decl.Length);
2503Assert.Equal(3, x1Ref.Length);
2546Assert.Equal(2, x1Decl.Length);
2547Assert.Equal(2, x1Ref.Length);
2618Assert.Equal(1, x1Decl.Length);
2619Assert.Equal(2, x1Ref.Length);
2666Assert.Equal(2, x1Decl.Length);
2667Assert.Equal(2, x1Ref.Length);
2704Assert.Equal(1, x1Decl.Length);
2705Assert.Equal(1, x1Ref.Length);
2749Assert.Equal(2, x1Decl.Length);
2750Assert.Equal(2, x1Ref.Length);
2793Assert.Equal(1, x1Decl.Length);
2794Assert.Equal(1, x1Ref.Length);
2845Assert.Equal(2, x1Decl.Length);
2846Assert.Equal(2, x1Ref.Length);
2887Assert.Equal(2, x1Ref.Length);
3042Assert.Equal(1, x1Decl.Length);
3043Assert.Equal(1, x1Ref.Length);
3089Assert.Equal(1, x1Decl.Length);
3090Assert.Equal(1, x1Ref.Length);
4795Assert.Equal(1, colorDecl.Length);
4796Assert.Equal(2, colorRef.Length);
4832Assert.Equal(1, x3Decl.Length);
4833Assert.Equal(1, x3Ref.Length);
4954int index = r.Next(expressions.Length + 1) - 1;
4967string Type() => types[r.Next(types.Length)];
11366Assert.Equal(2, exprs.Length);
Semantics\PatternMatchingTests_Global.cs (385)
81Assert.Equal(2, x1Ref.Length);
94Assert.Equal(2, x4Decl.Length);
125Assert.Equal(2, x1Ref.Length);
139Assert.Equal(2, x4Decl.Length);
203Assert.Equal(2, x1Ref.Length);
216Assert.Equal(2, x4Decl.Length);
247Assert.Equal(2, x1Ref.Length);
261Assert.Equal(2, x4Decl.Length);
297Assert.Equal(2, x1Ref.Length);
373Assert.Equal(2, x1Ref.Length);
386Assert.Equal(2, x4Decl.Length);
392Assert.Equal(2, x5Decl.Length);
393Assert.Equal(3, x5Ref.Length);
433Assert.Equal(2, x1Ref.Length);
447Assert.Equal(2, x4Decl.Length);
453Assert.Equal(2, x5Decl.Length);
454Assert.Equal(3, x5Ref.Length);
525Assert.Equal(2, x1Ref.Length);
538Assert.Equal(2, x4Decl.Length);
544Assert.Equal(2, x5Decl.Length);
545Assert.Equal(3, x5Ref.Length);
582Assert.Equal(2, x1Ref.Length);
596Assert.Equal(2, x4Decl.Length);
602Assert.Equal(2, x5Decl.Length);
603Assert.Equal(3, x5Ref.Length);
644Assert.Equal(2, x1Decl.Length);
645Assert.Equal(3, x1Ref.Length);
686Assert.Equal(2, x1Decl.Length);
687Assert.Equal(3, x1Ref.Length);
762Assert.Equal(2, x1Ref.Length);
775Assert.Equal(2, x4Decl.Length);
809Assert.Equal(2, x1Ref.Length);
823Assert.Equal(2, x4Decl.Length);
899Assert.Equal(2, x1Ref.Length);
913Assert.Equal(2, x4Decl.Length);
947Assert.Equal(2, x1Ref.Length);
961Assert.Equal(2, x4Decl.Length);
1026Assert.Equal(2, x1Ref.Length);
1039Assert.Equal(2, x4Decl.Length);
1079Assert.Equal(2, x1Ref.Length);
1093Assert.Equal(2, x4Decl.Length);
1158Assert.Equal(2, x1Ref.Length);
1171Assert.Equal(2, x4Decl.Length);
1211Assert.Equal(2, x1Ref.Length);
1225Assert.Equal(2, x4Decl.Length);
1267Assert.Equal(3, x1Ref.Length);
1332Assert.Equal(2, x1Ref.Length);
1345Assert.Equal(2, x4Decl.Length);
1376Assert.Equal(2, x1Ref.Length);
1390Assert.Equal(2, x4Decl.Length);
1457Assert.Equal(2, x1Ref.Length);
1471Assert.Equal(2, x4Decl.Length);
1502Assert.Equal(2, x1Ref.Length);
1516Assert.Equal(2, x4Decl.Length);
1589Assert.Equal(2, x1Ref.Length);
1602Assert.Equal(2, x4Decl.Length);
1608Assert.Equal(2, x5Decl.Length);
1609Assert.Equal(3, x5Ref.Length);
1643Assert.Equal(2, x1Ref.Length);
1657Assert.Equal(2, x4Decl.Length);
1663Assert.Equal(2, x5Decl.Length);
1664Assert.Equal(3, x5Ref.Length);
1737Assert.Equal(2, x1Ref.Length);
1750Assert.Equal(2, x4Decl.Length);
1756Assert.Equal(2, x5Decl.Length);
1757Assert.Equal(3, x5Ref.Length);
1791Assert.Equal(2, x1Ref.Length);
1805Assert.Equal(2, x4Decl.Length);
1811Assert.Equal(2, x5Decl.Length);
1812Assert.Equal(3, x5Ref.Length);
1855Assert.Equal(2, x1Decl.Length);
1856Assert.Equal(3, x1Ref.Length);
1929Assert.Equal(2, x1Ref.Length);
1946Assert.Equal(2, x4Decl.Length);
1953Assert.Equal(2, x5Decl.Length);
1954Assert.Equal(3, x5Ref.Length);
1999Assert.Equal(2, x1Ref.Length);
2016Assert.Equal(2, x4Decl.Length);
2023Assert.Equal(2, x5Decl.Length);
2024Assert.Equal(3, x5Ref.Length);
2100Assert.Equal(2, x1Ref.Length);
2117Assert.Equal(2, x4Decl.Length);
2124Assert.Equal(2, x5Decl.Length);
2125Assert.Equal(3, x5Ref.Length);
2170Assert.Equal(2, x1Ref.Length);
2187Assert.Equal(2, x4Decl.Length);
2194Assert.Equal(2, x5Decl.Length);
2195Assert.Equal(3, x5Ref.Length);
2229Assert.Equal(1, x1Decl.Length);
2230Assert.Equal(1, x1Ref.Length);
2303Assert.Equal(2, x1Ref.Length);
2320Assert.Equal(2, x4Decl.Length);
2327Assert.Equal(2, x5Decl.Length);
2328Assert.Equal(3, x5Ref.Length);
2373Assert.Equal(2, x1Ref.Length);
2390Assert.Equal(2, x4Decl.Length);
2397Assert.Equal(2, x5Decl.Length);
2398Assert.Equal(3, x5Ref.Length);
2475Assert.Equal(2, x1Ref.Length);
2492Assert.Equal(2, x4Decl.Length);
2499Assert.Equal(2, x5Decl.Length);
2500Assert.Equal(3, x5Ref.Length);
2545Assert.Equal(2, x1Ref.Length);
2562Assert.Equal(2, x4Decl.Length);
2569Assert.Equal(2, x5Decl.Length);
2570Assert.Equal(3, x5Ref.Length);
2614Assert.Equal(1, x1Decl.Length);
2615Assert.Equal(1, x1Ref.Length);
2684Assert.Equal(2, x1Ref.Length);
2697Assert.Equal(2, x4Decl.Length);
2703Assert.Equal(2, x5Decl.Length);
2704Assert.Equal(3, x5Ref.Length);
2738Assert.Equal(2, x1Ref.Length);
2752Assert.Equal(2, x4Decl.Length);
2758Assert.Equal(2, x5Decl.Length);
2759Assert.Equal(3, x5Ref.Length);
2830Assert.Equal(2, x1Ref.Length);
2843Assert.Equal(2, x4Decl.Length);
2849Assert.Equal(2, x5Decl.Length);
2850Assert.Equal(3, x5Ref.Length);
2884Assert.Equal(2, x1Ref.Length);
2898Assert.Equal(2, x4Decl.Length);
2904Assert.Equal(2, x5Decl.Length);
2905Assert.Equal(3, x5Ref.Length);
2946Assert.Equal(2, x1Decl.Length);
2947Assert.Equal(3, x1Ref.Length);
2992Assert.Equal(2, x1Decl.Length);
2993Assert.Equal(3, x1Ref.Length);
3073Assert.Equal(2, x1Ref.Length);
3086Assert.Equal(2, x4Decl.Length);
3132Assert.Equal(2, x1Ref.Length);
3146Assert.Equal(2, x4Decl.Length);
3232Assert.Equal(2, x1Ref.Length);
3245Assert.Equal(2, x4Decl.Length);
3288Assert.Equal(2, x1Ref.Length);
3302Assert.Equal(2, x4Decl.Length);
3378Assert.Equal(2, x1Ref.Length);
3391Assert.Equal(2, x4Decl.Length);
3434Assert.Equal(2, x1Ref.Length);
3448Assert.Equal(2, x4Decl.Length);
3494Assert.Equal(2, x1Ref.Length);
3575Assert.Equal(2, x1Ref.Length);
3588Assert.Equal(2, x4Decl.Length);
3594Assert.Equal(2, x5Ref.Length);
3642Assert.Equal(2, x1Ref.Length);
3656Assert.Equal(2, x4Decl.Length);
3662Assert.Equal(2, x5Ref.Length);
3746Assert.Equal(2, x1Ref.Length);
3759Assert.Equal(2, x4Decl.Length);
3765Assert.Equal(2, x5Ref.Length);
3813Assert.Equal(2, x1Ref.Length);
3827Assert.Equal(2, x4Decl.Length);
3833Assert.Equal(2, x5Ref.Length);
3877Assert.Equal(2, x1Ref.Length);
3971Assert.Equal(2, x1Ref.Length);
3984Assert.Equal(2, x4Decl.Length);
3990Assert.Equal(1, x5Ref.Length);
3995Assert.Equal(1, x6Ref.Length);
4047Assert.Equal(2, x1Ref.Length);
4061Assert.Equal(2, x4Decl.Length);
4067Assert.Equal(1, x5Ref.Length);
4073Assert.Equal(1, x6Ref.Length);
4169Assert.Equal(2, x1Ref.Length);
4182Assert.Equal(2, x4Decl.Length);
4188Assert.Equal(1, x5Ref.Length);
4193Assert.Equal(1, x6Ref.Length);
4245Assert.Equal(2, x1Ref.Length);
4259Assert.Equal(2, x4Decl.Length);
4265Assert.Equal(1, x5Ref.Length);
4271Assert.Equal(1, x6Ref.Length);
4316Assert.Equal(2, x1Ref.Length);
4397Assert.Equal(2, x1Ref.Length);
4410Assert.Equal(2, x4Decl.Length);
4458Assert.Equal(2, x1Ref.Length);
4472Assert.Equal(2, x4Decl.Length);
4564Assert.Equal(2, x1Ref.Length);
4577Assert.Equal(2, x4Decl.Length);
4625Assert.Equal(2, x1Ref.Length);
4639Assert.Equal(2, x4Decl.Length);
4680Assert.Equal(2, x1Ref.Length);
4726Assert.Equal(4, x1Ref.Length);
4765Assert.Equal(2, x1Ref.Length);
4804Assert.Equal(2, x1Ref.Length);
4911Assert.Equal(2, x1Ref.Length);
4924Assert.Equal(2, x4Decl.Length);
4980Assert.Equal(2, x1Ref.Length);
4997Assert.Equal(2, x4Decl.Length);
5077Assert.Equal(2, x1Ref.Length);
5090Assert.Equal(2, x4Decl.Length);
5146Assert.Equal(2, x1Ref.Length);
5163Assert.Equal(2, x4Decl.Length);
5201Assert.Equal(2, x1Ref.Length);
5247Assert.Equal(4, x1Ref.Length);
5286Assert.Equal(2, x1Ref.Length);
5325Assert.Equal(2, x1Ref.Length);
5404Assert.Equal(2, x1Ref.Length);
5417Assert.Equal(2, x4Decl.Length);
5480Assert.Equal(2, x1Ref.Length);
5497Assert.Equal(2, x4Decl.Length);
5589Assert.Equal(2, x1Ref.Length);
5602Assert.Equal(2, x4Decl.Length);
5665Assert.Equal(2, x1Ref.Length);
5682Assert.Equal(2, x4Decl.Length);
5730Assert.Equal(2, x1Ref.Length);
5781Assert.Equal(4, x1Ref.Length);
5820Assert.Equal(2, x1Ref.Length);
5859Assert.Equal(2, x1Ref.Length);
5942Assert.Equal(2, x1Ref.Length);
5980Assert.Equal(2, x1Ref.Length);
6030Assert.Equal(2, x1Ref.Length);
6067Assert.Equal(2, x1Ref.Length);
6114Assert.Equal(2, x1Ref.Length);
6146Assert.Equal(2, x1Ref.Length);
6200Assert.Equal(2, x1Ref.Length);
6238Assert.Equal(2, x1Ref.Length);
6517Assert.Equal(2, x1Ref.Length);
6522Assert.Equal(3, x4Ref.Length);
6528Assert.Equal(2, x6Ref.Length);
6533Assert.Equal(2, x7Ref.Length);
6539Assert.Equal(3, x8Ref.Length);
6545Assert.Equal(2, x9Decl.Length);
6546Assert.Equal(4, x9Ref.Length);
6551Assert.Equal(2, y10Ref.Length);
6557Assert.Equal(2, x14Decl.Length);
6558Assert.Equal(2, x14Ref.Length);
6564Assert.Equal(2, x15Ref.Length);
6605Assert.Equal(2, x1Ref.Length);
6610Assert.Equal(3, x4Ref.Length);
6616Assert.Equal(2, x6Ref.Length);
6621Assert.Equal(2, x7Ref.Length);
6627Assert.Equal(3, x8Ref.Length);
6633Assert.Equal(2, x9Decl.Length);
6634Assert.Equal(4, x9Ref.Length);
6639Assert.Equal(2, y10Ref.Length);
6645Assert.Equal(2, x14Decl.Length);
6646Assert.Equal(2, x14Ref.Length);
6652Assert.Equal(2, x15Ref.Length);
6689Assert.Equal(2, x1Ref.Length);
6732Assert.Equal(1, x1Ref.Length);
6765Assert.Equal(1, x1Ref.Length);
6807Assert.Equal(2, x1Ref.Length);
6945Assert.Equal(2, x1Ref.Length);
6950Assert.Equal(2, x2Ref.Length);
6955Assert.Equal(3, x4Ref.Length);
6961Assert.Equal(2, x6Ref.Length);
6966Assert.Equal(2, x7Ref.Length);
6972Assert.Equal(3, x8Ref.Length);
6978Assert.Equal(2, x9Decl.Length);
6979Assert.Equal(4, x9Ref.Length);
6984Assert.Equal(2, y10Ref.Length);
6993Assert.Equal(2, x14Decl.Length);
6994Assert.Equal(2, x14Ref.Length);
7043Assert.Equal(2, x1Ref.Length);
7048Assert.Equal(2, x2Ref.Length);
7053Assert.Equal(3, x4Ref.Length);
7059Assert.Equal(2, x6Ref.Length);
7064Assert.Equal(2, x7Ref.Length);
7070Assert.Equal(3, x8Ref.Length);
7076Assert.Equal(2, x9Decl.Length);
7077Assert.Equal(4, x9Ref.Length);
7082Assert.Equal(2, y10Ref.Length);
7091Assert.Equal(2, x14Decl.Length);
7092Assert.Equal(2, x14Ref.Length);
7135Assert.Equal(2, x0Ref.Length);
7140Assert.Equal(2, x1Ref.Length);
7145Assert.Equal(2, x2Ref.Length);
7262Assert.Equal(2, x1Ref.Length);
7267Assert.Equal(2, x2Ref.Length);
7272Assert.Equal(3, x4Ref.Length);
7278Assert.Equal(2, x6Ref.Length);
7283Assert.Equal(2, x7Ref.Length);
7289Assert.Equal(3, x8Ref.Length);
7295Assert.Equal(2, x9Decl.Length);
7296Assert.Equal(4, x9Ref.Length);
7301Assert.Equal(2, y10Ref.Length);
7310Assert.Equal(2, x14Decl.Length);
7311Assert.Equal(2, x14Ref.Length);
7317Assert.Equal(2, x15Ref.Length);
7366Assert.Equal(2, x1Ref.Length);
7371Assert.Equal(2, x2Ref.Length);
7376Assert.Equal(3, x4Ref.Length);
7382Assert.Equal(2, x6Ref.Length);
7387Assert.Equal(2, x7Ref.Length);
7393Assert.Equal(3, x8Ref.Length);
7399Assert.Equal(2, x9Decl.Length);
7400Assert.Equal(4, x9Ref.Length);
7405Assert.Equal(2, y10Ref.Length);
7414Assert.Equal(2, x14Decl.Length);
7415Assert.Equal(2, x14Ref.Length);
7421Assert.Equal(2, x15Ref.Length);
7455Assert.Equal(2, x1Ref.Length);
7539Assert.Equal(2, x5Decl.Length);
7545Assert.Equal(2, x6Decl.Length);
7546Assert.Equal(2, x6Ref.Length);
7552Assert.Equal(5, x7Ref.Length);
7561Assert.Equal(2, x8Ref.Length);
7566Assert.Equal(2, x9Decl.Length);
7567Assert.Equal(2, x9Ref.Length);
7573Assert.Equal(2, x10Decl.Length);
7574Assert.Equal(2, x10Ref.Length);
7580Assert.Equal(3, x11Ref.Length);
7587Assert.Equal(3, x12Ref.Length);
7633Assert.Equal(2, x5Decl.Length);
7639Assert.Equal(2, x6Decl.Length);
7640Assert.Equal(2, x6Ref.Length);
7646Assert.Equal(5, x7Ref.Length);
7655Assert.Equal(2, x8Ref.Length);
7660Assert.Equal(2, x9Decl.Length);
7661Assert.Equal(2, x9Ref.Length);
7667Assert.Equal(2, x10Decl.Length);
7668Assert.Equal(2, x10Ref.Length);
7674Assert.Equal(3, x11Ref.Length);
7681Assert.Equal(3, x12Ref.Length);
7933Assert.Equal(4, y1Ref.Length);
7938Assert.Equal(3, y2Ref.Length);
7943Assert.Equal(4, z2Ref.Length);
7950Assert.Equal(3, y3Ref.Length);
7955Assert.Equal(3, z3Ref.Length);
7962Assert.Equal(5, y4Ref.Length);
7967Assert.Equal(6, z4Ref.Length);
7972Assert.Equal(4, u4Ref.Length);
7980Assert.Equal(4, v4Ref.Length);
7988Assert.Equal(5, y5Ref.Length);
7993Assert.Equal(6, z5Ref.Length);
7998Assert.Equal(4, u5Ref.Length);
8006Assert.Equal(4, v5Ref.Length);
8014Assert.Equal(3, y6Ref.Length);
8019Assert.Equal(3, z6Ref.Length);
8026Assert.Equal(4, y7Ref.Length);
8031Assert.Equal(4, z7Ref.Length);
8039Assert.Equal(4, u7Ref.Length);
8047Assert.Equal(2, y8Ref.Length);
8052Assert.Equal(2, z8Ref.Length);
8058Assert.Equal(3, y9Ref.Length);
8063Assert.Equal(3, z9Ref.Length);
8070Assert.Equal(3, u9Ref.Length);
8077Assert.Equal(2, y10Ref.Length);
8083Assert.Equal(2, y11Ref.Length);
8192Assert.Equal(4, y1Ref.Length);
8197Assert.Equal(3, y2Ref.Length);
8202Assert.Equal(4, z2Ref.Length);
8209Assert.Equal(3, y3Ref.Length);
8214Assert.Equal(3, z3Ref.Length);
8221Assert.Equal(5, y4Ref.Length);
8226Assert.Equal(6, z4Ref.Length);
8231Assert.Equal(4, u4Ref.Length);
8239Assert.Equal(4, v4Ref.Length);
8247Assert.Equal(5, y5Ref.Length);
8252Assert.Equal(6, z5Ref.Length);
8257Assert.Equal(4, u5Ref.Length);
8265Assert.Equal(4, v5Ref.Length);
8273Assert.Equal(3, y6Ref.Length);
8278Assert.Equal(3, z6Ref.Length);
8285Assert.Equal(4, y7Ref.Length);
8290Assert.Equal(4, z7Ref.Length);
8298Assert.Equal(4, u7Ref.Length);
8306Assert.Equal(2, y8Ref.Length);
8311Assert.Equal(2, z8Ref.Length);
8317Assert.Equal(3, y9Ref.Length);
8322Assert.Equal(3, z9Ref.Length);
8329Assert.Equal(3, u9Ref.Length);
8336Assert.Equal(2, y10Ref.Length);
8342Assert.Equal(2, y11Ref.Length);
8484Assert.Equal(2, x1Ref.Length);
8489Assert.Equal(2, x2Ref.Length);
8494Assert.Equal(3, x4Ref.Length);
8500Assert.Equal(2, x6Ref.Length);
8505Assert.Equal(2, x7Ref.Length);
8511Assert.Equal(3, x8Ref.Length);
8517Assert.Equal(2, x9Decl.Length);
8518Assert.Equal(4, x9Ref.Length);
8527Assert.Equal(2, y10Ref.Length);
8536Assert.Equal(2, x14Decl.Length);
8537Assert.Equal(2, x14Ref.Length);
8583Assert.Equal(2, x1Ref.Length);
8588Assert.Equal(2, x2Ref.Length);
8593Assert.Equal(3, x4Ref.Length);
8599Assert.Equal(2, x6Ref.Length);
8604Assert.Equal(2, x7Ref.Length);
8610Assert.Equal(3, x8Ref.Length);
8616Assert.Equal(2, x9Decl.Length);
8617Assert.Equal(4, x9Ref.Length);
8626Assert.Equal(2, y10Ref.Length);
8635Assert.Equal(2, x14Decl.Length);
8636Assert.Equal(2, x14Ref.Length);
Semantics\PatternMatchingTests_Scope.cs (554)
207Assert.Equal(3, x1Decl.Length);
208Assert.Equal(3, x1Ref.Length);
223Assert.Equal(2, x4Ref.Length);
230Assert.Equal(2, x5Ref.Length);
235Assert.Equal(2, x8Decl.Length);
236Assert.Equal(2, x8Ref.Length);
237for (int i = 0; i < x8Decl.Length; i++)
253Assert.Equal(2, x11Ref.Length);
258Assert.Equal(2, x12Ref.Length);
288Assert.Equal(1, x1Decl.Length);
289Assert.Equal(1, x1Ref.Length);
334Assert.Equal(2, x1Decl.Length);
335Assert.Equal(2, x1Ref.Length);
416Assert.Equal(1, x1Ref.Length);
592Assert.Equal(3, x1Decl.Length);
593Assert.Equal(3, x1Ref.Length);
608Assert.Equal(2, x4Ref.Length);
615Assert.Equal(2, x5Ref.Length);
620Assert.Equal(2, x8Decl.Length);
621Assert.Equal(2, x8Ref.Length);
635Assert.Equal(2, x11Ref.Length);
640Assert.Equal(2, x12Ref.Length);
721Assert.Equal(1, x1Ref.Length);
862Assert.Equal(3, x1Decl.Length);
863Assert.Equal(3, x1Ref.Length);
878Assert.Equal(2, x4Ref.Length);
885Assert.Equal(2, x5Ref.Length);
890Assert.Equal(2, x8Decl.Length);
891Assert.Equal(2, x8Ref.Length);
905Assert.Equal(2, x11Ref.Length);
910Assert.Equal(2, x12Ref.Length);
990Assert.Equal(1, x1Ref.Length);
1160Assert.Equal(2, x1Ref.Length);
1165Assert.Equal(2, x2Ref.Length);
1170Assert.Equal(2, x3Ref.Length);
1176Assert.Equal(2, x4Ref.Length);
1187Assert.Equal(2, x6Ref.Length);
1192Assert.Equal(2, x7Ref.Length);
1198Assert.Equal(2, x8Ref.Length);
1203Assert.Equal(2, x9Decl.Length);
1204Assert.Equal(2, x9Ref.Length);
1209Assert.Equal(2, y10Ref.Length);
1294Assert.Equal(1, x1Ref.Length);
1531Assert.Equal(2, x5Decl.Length);
1537Assert.Equal(2, x6Decl.Length);
1538Assert.Equal(2, x6Ref.Length);
1544Assert.Equal(5, x7Ref.Length);
1553Assert.Equal(2, x8Ref.Length);
1558Assert.Equal(2, x9Decl.Length);
1559Assert.Equal(2, x9Ref.Length);
1565Assert.Equal(2, x10Decl.Length);
1566Assert.Equal(2, x10Ref.Length);
1572Assert.Equal(3, x11Ref.Length);
1579Assert.Equal(3, x12Ref.Length);
1823Assert.Equal(4, y1Ref.Length);
1828Assert.Equal(3, y2Ref.Length);
1833Assert.Equal(4, z2Ref.Length);
1840Assert.Equal(3, y3Ref.Length);
1845Assert.Equal(3, z3Ref.Length);
1852Assert.Equal(5, y4Ref.Length);
1857Assert.Equal(6, z4Ref.Length);
1862Assert.Equal(4, u4Ref.Length);
1870Assert.Equal(4, v4Ref.Length);
1878Assert.Equal(5, y5Ref.Length);
1883Assert.Equal(6, z5Ref.Length);
1888Assert.Equal(4, u5Ref.Length);
1896Assert.Equal(4, v5Ref.Length);
1904Assert.Equal(3, y6Ref.Length);
1909Assert.Equal(3, z6Ref.Length);
1916Assert.Equal(4, y7Ref.Length);
1921Assert.Equal(4, z7Ref.Length);
1929Assert.Equal(4, u7Ref.Length);
1937Assert.Equal(2, y8Ref.Length);
1942Assert.Equal(2, z8Ref.Length);
1948Assert.Equal(3, y9Ref.Length);
1953Assert.Equal(3, z9Ref.Length);
1960Assert.Equal(3, u9Ref.Length);
1967Assert.Equal(2, y10Ref.Length);
1973Assert.Equal(2, y11Ref.Length);
2074Assert.Equal(5, y4Ref.Length);
2079Assert.Equal(6, z4Ref.Length);
2084Assert.Equal(4, u4Ref.Length);
2092Assert.Equal(4, v4Ref.Length);
2100Assert.Equal(5, y5Ref.Length);
2105Assert.Equal(6, z5Ref.Length);
2110Assert.Equal(4, u5Ref.Length);
2118Assert.Equal(4, v5Ref.Length);
2223Assert.Equal(3, yRef.Length);
2359Assert.Equal(2, yDecl.Length);
2360Assert.Equal(2, yRef.Length);
2422Assert.Equal(2, yDecl.Length);
2423Assert.Equal(2, yRef.Length);
2713Assert.Equal(i == 10 ? 1 : 2, yRef.Length);
2792Assert.Equal(2, y1Decl.Length);
2797Assert.Equal(2, y2Decl.Length);
2997Assert.Equal(2, x5Decl.Length);
3003Assert.Equal(2, x6Decl.Length);
3004Assert.Equal(2, x6Ref.Length);
3010Assert.Equal(3, x7Ref.Length);
3017Assert.Equal(2, x11Ref.Length);
3023Assert.Equal(2, x12Ref.Length);
3166Assert.Equal(2, x5Decl.Length);
3172Assert.Equal(2, x6Decl.Length);
3173Assert.Equal(2, x6Ref.Length);
3179Assert.Equal(3, x7Ref.Length);
3281Assert.Equal(2, x5Decl.Length);
3287Assert.Equal(2, x6Decl.Length);
3288Assert.Equal(2, x6Ref.Length);
3294Assert.Equal(3, x7Ref.Length);
3370Assert.Equal(2, x5Decl.Length);
3376Assert.Equal(2, x6Decl.Length);
3377Assert.Equal(2, x6Ref.Length);
3383Assert.Equal(3, x7Ref.Length);
3458Assert.Equal(2, x5Decl.Length);
3464Assert.Equal(2, x6Decl.Length);
3465Assert.Equal(2, x6Ref.Length);
3471Assert.Equal(2, x7Ref.Length);
3545Assert.Equal(2, x5Decl.Length);
3551Assert.Equal(2, x6Decl.Length);
3552Assert.Equal(2, x6Ref.Length);
3558Assert.Equal(3, x7Ref.Length);
3621Assert.Equal(2, x5Decl.Length);
3627Assert.Equal(2, x6Decl.Length);
3628Assert.Equal(2, x6Ref.Length);
3634Assert.Equal(3, x7Ref.Length);
3718Assert.Equal(2, x5Decl.Length);
3724Assert.Equal(2, x6Decl.Length);
3725Assert.Equal(2, x6Ref.Length);
3731Assert.Equal(3, x7Ref.Length);
3809Assert.Equal(2, x5Decl.Length);
3815Assert.Equal(2, x6Decl.Length);
3816Assert.Equal(2, x6Ref.Length);
3822Assert.Equal(3, x7Ref.Length);
3899Assert.Equal(2, x5Decl.Length);
3905Assert.Equal(2, x6Decl.Length);
3906Assert.Equal(2, x6Ref.Length);
3912Assert.Equal(3, x7Ref.Length);
3991Assert.Equal(2, x5Decl.Length);
3997Assert.Equal(2, x6Decl.Length);
3998Assert.Equal(2, x6Ref.Length);
4004Assert.Equal(3, x7Ref.Length);
4087Assert.Equal(2, x5Decl.Length);
4093Assert.Equal(2, x6Decl.Length);
4094Assert.Equal(2, x6Ref.Length);
4100Assert.Equal(3, x7Ref.Length);
4233Assert.Equal(2, x5Decl.Length);
4507Assert.Equal(3, x1Decl.Length);
4508Assert.Equal(6, x1Ref.Length);
4509for (int i = 0; i < x1Decl.Length; i++)
4516Assert.Equal(2, x2Ref.Length);
4521Assert.Equal(2, x3Ref.Length);
4526Assert.Equal(4, x4Ref.Length);
4533Assert.Equal(3, x5Ref.Length);
4539Assert.Equal(2, x8Decl.Length);
4540Assert.Equal(3, x8Ref.Length);
4541for (int i = 0; i < x8Ref.Length; i++)
4549Assert.Equal(6, x9Ref.Length);
4558Assert.Equal(5, x11Ref.Length);
4566Assert.Equal(5, x12Ref.Length);
4574Assert.Equal(2, x13Decl.Length);
4575Assert.Equal(5, x13Ref.Length);
4581Assert.Equal(2, x14Decl.Length);
4582Assert.Equal(4, x14Ref.Length);
4588Assert.Equal(2, x15Decl.Length);
4589Assert.Equal(3, x15Ref.Length);
4590for (int i = 0; i < x15Ref.Length; i++)
4907Assert.Equal(3, x1Decl.Length);
4908Assert.Equal(6, x1Ref.Length);
4909for (int i = 0; i < x1Decl.Length; i++)
4916Assert.Equal(2, x2Ref.Length);
4921Assert.Equal(2, x3Ref.Length);
4926Assert.Equal(4, x4Ref.Length);
4933Assert.Equal(3, x5Ref.Length);
4939Assert.Equal(2, x8Decl.Length);
4940Assert.Equal(3, x8Ref.Length);
4941for (int i = 0; i < x8Ref.Length; i++)
4949Assert.Equal(6, x9Ref.Length);
4958Assert.Equal(5, x11Ref.Length);
4966Assert.Equal(5, x12Ref.Length);
4974Assert.Equal(2, x13Decl.Length);
4975Assert.Equal(5, x13Ref.Length);
4981Assert.Equal(2, x14Decl.Length);
4982Assert.Equal(4, x14Ref.Length);
4988Assert.Equal(2, x15Decl.Length);
4989Assert.Equal(3, x15Ref.Length);
4990for (int i = 0; i < x15Ref.Length; i++)
4998Assert.Equal(2, x16Decl.Length);
4999Assert.Equal(3, x16Ref.Length);
5000for (int i = 0; i < x16Ref.Length; i++)
5008Assert.Equal(2, x17Decl.Length);
5009Assert.Equal(3, x17Ref.Length);
5010for (int i = 0; i < x17Ref.Length; i++)
5216Assert.Equal(3, x1Ref.Length);
5221Assert.Equal(3, x4Ref.Length);
5229Assert.Equal(2, x5Ref.Length);
5234Assert.Equal(3, x6Ref.Length);
5239Assert.Equal(2, x7Ref.Length);
5245Assert.Equal(2, x9Decl.Length);
5246Assert.Equal(4, x9Ref.Length);
5251Assert.Equal(4, y10Ref.Length);
5259Assert.Equal(2, x14Decl.Length);
5260Assert.Equal(2, x14Ref.Length);
5265Assert.Equal(3, y15Ref.Length);
5350Assert.Equal(1, x1Ref.Length);
5504Assert.Equal(2, x1Ref.Length);
5509Assert.Equal(2, x2Ref.Length);
5514Assert.Equal(3, x4Ref.Length);
5520Assert.Equal(2, x6Ref.Length);
5525Assert.Equal(2, x7Ref.Length);
5531Assert.Equal(3, x8Ref.Length);
5537Assert.Equal(2, x9Decl.Length);
5538Assert.Equal(4, x9Ref.Length);
5547Assert.Equal(2, y10Ref.Length);
5556Assert.Equal(2, x14Decl.Length);
5557Assert.Equal(2, x14Ref.Length);
5711Assert.Equal(2, x1Ref.Length);
5716Assert.Equal(2, x2Ref.Length);
5721Assert.Equal(3, x4Ref.Length);
5727Assert.Equal(2, x6Ref.Length);
5732Assert.Equal(2, x7Ref.Length);
5738Assert.Equal(3, x8Ref.Length);
5744Assert.Equal(2, x9Decl.Length);
5745Assert.Equal(4, x9Ref.Length);
5754Assert.Equal(2, y10Ref.Length);
5763Assert.Equal(2, x14Decl.Length);
5764Assert.Equal(2, x14Ref.Length);
5918Assert.Equal(2, x1Ref.Length);
5923Assert.Equal(2, x2Ref.Length);
5928Assert.Equal(3, x4Ref.Length);
5934Assert.Equal(2, x6Ref.Length);
5939Assert.Equal(2, x7Ref.Length);
5945Assert.Equal(3, x8Ref.Length);
5951Assert.Equal(2, x9Decl.Length);
5952Assert.Equal(4, x9Ref.Length);
5961Assert.Equal(2, y10Ref.Length);
5970Assert.Equal(2, x14Decl.Length);
5971Assert.Equal(2, x14Ref.Length);
6027Assert.Equal(2, x1Ref.Length);
6034Assert.Equal(2, x2Ref.Length);
6108Assert.Equal(3, x1Ref.Length);
6113Assert.Equal(2, x2Decl.Length);
6114Assert.Equal(3, x2Ref.Length);
6120Assert.Equal(3, x3Ref.Length);
6125Assert.Equal(3, x4Ref.Length);
6195Assert.Equal(2, x4Ref.Length);
6206Assert.Equal(2, x8Ref.Length);
6211Assert.Equal(2, x14Decl.Length);
6282Assert.Equal(2, x4Ref.Length);
6293Assert.Equal(2, x8Ref.Length);
6298Assert.Equal(2, x14Decl.Length);
6352Assert.Equal(2, x1Ref.Length);
6359Assert.Equal(2, x2Ref.Length);
6422Assert.Equal(3, x1Ref.Length);
6427Assert.Equal(2, x2Decl.Length);
6428Assert.Equal(2, x2Ref.Length);
6434Assert.Equal(2, x3Ref.Length);
6439Assert.Equal(2, x4Ref.Length);
6480Assert.Equal(1, x1Ref.Length);
6596Assert.Equal(2, x4Ref.Length);
6607Assert.Equal(2, x8Ref.Length);
6612Assert.Equal(2, x14Decl.Length);
6685Assert.Equal(2, x4Ref.Length);
6696Assert.Equal(2, x8Ref.Length);
6701Assert.Equal(2, x14Decl.Length);
6757Assert.Equal(2, x1Ref.Length);
6764Assert.Equal(2, x2Ref.Length);
6832Assert.Equal(3, x1Ref.Length);
6840Assert.Equal(2, x2Decl.Length);
6841Assert.Equal(2, x2Ref.Length);
6847Assert.Equal(2, x3Ref.Length);
6852Assert.Equal(2, x4Ref.Length);
6891Assert.Equal(1, x1Ref.Length);
6932Assert.Equal(2, x1Ref.Length);
7089Assert.Equal(2, x1Ref.Length);
7094Assert.Equal(2, x2Ref.Length);
7099Assert.Equal(3, x4Ref.Length);
7105Assert.Equal(2, x6Ref.Length);
7110Assert.Equal(2, x7Ref.Length);
7116Assert.Equal(3, x8Ref.Length);
7122Assert.Equal(2, x9Decl.Length);
7123Assert.Equal(4, x9Ref.Length);
7128Assert.Equal(2, y10Ref.Length);
7137Assert.Equal(2, x14Decl.Length);
7138Assert.Equal(2, x14Ref.Length);
7220Assert.Equal(1, x1Ref.Length);
7411Assert.Equal(2, x1Ref.Length);
7416Assert.Equal(2, x2Ref.Length);
7421Assert.Equal(3, x4Ref.Length);
7427Assert.Equal(2, x6Ref.Length);
7432Assert.Equal(2, x7Ref.Length);
7438Assert.Equal(3, x8Ref.Length);
7444Assert.Equal(2, x9Decl.Length);
7445Assert.Equal(4, x9Ref.Length);
7450Assert.Equal(2, y10Ref.Length);
7459Assert.Equal(2, x14Decl.Length);
7460Assert.Equal(2, x14Ref.Length);
7543Assert.Equal(1, x1Ref.Length);
7726Assert.Equal(2, x1Ref.Length);
7731Assert.Equal(2, x2Ref.Length);
7736Assert.Equal(3, x4Ref.Length);
7742Assert.Equal(2, x6Ref.Length);
7747Assert.Equal(2, x7Ref.Length);
7753Assert.Equal(3, x8Ref.Length);
7759Assert.Equal(2, x9Decl.Length);
7760Assert.Equal(4, x9Ref.Length);
7765Assert.Equal(2, y10Ref.Length);
7774Assert.Equal(2, x14Decl.Length);
7775Assert.Equal(2, x14Ref.Length);
7955Assert.Equal(2, x1Ref.Length);
7960Assert.Equal(2, x2Ref.Length);
7965Assert.Equal(3, x4Ref.Length);
7971Assert.Equal(2, x6Ref.Length);
7976Assert.Equal(2, x7Ref.Length);
7982Assert.Equal(3, x8Ref.Length);
7988Assert.Equal(2, x9Decl.Length);
7989Assert.Equal(4, x9Ref.Length);
7994Assert.Equal(2, y10Ref.Length);
8003Assert.Equal(2, x14Decl.Length);
8004Assert.Equal(2, x14Ref.Length);
8205Assert.Equal(2, x1Ref.Length);
8211Assert.Equal(2, x2Ref.Length);
8217Assert.Equal(3, x4Ref.Length);
8224Assert.Equal(2, x6Ref.Length);
8230Assert.Equal(2, x7Ref.Length);
8236Assert.Equal(3, x8Ref.Length);
8243Assert.Equal(2, x9Decl.Length);
8244Assert.Equal(4, x9Ref.Length);
8251Assert.Equal(2, y10Ref.Length);
8260Assert.Equal(2, x14Decl.Length);
8261Assert.Equal(2, x14Ref.Length);
8445Assert.Equal(2, x1Ref.Length);
8450Assert.Equal(2, x2Ref.Length);
8455Assert.Equal(3, x4Ref.Length);
8461Assert.Equal(2, x6Ref.Length);
8466Assert.Equal(2, x7Ref.Length);
8472Assert.Equal(3, x8Ref.Length);
8478Assert.Equal(2, x9Decl.Length);
8479Assert.Equal(4, x9Ref.Length);
8484Assert.Equal(2, y10Ref.Length);
8493Assert.Equal(2, x14Decl.Length);
8494Assert.Equal(2, x14Ref.Length);
8677Assert.Equal(2, x1Ref.Length);
8682Assert.Equal(2, x2Ref.Length);
8687Assert.Equal(3, x4Ref.Length);
8693Assert.Equal(2, x6Ref.Length);
8698Assert.Equal(2, x7Ref.Length);
8704Assert.Equal(3, x8Ref.Length);
8710Assert.Equal(2, x9Decl.Length);
8711Assert.Equal(4, x9Ref.Length);
8716Assert.Equal(2, y10Ref.Length);
8725Assert.Equal(2, x14Decl.Length);
8726Assert.Equal(2, x14Ref.Length);
9024Assert.Equal(4, x8Decl.Length);
9025Assert.Equal(4, x8Ref.Length);
9033Assert.Equal(3, x9Decl.Length);
9034Assert.Equal(4, x9Ref.Length);
9041Assert.Equal(3, x10Decl.Length);
9042Assert.Equal(4, x10Ref.Length);
9050Assert.Equal(3, x11Decl.Length);
9051Assert.Equal(4, x11Ref.Length);
9059Assert.Equal(2, x12Decl.Length);
9060Assert.Equal(4, x12Ref.Length);
9067Assert.Equal(2, x13Decl.Length);
9068Assert.Equal(4, x13Ref.Length);
9076Assert.Equal(2, x14Decl.Length);
9077Assert.Equal(4, x14Ref.Length);
9085Assert.Equal(4, x15Ref.Length);
9136Assert.Equal(2, x1Ref.Length);
9141Assert.Equal(2, x2Decl.Length);
9142Assert.Equal(2, x2Ref.Length);
9308Assert.Equal(2, x1Ref.Length);
9313Assert.Equal(2, x2Ref.Length);
9318Assert.Equal(3, x4Ref.Length);
9324Assert.Equal(2, x6Ref.Length);
9329Assert.Equal(2, x7Ref.Length);
9335Assert.Equal(3, x8Ref.Length);
9341Assert.Equal(2, x9Decl.Length);
9342Assert.Equal(4, x9Ref.Length);
9347Assert.Equal(2, y10Ref.Length);
9356Assert.Equal(2, x14Decl.Length);
9357Assert.Equal(2, x14Ref.Length);
9363Assert.Equal(2, x15Ref.Length);
9517Assert.Equal(2, x1Ref.Length);
9522Assert.Equal(2, x2Ref.Length);
9527Assert.Equal(3, x4Ref.Length);
9535Assert.Equal(2, x6Ref.Length);
9540Assert.Equal(2, x7Ref.Length);
9546Assert.Equal(3, x8Ref.Length);
9551Assert.Equal(2, x9Decl.Length);
9552Assert.Equal(4, x9Ref.Length);
9557Assert.Equal(2, y10Ref.Length);
9566Assert.Equal(2, x14Decl.Length);
9567Assert.Equal(2, x14Ref.Length);
9649Assert.Equal(1, x1Ref.Length);
9803Assert.Equal(2, x1Ref.Length);
9808Assert.Equal(2, x2Ref.Length);
9813Assert.Equal(3, x4Ref.Length);
9819Assert.Equal(2, x6Ref.Length);
9824Assert.Equal(2, x7Ref.Length);
9830Assert.Equal(3, x8Ref.Length);
9836Assert.Equal(2, x9Decl.Length);
9837Assert.Equal(4, x9Ref.Length);
9842Assert.Equal(2, y10Ref.Length);
9851Assert.Equal(2, x14Decl.Length);
9852Assert.Equal(2, x14Ref.Length);
9932Assert.Equal(2, x1Ref.Length);
9939Assert.Equal(2, x2Ref.Length);
9944Assert.Equal(2, x3Ref.Length);
9951Assert.Equal(2, x4Decl.Length);
9952Assert.Equal(3, x4Ref.Length);
10080Assert.Equal(3, x1Decl.Length);
10081Assert.Equal(3, x1Ref.Length);
10096Assert.Equal(2, x4Ref.Length);
10103Assert.Equal(2, x5Ref.Length);
10108Assert.Equal(2, x8Decl.Length);
10109Assert.Equal(2, x8Ref.Length);
10110for (int i = 0; i < x8Decl.Length; i++)
10122Assert.Equal(2, x11Ref.Length);
10127Assert.Equal(2, x12Ref.Length);
10212Assert.Equal(1, x1Ref.Length);
10370Assert.Equal(2, x1Ref.Length);
10375Assert.Equal(3, x4Ref.Length);
10381Assert.Equal(2, x6Ref.Length);
10386Assert.Equal(2, x7Ref.Length);
10392Assert.Equal(3, x8Ref.Length);
10398Assert.Equal(2, x9Decl.Length);
10399Assert.Equal(4, x9Ref.Length);
10404Assert.Equal(2, y10Ref.Length);
10410Assert.Equal(2, x14Decl.Length);
10411Assert.Equal(2, x14Ref.Length);
10417Assert.Equal(2, x15Ref.Length);
10591Assert.Equal(3, x1Decl.Length);
10592Assert.Equal(3, x1Ref.Length);
10607Assert.Equal(2, x4Ref.Length);
10614Assert.Equal(2, x5Ref.Length);
10619Assert.Equal(2, x8Decl.Length);
10620Assert.Equal(2, x8Ref.Length);
10621for (int i = 0; i < x8Decl.Length; i++)
10637Assert.Equal(2, x11Ref.Length);
10642Assert.Equal(2, x12Ref.Length);
10728Assert.Equal(1, x1Ref.Length);
11004Assert.Equal(3, x1Decl.Length);
11005Assert.Equal(6, x1Ref.Length);
11006for (int i = 0; i < x1Decl.Length; i++)
11013Assert.Equal(2, x2Ref.Length);
11018Assert.Equal(2, x3Ref.Length);
11023Assert.Equal(4, x4Ref.Length);
11030Assert.Equal(3, x5Ref.Length);
11036Assert.Equal(2, x8Decl.Length);
11037Assert.Equal(3, x8Ref.Length);
11038for (int i = 0; i < x8Ref.Length; i++)
11046Assert.Equal(6, x9Ref.Length);
11055Assert.Equal(5, x11Ref.Length);
11063Assert.Equal(5, x12Ref.Length);
11071Assert.Equal(2, x13Decl.Length);
11072Assert.Equal(5, x13Ref.Length);
11078Assert.Equal(2, x14Decl.Length);
11079Assert.Equal(4, x14Ref.Length);
11085Assert.Equal(2, x15Decl.Length);
11086Assert.Equal(3, x15Ref.Length);
11087for (int i = 0; i < x15Ref.Length; i++)
11814Assert.Equal(2, x4Ref.Length);
11827Assert.Equal(2, x8Ref.Length);
11833Assert.Equal(2, x14Decl.Length);
11906Assert.Equal(2, x1Ref.Length);
11914Assert.Equal(2, x2Ref.Length);
11922Assert.Equal(2, x2Ref.Length);
11995Assert.Equal(3, x1Ref.Length);
12001Assert.Equal(2, x2Decl.Length);
12002Assert.Equal(2, x2Ref.Length);
12009Assert.Equal(2, x3Ref.Length);
12015Assert.Equal(2, x4Ref.Length);
12093Assert.Equal(3, x1Ref.Length);
12099Assert.Equal(2, x2Decl.Length);
12100Assert.Equal(2, x2Ref.Length);
12107Assert.Equal(2, x3Ref.Length);
12113Assert.Equal(2, x4Ref.Length);
12153Assert.Equal(1, x1Ref.Length);
12206Assert.Equal(2, x1Ref.Length);
12445Assert.Equal(2, x1Ref.Length);
12451Assert.Equal(2, x2Ref.Length);
12457Assert.Equal(3, x4Ref.Length);
12464Assert.Equal(2, x6Ref.Length);
12470Assert.Equal(2, x7Ref.Length);
12477Assert.Equal(3, x8Ref.Length);
12484Assert.Equal(2, x9Decl.Length);
12485Assert.Equal(4, x9Ref.Length);
12491Assert.Equal(2, y10Ref.Length);
12500Assert.Equal(2, x14Decl.Length);
12501Assert.Equal(2, x14Ref.Length);
12610Assert.Equal(4, x8Decl.Length);
12611Assert.Equal(4, x8Ref.Length);
12621Assert.Equal(3, x9Decl.Length);
12622Assert.Equal(4, x9Ref.Length);
12788Assert.Equal(2, x1Ref.Length);
12794Assert.Equal(2, x2Ref.Length);
12800Assert.Equal(3, x4Ref.Length);
12807Assert.Equal(2, x6Ref.Length);
12813Assert.Equal(2, x7Ref.Length);
12820Assert.Equal(3, x8Ref.Length);
12827Assert.Equal(2, x9Decl.Length);
12828Assert.Equal(4, x9Ref.Length);
12839Assert.Equal(2, y10Ref.Length);
12848Assert.Equal(2, x14Decl.Length);
12849Assert.Equal(2, x14Ref.Length);
12909Assert.Equal(2, x1Ref.Length);
12918Assert.Equal(2, x2Ref.Length);
13001Assert.Equal(3, x1Ref.Length);
13007Assert.Equal(2, x2Decl.Length);
13008Assert.Equal(3, x2Ref.Length);
13015Assert.Equal(3, x3Ref.Length);
13021Assert.Equal(3, x4Ref.Length);
13183Assert.Equal(2, x1Ref.Length);
13189Assert.Equal(2, x2Ref.Length);
13195Assert.Equal(3, x4Ref.Length);
13202Assert.Equal(2, x6Ref.Length);
13208Assert.Equal(2, x7Ref.Length);
13215Assert.Equal(3, x8Ref.Length);
13222Assert.Equal(2, x9Decl.Length);
13223Assert.Equal(4, x9Ref.Length);
13229Assert.Equal(2, y10Ref.Length);
13238Assert.Equal(2, x14Decl.Length);
13239Assert.Equal(2, x14Ref.Length);
13326Assert.Equal(2, x1Ref.Length);
13334Assert.Equal(2, x2Ref.Length);
13340Assert.Equal(2, x3Ref.Length);
13348Assert.Equal(2, x4Decl.Length);
13349Assert.Equal(3, x4Ref.Length);
13410Assert.Equal(2, x5Decl.Length);
13417Assert.Equal(2, x6Decl.Length);
13418Assert.Equal(2, x6Ref.Length);
13425Assert.Equal(3, x7Ref.Length);
13498Assert.Equal(2, x5Decl.Length);
13505Assert.Equal(2, x6Decl.Length);
13506Assert.Equal(2, x6Ref.Length);
13513Assert.Equal(3, x7Ref.Length);
13575Assert.Equal(2, x5Decl.Length);
13582Assert.Equal(2, x6Decl.Length);
13583Assert.Equal(2, x6Ref.Length);
13590Assert.Equal(3, x7Ref.Length);
13654Assert.Equal(2, x5Decl.Length);
13661Assert.Equal(2, x6Decl.Length);
13662Assert.Equal(2, x6Ref.Length);
13669Assert.Equal(3, x7Ref.Length);
13973Assert.Equal(3, x1Decl.Length);
13974Assert.Equal(3, x1Ref.Length);
13989Assert.Equal(2, x4Ref.Length);
13996Assert.Equal(2, x5Ref.Length);
14001Assert.Equal(2, x6Decl.Length);
14002Assert.Equal(2, x6Ref.Length);
14003for (int i = 0; i < x6Decl.Length; i++)
14019Assert.Equal(2, x9Ref.Length);
14024Assert.Equal(2, x10Ref.Length);
14030Assert.Equal(2, x11Ref.Length);
Semantics\PatternMatchingTests3.cs (15)
50Assert.Equal(2, subpatterns.Length);
110Assert.Equal(2, subpatterns.Length);
161Assert.Equal(2, subpatterns.Length);
206Assert.Equal(2, subpatterns.Length);
257Assert.Equal(2, subpatterns.Length);
300Assert.Equal(2, subpatterns.Length);
347Assert.Equal(2, subpatterns.Length);
1890Assert.Equal(3, strDecl.Length);
1894Assert.Equal(3, arrDecl.Length);
1939Assert.Equal(1, x1Decl.Length);
1940Assert.Equal(1, x1Ref.Length);
1945Assert.Equal(1, x2Decl.Length);
1946Assert.Equal(1, x2Ref.Length);
4108Assert.Equal(31, patterns.Length);
4335Assert.Equal(31, patterns.Length);
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (10)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (7)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (174)
Semantics\FunctionPointerTests.cs (11)
979Assert.Equal(3, variableDeclaratorSyntaxes.Length);
1047Assert.Equal(2, decls.Length);
1127Assert.Equal(8, decls.Length);
1272Assert.Equal(3, decls.Length);
1367Assert.Equal(8, decls.Length);
1508Assert.Equal(2, decls.Length);
1565Assert.Equal(2, decls.Length);
3377Assert.Equal(2, isPatterns.Length);
3529Assert.Equal(4, binaryExpressions.Length);
3682Assert.Equal(4, paramTypes.Length);
3955Assert.Equal(2, parameterDecls.Length);
Semantics\GlobalUsingDirectiveTests.cs (35)
3843Assert.Equal(2, ext.Length);
3845Assert.Equal(4, aliases.Length);
3869Assert.Equal(2, ext.Length);
3871Assert.Equal(3, aliases.Length);
3891Assert.Equal(1, aliases.Length);
3900Assert.Equal(2, ext.Length);
3902Assert.Equal(2, aliases.Length);
3919Assert.Equal(2, aliases.Length);
3933Assert.Equal(2, ext.Length);
3935Assert.Equal(2, aliases.Length);
3953Assert.Equal(2, ext.Length);
3955Assert.Equal(1, aliases.Length);
3969Assert.Equal(1, aliases.Length);
3978Assert.Equal(2, ext.Length);
3980Assert.Equal(0, aliases.Length);
3991Assert.Equal(2, aliases.Length);
4005Assert.Equal(0, ext.Length);
4007Assert.Equal(4, aliases.Length);
4025Assert.Equal(0, ext.Length);
4027Assert.Equal(3, aliases.Length);
4041Assert.Equal(1, aliases.Length);
4050Assert.Equal(0, ext.Length);
4052Assert.Equal(2, aliases.Length);
4063Assert.Equal(2, aliases.Length);
4077Assert.Equal(0, ext.Length);
4079Assert.Equal(2, aliases.Length);
4091Assert.Equal(0, ext.Length);
4093Assert.Equal(1, aliases.Length);
4101Assert.Equal(1, aliases.Length);
4112Assert.Equal(2, ext.Length);
4114Assert.Equal(2, aliases.Length);
4134Assert.Equal(2, ext.Length);
4136Assert.Equal(0, aliases.Length);
4150Assert.Equal(0, ext.Length);
4152Assert.Equal(2, aliases.Length);
Semantics\NullableReferenceTypesTests.cs (17)
97764Assert.Equal(2, localSyntaxes.Length);
99093Assert.Equal(1, localSyntaxes.Length);
113131for (int i = 0; i < m11.Length; i++)
113137for (int j = 0; j < m12.Length; j++)
113200Assert.Equal(2, arrays.Length);
123870Assert.Equal(31, baseline.Length);
123917for (int i = 0; i < baseline.Length; i++)
124178Assert.Equal(34, fieldsBaseline.Length);
124197Assert.Equal(12, typeParametersBaseline.Length);
124199for (int i = 0; i < typeParametersBaseline.Length; i++)
126856AssertEqual(expected, getResult, inputs.Length);
126872AssertEqual(expected, getResult, inputs.Length);
126888AssertEqual(expected, getResult, inputs.Length);
126903AssertEqual(expected, getResult, inputs.Length);
126919AssertEqual(expected, getResult, inputs.Length);
154808Assert.Equal(5, locals.Length);
154876Assert.Equal(5, locals.Length);
Semantics\OperatorTests.cs (36)
48Assert.Equal(2, orNodes.Length);
7452for (int k = 0; k < operators.Length; k++)
7493for (int name = 0; name < typeNames.Length; name++)
7497if (name == typeNames.Length - 1)
7501else if (name == typeNames.Length - 2)
7525Assert.Equal(n, nodes.Length);
7708Assert.Equal(2, nodes.Length);
7725for (int i = 0; i < symbols1.Length; i++)
7828for (int k = 0; k < opTokens.Length; k++)
7857TypeSymbol[] types = new TypeSymbol[typeNames.Length];
7859for (int i = 0; i < typeNames.Length - 3; i++)
7864Assert.Null(types[types.Length - 3]);
7865types[types.Length - 3] = compilation.DynamicType;
7867Assert.Null(types[types.Length - 2]);
7868types[types.Length - 2] = compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_Byte));
7870Assert.Null(types[types.Length - 1]);
7871types[types.Length - 1] = compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_SByte));
7903Assert.Equal(n, nodes.Length);
7988for (int k = 0; k < opTokens.Length; k++)
8017TypeSymbol[] types = new TypeSymbol[typeNames.Length];
8019for (int i = 0; i < typeNames.Length - 3; i++)
8024Assert.Null(types[types.Length - 3]);
8025types[types.Length - 3] = compilation.DynamicType;
8027Assert.Null(types[types.Length - 2]);
8028types[types.Length - 2] = compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_Byte));
8030Assert.Null(types[types.Length - 1]);
8031types[types.Length - 1] = compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_SByte));
8063Assert.Equal(n, nodes.Length);
8558Assert.Equal(2, nodes.Length);
8591Assert.Equal(2, nodes.Length);
8608for (int i = 0; i < symbols1.Length; i++)
8637Assert.Equal(2, nodes.Length);
8658for (int i = 0; i < symbols1.Length; i++)
8687Assert.Equal(2, nodes.Length);
8708for (int i = 0; i < symbols1.Length; i++)
8761Assert.Equal(12, nodes.Length);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (107)
Symbols\FunctionPointerTypeSymbolTests.cs (11)
130Assert.Equal(8, parameterDecls.Length);
210Assert.Equal(2, parameterDecls.Length);
340Assert.Equal(3, functionPointers.Length);
411Assert.Equal(6, parameterDecls.Length);
491Assert.Equal(4, parameterDecls.Length);
608Assert.Equal(9, parameterDecls.Length);
904var overallEquality = returnEquality | callingConventionEquality | (parameterEqualities.Length > 0 ? parameterEqualities.Aggregate((acc, cur) => acc | cur) : 0);
1432Assert.Equal(2, anonymousObjectCreations.Length);
1802Assert.Equal(3, ptrTypes.Length);
1842Assert.Equal(2, invocations.Length);
1928Assert.Equal(5, decls.Length);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (45)
LexicalAndXml\LexicalTests.cs (18)
114Assert.Equal(1, trivia.Length);
133Assert.Equal(1, trivia.Length);
152Assert.Equal(1, trivia.Length);
192Assert.Equal(1, trivia.Length);
214Assert.Equal(1, trivia.Length);
236Assert.Equal(1, trivia.Length);
254Assert.Equal(1, trivia.Length);
276Assert.Equal(1, trivia.Length);
300Assert.Equal(1, trivia.Length);
324Assert.Equal(1, trivia.Length);
346Assert.Equal(1, trivia.Length);
368Assert.Equal(1, trivia.Length);
390Assert.Equal(1, trivia.Length);
410Assert.Equal(1, trivia.Length);
438Assert.Equal(1, trivia.Length);
545Assert.Equal(3, trivia.Length);
562Assert.Equal(2, tokens.Length);
602Assert.Equal(1, trivia.Length);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (17)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.Debugging.Package (6)
Microsoft.CodeAnalysis.EditorFeatures (7)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (15)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (20)
ValueTracking\AbstractBaseValueTrackingTests.cs (3)
45Assert.True(itemInfo.Length == items.Length, $"GetTrackedItemsAsync\n\texpected: [{string.Join(",", itemInfo.Select(p => p.text))}]\n\t actual: [{string.Join(",", items)}]");
58Assert.True(childInfo.Length == children.Length, $"GetTrackedItemsAsync on [{item}]\n\texpected: [{string.Join(",", childInfo.Select(p => p.text))}]\n\t actual: [{string.Join(",", children)}]");
60for (var i = 0; i < childInfo.Length; i++)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (4)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (34)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (44)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Microsoft.CodeAnalysis.Features (42)
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
Microsoft.CodeAnalysis.Features.UnitTests (4)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (3)
67var sourceTreeA1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesA1, sourceBytesA1.Length, encodingA, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileA.Path);
68var sourceTreeB1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesB1, sourceBytesB1.Length, encodingB, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileB.Path);
69var sourceTreeC1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesC1, sourceBytesC1.Length, encodingC, SourceHashAlgorithm.Sha1), TestOptions.Regular, sourceFileC.Path);
Microsoft.CodeAnalysis.InteractiveHost (20)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (31)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
Microsoft.CodeAnalysis.PooledObjects.Package (5)
Microsoft.CodeAnalysis.Rebuild (4)
Microsoft.CodeAnalysis.Rebuild.UnitTests (6)
Microsoft.CodeAnalysis.Scripting (19)
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (10)
GlobalAssemblyCacheTests.cs (10)
27Assert.True(names.Length >= 1, "At least 1 mscorlib");
34Assert.True(names.Length >= 1, "At least one 32bit mscorlib");
41Assert.True(names.Length >= 1, "At least 1 mscorlib");
48Assert.True(names.Length >= 1, "At least System.Core");
57Assert.True(names.Length >= 1, "At least System.Core");
68Assert.True(names.Length >= 1, "At least System.Core");
75Assert.Equal(0, names.Length);
78Assert.Equal(0, names.Length);
81Assert.Equal(0, names.Length);
85Assert.Equal(0, names.Length);
Microsoft.CodeAnalysis.Scripting.TestUtilities (2)
Microsoft.CodeAnalysis.Test.Utilities (47)
Microsoft.CodeAnalysis.UnitTests (216)
Collections\List\SegmentedList.Generic.Tests.Misc.cs (72)
51Assert.Equal(list.Count, items.Length + repeat); //"Expect to be the same."
72int[] bad = new int[] { items.Length + 1, items.Length + 2, int.MaxValue, -1, -2, int.MinValue };
73for (int i = 0; i < bad.Length; i++)
90Assert.Equal(list.Count, items.Length + repeat); //"Expected them to be equal."
112int[] bad = new int[] { items.Length + 1, items.Length + 2, int.MaxValue, -1, -2, int.MinValue };
113for (int i = 0; i < bad.Length; i++)
138Assert.Equal(list.Count, itemsX.Length + (itemsY.Length * repeat)); //"Should have the same result."
145for (int i = index; i < index + (itemsY.Length * repeat); i++)
147Assert.Equal(list[i], itemsY[(i - index) % itemsY.Length]); //"Should have the same result."
150for (int i = index + (itemsY.Length * repeat); i < list.Count; i++)
152Assert.Equal(list[i], itemsX[i - (itemsY.Length * repeat)]); //"Should have the same result."
163Assert.Equal(list.Count, itemsX.Length + (itemsX.Length)); //"Should have the same result."
170for (int i = index; i < index + (itemsX.Length); i++)
172Assert.Equal(list[i], itemsX[(i - index) % itemsX.Length]); //"Should have the same result."
175for (int i = index + (itemsX.Length); i < list.Count; i++)
177Assert.Equal(list[i], itemsX[i - (itemsX.Length)]); //"Should have the same result."
184int[] bad = new int[] { items.Length + 1, items.Length + 2, int.MaxValue, -1, -2, int.MinValue };
185for (int i = 0; i < bad.Length; i++)
225for (int i = 0; i < items.Length; i++)
243for (int i = 0; i < items.Length; i++)
274int[] bad = new int[] { /**/items.Length,1,
276items.Length+1,0,
278items.Length+1,1,
280items.Length,2,
282items.Length/2,items.Length/2+1,
284items.Length-1,2,
286items.Length-2,3,
2881,items.Length,
2900,items.Length+1,
2921,items.Length+1,
2942,items.Length,
296items.Length/2+1,items.Length/2,
2982,items.Length-1,
3003,items.Length-2
303for (int i = 0; i < bad.Length; i++)
330for (int i = 0; i < bad.Length; i++)
356for (int i = 0; i < items.Length; ++i)
370for (int i = 0; i < items.Length; ++i)
374for (int i = 0; i < items.Length; ++i)
383Assert.True((0 < items.Length) == list.Exists((T? item) => { return true; }),
403if (0 < items.Length)
405for (int i = 0; i < items.Length; ++i)
408for (int i = 0; i < items.Length && i < 2; ++i)
417if (1 < items.Length)
438for (int i = 0; i < items.Length; i++)
448for (int i = 0; i < itemsY.Length; i++)
457for (int i = 0; i < items.Length; i++)
467for (int i = 0; i < items.Length; i++)
482list.Add(items[items.Length / 2]);
487Assert.True(list.Contains(items[items.Length / 2])); //"Should contain item."
488list.Remove(items[items.Length / 2]);
490Assert.False(list.Contains(items[items.Length / 2])); //"Should not contain item"
509for (int i = 0; i < items.Length; i++)
520for (int i = 0; i < itemsY.Length; i++)
530for (int i = 0; i < items.Length; i++)
541for (int i = 0; i < items.Length; i++)
557list.Add(items[items.Length / 2]);
562Assert.True(_ilist.Contains(items[items.Length / 2])); //"Should contain item."
563list.Remove(items[items.Length / 2]);
565Assert.False(_ilist.Contains(items[items.Length / 2])); //"Should not contain item"
677for (int i = 0; i < items.Length; ++i)
681for (int i = 0; i < items.Length; ++i)
692Assert.True((0 == items.Length) == list.TrueForAll(delegate (T item) { return false; }),
693"Err_30848ahidi Verify TrueForAll returns " + (0 == items.Length) + " if the match returns false on every item FAILED\n");
713for (int i = 0; i < items.Length; i++)
EmbeddedTextTests.cs (14)
117var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithm.Sha1);
118var text = EmbeddedText.FromBytes("pathToSmall", new ArraySegment<byte>(bytes, 0, bytes.Length));
132var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithm.Sha1);
133var text = EmbeddedText.FromBytes("pathToSmall", new ArraySegment<byte>(paddedBytes, 1, bytes.Length));
159var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithms.Default);
160var text = EmbeddedText.FromBytes("pathToLarge", new ArraySegment<byte>(bytes, 0, bytes.Length), SourceHashAlgorithms.Default);
165AssertEx.Equal(BitConverter.GetBytes(bytes.Length), text.Blob.Take(4));
174var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithms.Default);
175var text = EmbeddedText.FromBytes("pathToLarge", new ArraySegment<byte>(paddedBytes, 1, bytes.Length), SourceHashAlgorithms.Default);
180AssertEx.Equal(BitConverter.GetBytes(bytes.Length), text.Blob.Take(4));
193AssertEx.Equal(BitConverter.GetBytes(Encoding.Unicode.GetPreamble().Length + LargeSource.Length * sizeof(char)), text.Blob.Take(4));
237SourceText.From(bytes, bytes.Length, Encoding.ASCII, SourceHashAlgorithm.Sha1, canBeEmbedded: true);
242AssertEx.Equal(SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithm.Sha1), source.GetChecksum());
244AssertEx.Equal(BitConverter.GetBytes(bytes.Length), text.Blob.Take(4));
Text\SourceTextTests.cs (11)
60Assert.Same(s_unicode, SourceText.From(bytes, bytes.Length, s_unicode).Encoding);
61Assert.Equal(utf8NoBOM, SourceText.From(bytes, bytes.Length, null).Encoding);
74Assert.Equal(utf8BOM, SourceText.From(bytes, bytes.Length, s_unicode).Encoding);
75Assert.Equal(utf8BOM, SourceText.From(bytes, bytes.Length, null).Encoding);
88Assert.Equal(SourceHashAlgorithm.Sha1, SourceText.From(bytes, bytes.Length).ChecksumAlgorithm);
102Assert.Equal(algorithm, SourceText.From(bytes, bytes.Length, checksumAlgorithm: algorithm).ChecksumAlgorithm);
136verifyChecksumAndContentHash(SourceText.From(bytesBOM, bytesBOM.Length, null, checksumAlgorithm), checksumBOM, expectedContentHash);
137verifyChecksumAndContentHash(SourceText.From(bytesBOM, bytesBOM.Length, encodingNoBOM, checksumAlgorithm), checksumBOM, expectedContentHash);
138verifyChecksumAndContentHash(SourceText.From(bytesBOM, bytesBOM.Length, encodingBOM, checksumAlgorithm), checksumBOM, expectedContentHash);
343Assert.Throws<InvalidDataException>(() => SourceText.From(bytes, bytes.Length, throwIfBinaryDetected: true));
386TestTryReadByteOrderMark(expectedEncoding, expectedPreambleLength, data, data == null ? 0 : data.Length);
Microsoft.CodeAnalysis.VisualBasic (101)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (8)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (35)
Emit\CompilationEmitTests.vb (19)
275Assert.True(mdOnlyImage.Length > 0, "no metadata emitted")
298Assert.True(output.ToArray().Length > 0, "no metadata emitted")
332Assert.True(mdOnlyImage.Length > 0, "no metadata emitted")
378Assert.True(mdOnlyImage.Length > 0, "no metadata emitted")
427Assert.True(mdOnlyImage.Length > 0, "no metadata emitted")
474Assert.True(mdOnlyImage.Length > 0, "no metadata emitted")
523Assert.True(mdOnlyImage.Length > 0, "no metadata emitted")
572Assert.True(mdOnlyImage.Length > 0, "no metadata emitted")
2465For i As Integer = 0 To Math.Max(expectedGlobalMembers.Length, actualGlobalMembers.Length) - 1
2483For i As Integer = 0 To Math.Max(expectedAMembers.Length, actualAMembers.Length) - 1
2490For i As Integer = 0 To Math.Max(expectedBMembers.Length, actualBMembers.Length) - 1
2498For i As Integer = 0 To Math.Max(expectedCMembers.Length, actualCMembers.Length) - 1
2521For i As Integer = 0 To Math.Max(expectedAMembers.Length, actualAMembers.Length) - 1
2528For i As Integer = 0 To Math.Max(expectedBMembers.Length, actualBMembers.Length) - 1
2535For i As Integer = 0 To Math.Max(expectedCMembers.Length, actualCMembers.Length) - 1
2551Assert.Equal(expectedEntries.Length, metadataReader.DeclarativeSecurityAttributes.Count)
4343For i = 0 To pattern.Length - 1
4350Dim [end] = buffer.Length - pattern.Length
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Microsoft.CodeAnalysis.VisualBasic.Features (5)
Microsoft.CodeAnalysis.VisualBasic.ResultProvider (1)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (35)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (95)
DocumentationComments\DocCommentTests.vb (45)
5458Assert.Equal(6, names.Length)
5510Assert.Equal(1, names.Length)
5514Assert.Equal(3, names.Length)
5520Assert.Equal(3, names.Length)
5666Assert.Equal(2, names.Length)
5671Assert.Equal(32, names.Length)
5846Assert.Equal(2, names.Length)
5851Assert.Equal(32, names.Length)
6044Assert.Equal(8, names.Length)
6055Assert.Equal(6, names.Length)
6064Assert.Equal(20, names.Length)
6206Assert.Equal(8, names.Length)
6217Assert.Equal(6, names.Length)
6226Assert.Equal(22, names.Length)
6459Assert.Equal(13, names.Length)
6475Assert.Equal(2, names.Length)
6480Assert.Equal(10, names.Length)
6493Assert.Equal(13, names.Length)
6509Assert.Equal(6, names.Length)
6518Assert.Equal(1, names.Length)
6522Assert.Equal(1, names.Length)
6526Assert.Equal(2, names.Length)
6531Assert.Equal(1, names.Length)
6535Assert.Equal(1, names.Length)
6607Assert.Equal(6, names.Length)
6616Assert.Equal(4, names.Length)
6623Assert.Equal(2, names.Length)
6628Assert.Equal(2, names.Length)
6680Assert.Equal(1, names.Length)
6713Assert.Equal(1, names.Length)
6723Assert.Equal(3, names.Length)
6870Assert.Equal(1, names.Length)
6949Assert.Equal(1, names.Length)
7287Assert.Equal(2, names.Length)
7335Assert.Equal(2, names.Length)
10076Assert.Equal(expected.Length, names.Count)
10086If e.Symbols.Length = 0 Then
10088ElseIf e.Symbols.Length = 1 Then
10098If e.Types.Length = 0 Then
10101ElseIf e.Types.Length = 1 Then
11891Assert.Equal(expected.Length, names.Count)
11957If expected.Length = 0 Then
11959ElseIf expected.Length = 1 Then
12036If expected.Length = 0 Then
12040ElseIf expected.Length = 1 Then
SymbolsTests\Source\GroupClassTests.vb (20)
125Assert.Equal(expected.Length, members.Length)
252Assert.Equal(expected15.Length, members.Length)
269Assert.Equal(expected16.Length, members.Length)
319Assert.Equal(expected15.Length, members.Length)
646Assert.Equal(expected.Length, members.Length)
703Assert.Equal(expected.Length, members.Length)
756Assert.Equal(expected.Length, members.Length)
809Assert.Equal(expected.Length, members.Length)
859Assert.Equal(expected.Length, members.Length)
909Assert.Equal(expected.Length, members.Length)
960Assert.Equal(expected.Length, members.Length)
1003Assert.Equal(expected.Length, members.Length)
1049Assert.Equal(expected.Length, members.Length)
1098Assert.Equal(expected.Length, members.Length)
1143Assert.Equal(expected.Length, members.Length)
1203Assert.Equal(expected.Length, members.Length)
1266Assert.Equal(expected.Length, members.Length)
1627Assert.Equal(expected.Length, members.Length)
1675Assert.Equal(expected.Length, members.Length)
3706Assert.Equal(expected15.Length, members.Length)
SymbolsTests\Source\SourceSymbolTests.vb (10)
339Assert.Equal(2, locs.Length)
348Assert.Equal(2, locs.Length)
357Assert.Equal(2, locs.Length)
365Assert.Equal(1, locs.Length)
371Assert.Equal(1, locs.Length)
377Assert.Equal(1, locs.Length)
384Assert.Equal(2, locs.Length)
393Assert.Equal(2, locs.Length)
402Assert.Equal(2, locs.Length)
411Assert.Equal(3, locs.Length)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (9)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (6)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces (178)
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (26)
17Debug.Assert(start <= array.Length);
19if (start + length > array.Length)
21length = array.Length - start;
31T[] newArray = new T[array.Length + 1];
37if (position < array.Length)
39Array.Copy(array, position, newArray, position + 1, array.Length - position);
48return InsertAt(array, array.Length, item);
53T[] newArray = new T[array.Length + items.Length];
59if (position < array.Length)
61Array.Copy(array, position, newArray, position + items.Length, array.Length - position);
70return InsertAt(array, array.Length, items);
80if (position + length > array.Length)
82length = array.Length - position;
85T[] newArray = new T[array.Length - length];
91if (position < newArray.Length)
93Array.Copy(array, position + length, newArray, position, newArray.Length - position);
101T[] newArray = new T[array.Length];
102Array.Copy(array, newArray, array.Length);
114ReverseContents(array, 0, array.Length);
132var high = array.Length - 1;
165if (first == null || second == null || first.Length != second.Length)
170for (var i = 0; i < first.Length; i++)
191int high = array.Length - 1;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
118where nameSplit.Length == 3
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (6)
23=> CreateReadableStream(bytes, bytes.Length);
81for (long c = 0; c < chunks.Length; c++)
218Read(this.chunks, 0, this.length, array, 0, array.Length);
232var copyCount = Math.Min(chunk.Length, count);
315Array.Clear(chunk, 0, chunk.Length);
338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset);
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (113)
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (26)
17Debug.Assert(start <= array.Length);
19if (start + length > array.Length)
21length = array.Length - start;
31T[] newArray = new T[array.Length + 1];
37if (position < array.Length)
39Array.Copy(array, position, newArray, position + 1, array.Length - position);
48return InsertAt(array, array.Length, item);
53T[] newArray = new T[array.Length + items.Length];
59if (position < array.Length)
61Array.Copy(array, position, newArray, position + items.Length, array.Length - position);
70return InsertAt(array, array.Length, items);
80if (position + length > array.Length)
82length = array.Length - position;
85T[] newArray = new T[array.Length - length];
91if (position < newArray.Length)
93Array.Copy(array, position + length, newArray, position, newArray.Length - position);
101T[] newArray = new T[array.Length];
102Array.Copy(array, newArray, array.Length);
114ReverseContents(array, 0, array.Length);
132var high = array.Length - 1;
165if (first == null || second == null || first.Length != second.Length)
170for (var i = 0; i < first.Length; i++)
191int high = array.Length - 1;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (6)
23=> CreateReadableStream(bytes, bytes.Length);
81for (long c = 0; c < chunks.Length; c++)
218Read(this.chunks, 0, this.length, array, 0, array.Length);
232var copyCount = Math.Min(chunk.Length, count);
315Array.Clear(chunk, 0, chunk.Length);
338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
Microsoft.CodeAnalysis.Workspaces.UnitTests (35)
XxHash128Tests.cs (6)
53Assert.False(XxHash128.TryHash(input, destination.AsSpan(0, destination.Length - 1), out int bytesWritten, test.Seed));
59Array.Clear(destination, 0, destination.Length);
64Array.Clear(destination, 0, destination.Length);
72Array.Clear(destination, 0, destination.Length);
76Array.Clear(destination, 0, destination.Length);
131Array.Clear(destination, 0, destination.Length);
Microsoft.CommonLanguageServerProtocol.Framework.Package (4)
Microsoft.CSharp (126)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (19)
76Debug.Assert(args.Length >= 1);
152int arity = callPayload.TypeArguments?.Length ?? 0;
177DynamicMetaObject[] newArgs = new DynamicMetaObject[args.Length - 1];
178Array.Copy(args, 1, newArgs, 0, args.Length - 1);
251ArgumentObject[] array = new ArgumentObject[parameters.Length];
252for (int i = 0; i < parameters.Length; i++)
335LocalVariableSymbol[] locals = new LocalVariableSymbol[parameterExpressions.Length];
337for (int i = 0; i < parameterExpressions.Length; i++)
601TypeArray typeArgumentsAsTypeArray = typeArguments?.Length > 0
732int arity = payload.TypeArguments?.Length ?? 0;
819BindingFlag.BIND_RVALUEREQUIRED | BindingFlag.BIND_STMTEXPRONLY, memGroup, CreateArgumentListEXPR(arguments, locals, 1, arguments.Length)) as ExprCall;
832if (conditions.Length > 0)
945Debug.Assert(arguments.Length == 1);
985Debug.Assert(arguments.Length == 2);
1193Debug.Assert(arguments.Length == 1);
1228Debug.Assert(arguments.Length == 1);
1251Debug.Assert(arguments.Length >= 2);
1264indexerArguments = CreateArgumentListEXPR(arguments, locals, 1, arguments.Length - 1);
1276int indexOfLast = arguments.Length - 1;
Microsoft.Data.Analysis (33)
Microsoft.Data.Analysis.Tests (52)
Microsoft.DotNet.Arcade.Sdk (5)
Microsoft.DotNet.Arcade.Sdk.Tests (1)
Microsoft.DotNet.AsmDiff (10)
Microsoft.DotNet.Build.Tasks.Feed (3)
Microsoft.DotNet.Build.Tasks.Feed.Tests (2)
Microsoft.DotNet.Build.Tasks.Installers (18)
Microsoft.DotNet.Build.Tasks.Packaging (33)
Microsoft.DotNet.Build.Tasks.Packaging.Tests (2)
Microsoft.DotNet.Build.Tasks.TargetFramework (2)
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Microsoft.DotNet.Build.Tasks.Workloads (5)
Microsoft.DotNet.Build.Tasks.Workloads.Tests (1)
Microsoft.DotNet.CodeAnalysis (3)
Microsoft.DotNet.GenFacades (1)
Microsoft.DotNet.Helix.Client (1)
Microsoft.DotNet.Helix.JobSender (1)
Microsoft.DotNet.Helix.Sdk (1)
Microsoft.DotNet.Helix.Sdk.Tests (11)
Microsoft.DotNet.Internal.DependencyInjection.Testing (2)
Microsoft.DotNet.NuGetRepack.Tasks (2)
Microsoft.DotNet.NuGetRepack.Tests (3)
Microsoft.DotNet.Open.Api.Tools.Tests (2)
Microsoft.DotNet.PackageTesting (6)
Microsoft.DotNet.RemoteExecutor (4)
Microsoft.DotNet.SharedFramework.Sdk (12)
Microsoft.DotNet.SignCheck (3)
Microsoft.DotNet.SignCheckLibrary (4)
Microsoft.DotNet.SignTool (16)
Microsoft.DotNet.SignTool.Tests (5)
Microsoft.DotNet.SourceBuild.Tasks (4)
Microsoft.DotNet.SourceBuild.Tasks.Tests (2)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (5)
Microsoft.DotNet.VersionTools (12)
Microsoft.DotNet.VersionTools.Tests (19)
Microsoft.DotNet.XliffTasks (5)
Microsoft.DotNet.XUnitExtensions (5)
Microsoft.Extensions.AI (11)
Microsoft.Extensions.AI.Abstractions (6)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Microsoft.Extensions.AI.AzureAIInference (1)
Microsoft.Extensions.AI.Ollama (4)
Microsoft.Extensions.AI.OpenAI (1)
Microsoft.Extensions.AI.Tests (1)
Microsoft.Extensions.ApiDescription.Client (2)
Microsoft.Extensions.ApiDescription.Client.Tests (2)
Microsoft.Extensions.ApiDescription.Tool.Tests (2)
Microsoft.Extensions.AsyncState.Tests (1)
Microsoft.Extensions.Caching.Abstractions (2)
Microsoft.Extensions.Caching.Hybrid (12)
Microsoft.Extensions.Caching.Hybrid.Tests (6)
Microsoft.Extensions.Caching.Memory (1)
Microsoft.Extensions.Caching.MicroBenchmarks (10)
Microsoft.Extensions.Caching.SqlServer (2)
Microsoft.Extensions.Caching.StackExchangeRedis (6)
Microsoft.Extensions.Compliance.Abstractions.Tests (3)
Microsoft.Extensions.Compliance.Testing.Tests (5)
Microsoft.Extensions.Configuration.Binder (8)
Microsoft.Extensions.Configuration.KeyPerFile.Tests (1)
Microsoft.Extensions.DependencyInjection (34)
Microsoft.Extensions.DependencyInjection.Abstractions (46)
Microsoft.Extensions.DependencyModel (10)
Microsoft.Extensions.Diagnostics (1)
Microsoft.Extensions.Diagnostics.Abstractions (2)
Microsoft.Extensions.Diagnostics.HealthChecks (4)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (4)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (8)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (10)
Microsoft.Extensions.Diagnostics.Testing (2)
Microsoft.Extensions.FileProviders.Embedded (3)
Microsoft.Extensions.FileProviders.Physical (6)
Microsoft.Extensions.FileSystemGlobbing (2)
Microsoft.Extensions.Hosting (1)
Microsoft.Extensions.Http (3)
Microsoft.Extensions.Http.Diagnostics (6)
Microsoft.Extensions.Http.Diagnostics.Tests (5)
Microsoft.Extensions.Http.Polly (1)
Microsoft.Extensions.Http.Resilience.Tests (2)
Microsoft.Extensions.Identity.Core (25)
PasswordHasher.cs (17)
80if (a == null || b == null || a.Length != b.Length)
85for (var i = 0; i < a.Length; i++)
148var outputBytes = new byte[13 + salt.Length + subkey.Length];
153Buffer.BlockCopy(salt, 0, outputBytes, 13, salt.Length);
154Buffer.BlockCopy(subkey, 0, outputBytes, 13 + saltSize, subkey.Length);
174if (decodedHashedPassword.Length == 0)
228if (hashedPassword.Length != 1 + SaltSize + Pbkdf2SubkeyLength)
234Buffer.BlockCopy(hashedPassword, 1, salt, 0, salt.Length);
237Buffer.BlockCopy(hashedPassword, 1 + salt.Length, expectedSubkey, 0, expectedSubkey.Length);
268Buffer.BlockCopy(hashedPassword, 13, salt, 0, salt.Length);
271int subkeyLength = hashedPassword.Length - 13 - salt.Length;
277Buffer.BlockCopy(hashedPassword, 13 + salt.Length, expectedSubkey, 0, expectedSubkey.Length);
Microsoft.Extensions.Localization (1)
Microsoft.Extensions.Localization.RootNamespace.Tests (1)
Microsoft.Extensions.Localization.Tests (2)
Microsoft.Extensions.Logging (10)
Microsoft.Extensions.Logging.Abstractions (9)
Microsoft.Extensions.Logging.Console (10)
Microsoft.Extensions.Logging.EventSource (3)
Microsoft.Extensions.ObjectPool.Tests (3)
Microsoft.Extensions.Options (1)
Microsoft.Extensions.Options.Contextual (2)
Microsoft.Extensions.Options.DataAnnotations (1)
Microsoft.Extensions.Options.SourceGeneration (5)
Microsoft.Extensions.Primitives (10)
Microsoft.Extensions.SecretManager.Tools.Tests (4)
Microsoft.Extensions.ServiceDiscovery (2)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Microsoft.Extensions.Telemetry (19)
Microsoft.Extensions.Telemetry.Abstractions (4)
Microsoft.Extensions.Telemetry.Abstractions.Tests (4)
Microsoft.Extensions.Telemetry.Tests (19)
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
Microsoft.Gen.ComplianceReports (1)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
Microsoft.Gen.ContextualOptions (1)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
Microsoft.Gen.Logging (1)
Microsoft.Gen.Logging.Generated.Tests (1)
Microsoft.Gen.Logging.Unit.Tests (2)
Microsoft.Gen.Metrics (1)
Microsoft.Gen.Metrics.Unit.Tests (1)
Microsoft.Gen.MetricsReports (4)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
Microsoft.Interop.ComInterfaceGenerator (1)
Microsoft.Interop.JavaScript.JSImportGenerator (41)
JSGeneratorFactory.cs (37)
172case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes.Length == 0 && jsTypeArguments[0] == JSTypeFlags.Void: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Void));
173case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Byte && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Byte));
174case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Boolean && jsTypeArguments[0] == JSTypeFlags.Boolean: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Boolean));
175case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Char && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Char));
176case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int16 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int16));
177case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int32 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int32));
178case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int64 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int52));
179case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int64 && jsTypeArguments[0] == JSTypeFlags.BigInt: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.BigInt64));
180case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.IntPtr && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.IntPtr));
181case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Double && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Double));
182case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Single && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Single));
183case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.JSObject && jsTypeArguments[0] == JSTypeFlags.Object: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.JSObject));
184case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.String && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.String));
185case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Exception && jsTypeArguments[0] == JSTypeFlags.Error: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Exception));
186case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.DateTime && jsTypeArguments[0] == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.DateTime));
187case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.DateTimeOffset && jsTypeArguments[0] == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.DateTimeOffset));
188case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Object && jsTypeArguments[0] == JSTypeFlags.Any: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Object));
191case KnownManagedType.Task when jsType == JSTypeFlags.Missing && argumentTypes.Length == 0: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Void));
211case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1:
215case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Byte && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Byte));
216case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.String && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.String));
217case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Double && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Double));
218case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int32 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Int32));
219case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.JSObject && jsTypeArguments[0] == JSTypeFlags.Object: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.JSObject));
220case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Object && jsTypeArguments[0] == JSTypeFlags.Any: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Object));
228case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1:
236case KnownManagedType.Span when jsType == JSTypeFlags.MemoryView && jsTypeArguments.Length != 0:
252case KnownManagedType.ArraySegment when jsType == JSTypeFlags.MemoryView && jsTypeArguments.Length != 0:
267case KnownManagedType.Function when jsType == JSTypeFlags.Function && jsTypeArguments.Length == argumentTypes.Length:
268case KnownManagedType.Action when jsType == JSTypeFlags.Function && jsTypeArguments.Length == argumentTypes.Length:
270for (int i = 0; i < argumentTypes.Length; i++)
272var isReturn = marshaledType == KnownManagedType.Function && i == jsTypeArguments.Length - 1;
289if (argsMarshallerTypes.Length > maxArgs)
301for (int i = 0; i < argumentTypes.Length; i++)
Microsoft.Interop.LibraryImportGenerator (1)
Microsoft.Interop.SourceGeneration (2)
Microsoft.JSInterop (17)
Microsoft.ML.AutoML (102)
Sweepers\SmacSweeper.cs (16)
125Runtime.Contracts.Assert(data.GetRowCount() == targets.Length, "This data view will have as many rows as there have been evaluations");
160ParameterSet[] randomChallengers = _randomSweeper.ProposeSweeps(numOfCandidates - eiChallengers.Length, previousRuns);
164ParameterSet[] configs = new ParameterSet[eiChallengers.Length + randomChallengers.Length];
165Array.Copy(eiChallengers, 0, configs, 0, eiChallengers.Length);
166Array.Copy(randomChallengers, 0, configs, eiChallengers.Length, randomChallengers.Length);
197Runtime.Contracts.Assert(randomConfigs.Length == randomEIs.Length);
199for (int i = 0; i < randomConfigs.Length; i++)
264for (int i = 0; i < _sweepParameters.Length; i++)
334VBuffer<Float> features = new VBuffer<Float>(transformedParams.Length, transformedParams);
369double[][] meansAndStdDevs = new double[leafValues.Length][];
370for (int i = 0; i < leafValues.Length; i++)
430double[] eis = new double[forestStatistics.Length];
431for (int i = 0; i < forestStatistics.Length; i++)
Utils\ArrayMath.cs (19)
22for (int i = 1; i < array.Length; i++)
36return Enumerable.Range(0, array.Length).OrderBy(index => array[index]).ToArray();
60double[] ret = new double[array.Length + 1];
63Array.Copy(array, index, ret, index + 1, array.Length - index);
128if (truth.Length != pred.Length)
130throw new ArgumentException($"length doesn't match, {truth.Length} != {pred.Length}");
133var diff = Enumerable.Range(0, truth.Length).Select(i => truth[i] - pred[i]).ToArray();
143if (truth.Length != pred.Length)
145throw new ArgumentException($"length doesn't match, {truth.Length} != {pred.Length}");
148var diff = Enumerable.Range(0, truth.Length).Select(i => truth[i] - pred[i]).ToArray();
157if (truth.Length != pred.Length)
159throw new ArgumentException($"length doesn't match, {truth.Length} != {pred.Length}");
162var diff = Enumerable.Range(0, truth.Length).Select(i => Math.Abs(truth[i] - pred[i])).ToArray();
Microsoft.ML.AutoML.Tests (10)
Microsoft.ML.CodeGenerator (5)
Microsoft.ML.Core (237)
CommandLine\CmdParser.cs (28)
312if (settings == null || settings.Length == 0)
493if (nicks.Length == 0 || nicks.Length == 1 && nicks[0].ToLowerInvariant() == name.ToLowerInvariant())
565for (int i = 0; i < strs.Length; i++)
588if (value == null && i + 2 < strs.Length && strs[i + 1] == "=")
610hadError |= !info.ArgDef.SetValue(this, ref values[info.Args.Length], str, "", destination);
616if (value == null && i + 2 < strs.Length && strs[i + 1] == "=")
623Contracts.Assert(0 <= arg.Index && arg.Index < info.Args.Length);
634if (i + 2 < strs.Length && strs[i + 1] == "=")
641else if (i + 1 < strs.Length)
660if (!IsCurlyGroup(value) && i + 1 < strs.Length && IsCurlyGroup(strs[i + 1]))
671if (!IsCurlyGroup(value) && i + 1 < strs.Length && IsCurlyGroup(strs[i + 1]))
757var values = new ArgValue[info.Args.Length + 1];
761for (int i = 0; i < info.Args.Length; i++)
768hadError |= info.ArgDef.Finish(this, values[info.Args.Length], destination);
1258Arg[] args = Utils.BuildArray(argumentInfo.Args.Length, i => new Arg(argumentInfo.Args[i]));
1259Array.Sort(args, 0, args.Length, Comparer<Arg>.Create((x, y) => x.SortOrder.CompareTo(y.SortOrder)));
1344Contracts.Assert(map.Count >= args.Length);
1479if (_infoCustom.ArgDef == null && _infoCustom.Args.Length == 0)
1498if (type.GenericTypeArguments.Length != 2)
1593for (int i = 0; i < arr.Length; i++)
1628for (int i = 0; i < arr.Length; i++)
1636for (int i = 0; i < res.Length; i++)
1646for (int i = 0; i < res.Length; i++)
2310switch (factoryType.GenericTypeArguments.Length)
2340if (settings == null || (settings.Length == 1 && string.IsNullOrEmpty(settings[0])))
2354if (string.IsNullOrEmpty(Name) && Settings.Length == 0)
2357if (Settings.Length == 0)
Utilities\Utils.cs (33)
63return x == null ? 0 : x.Length;
69return x == null ? 0 : x.Length;
233return FindIndexSorted(input, 0, input.Length, value);
358Contracts.Assert(0 <= min && min <= lim && lim <= input.Length);
393Contracts.Assert(0 <= min && min <= lim && lim <= input.Length);
426Contracts.Assert(0 <= min && min <= lim && lim <= input.Length);
490var res = new int[perm.Length];
491for (int i = 0; i < perm.Length; i++)
494Contracts.Assert(0 <= j && j < perm.Length);
517if (arr1.Length != arr2.Length)
520for (int i = 0; i < arr1.Length; i++)
534if (arr1.Length != arr2.Length)
537for (int i = 0; i < arr1.Length; i++)
559if (arr1.Length != arr2.Length)
562for (int i = 0; i < arr1.Length; i++)
576if (arr1.Length != arr2.Length)
579for (int i = 0; i < arr1.Length; i++)
735if (col.Index < result.Length)
748for (int i = 0; i < result.Length; i++)
862if (a.Length == 0)
864if (b.Length == 0)
866var res = new T[a.Length + b.Length];
867Array.Copy(a, res, a.Length);
868Array.Copy(b, 0, res, a.Length, b.Length);
884checked { size += a.Length; }
897if (size == ne.Length)
1190Contracts.CheckParam(meth.GetGenericArguments().Length == 1, nameof(func),
Microsoft.ML.Core.Tests (38)
UnitTests\TestVBuffer.cs (19)
236for (var j = 0; j < multResExpected.Length; j++)
262for (var j = 0; j < multResExpected.Length; j++)
294Assert.Equal(expectedValues.Length, actualValues.Length);
295for (int i = 0; i < expectedValues.Length; i++)
328T2[] values = new T2[indices.Length];
330for (int ii = 0; ii < indices.Length; ++ii)
340b = new VBuffer<T2>(a.Length, indices.Length, values, indices);
373T2[] values = new T2[indices.Length];
375for (int ii = 0; ii < indices.Length; ++ii)
382b = new VBuffer<T2>(a.Length, indices.Length, values, indices);
505TDst[] values = new TDst[indices.Length];
508for (int i = 0; i < indices.Length; ++i)
514dst = new VBuffer<TDst>(a.Length, indices.Length, values, indices);
981for (int i = count; i < indices.Length; ++i)
983if (indices.Length == 0 && rgen.Next(2) == 0)
987for (int i = 0; i < values.Length; ++i)
989if (values.Length == 0 && rgen.Next(2) == 0)
1099Contracts.Assert(cases == Enum.GetValues(typeof(GenLogic)).Length);
Microsoft.ML.CpuMath (19)
Microsoft.ML.CpuMath.UnitTests (32)
UnitTests.cs (32)
68for (int i = 0; i < testMatrix2.Length; i++)
358for (int i = 0; i < expected.Length; i++)
384for (int i = 0; i < expected.Length; i++)
411for (int i = 0; i < expected.Length; i++)
416CpuMathUtils.Scale(defaultScale, src, dst, dst.Length);
437for (int i = 0; i < expected.Length; i++)
465for (int i = 0; i < expected.Length; i++)
470CpuMathUtils.AddScale(defaultScale, src, dst, dst.Length);
522for (int i = 0; i < expected.Length; i++)
527CpuMathUtils.AddScaleCopy(defaultScale, src, dst, result, dst.Length);
549for (int i = 0; i < dst.Length; i++)
554for (int i = 0; i < expected.Length; i++)
559CpuMathUtils.Add(src, dst, dst.Length);
611for (int i = 0; i < src2.Length; i++)
618for (int i = 0; i < expected.Length; i++)
623CpuMathUtils.MulElementWise(src1, src2, dst, dst.Length);
642for (int i = 0; i < src.Length; i++)
665for (int i = 0; i < src.Length; i++)
691for (int i = 0; i < src.Length; i++)
713for (int i = 0; i < src.Length; i++)
739for (int i = 0; i < src.Length; i++)
763for (int i = 0; i < src.Length; i++)
792for (int i = 0; i < src.Length; i++)
818for (int i = 0; i < dst.Length; i++)
824for (int i = 0; i < dst.Length; i++)
829var actual = CpuMathUtils.DotProductDense(src, dst, dst.Length);
851for (int i = 0; i < dst.Length; i++)
883for (int i = 0; i < dst.Length; i++)
889for (int i = 0; i < dst.Length; i++)
895var actual = CpuMathUtils.L2DistSquared(src, dst, dst.Length);
945for (int i = 0; i < expected.Length; i++)
951CpuMathUtils.SdcaL1UpdateDense(defaultScale, src.Length, src, defaultScale, v, w);
Microsoft.ML.Data (1155)
DataLoadSave\Binary\BinaryLoader.cs (28)
512ectx.Assert(args.Length == 1);
643for (int i = 0; i < _aliveColumns.Length; ++i)
1256Utils.BuildSubsetMaps(toc.Length, columnsNeeded, out activeIndices, out _colToActivesIndex);
1257_actives = new TableOfContentsEntry[activeIndices.Length];
1258for (int i = 0; i < activeIndices.Length; ++i)
1264_pipes = new ReadPipe[parent.RowCount > 0 ? _actives.Length : 0];
1265_pipeGetters = new Delegate[_actives.Length];
1285if (_pipes.Length == 0)
1291for (int c = 0; c < _pipeGetters.Length; ++c)
1301int pipeBuffers = 2 * ((_parent._threads + _pipes.Length - 1) / _pipes.Length);
1303for (int c = 0; c < _pipes.Length; ++c)
1354for (int c = 0; c < _pipes.Length; ++c)
1385long decompressSequenceLim = (long)_numBlocks * _actives.Length;
1386for (int w = 0; w < pipeWorkers.Length; ++w)
1395int pipeIndex = (int)(seq % _pipes.Length);
1426for (int c = 0; c < _pipes.Length; ++c)
1431for (int c = 0; c < _pipes.Length; ++c)
1969Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column));
1977for (int c = 0; c < _pipes.Length; ++c)
2013if (!more && _pipes.Length > 0)
2037Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column), "requested column not active.");
2075for (int i = 1; i < _blockShuffleOrder.Length; ++i)
2090Ch.Assert(pos / _rowsPerBlock < _blockShuffleOrder.Length);
2198isLiveAndCol.Key ? "" : " (DEAD!)", typeDesc, blockLookups.Length, col.RowsPerBlock);
2211string deadDisc = deadMtoc.Length > 0 ? string.Format(" ({0} dead)", deadMtoc.Length) : "";
2213mtoc.Length, deadDisc, metadataTocSize, metadataSize);
DataView\Transposer.cs (48)
105_cols = new DataViewSchema.Column[columns.Length];
112for (int c = 0; c < columns.Length; ++c)
132for (int c = 0; c < _cols.Length; ++c)
149_splitLim = new int[_cols.Length];
153for (int c = 0; c < _cols.Length; ++c)
172ch.Trace("{0} of {1} input columns sliced into {2} columns", slicedCount, _cols.Length, toSave.Count);
210int[] indices = new int[columns.Length];
211for (int c = 0; c < columns.Length; ++c)
225for (int c = 0; c < columns.Length; ++c)
247_host.Assert(0 <= tcol && tcol < _cols.Length);
502_rbuffIndices = new int[_rbuff.Length];
523int maxPossibleSize = _rbuff.Length * vecLen;
526Array.Clear(_rbuffIndices, 0, _rbuffIndices.Length);
553var heap = new Heap<KeyValuePair<int, int>>((p1, p2) => p1.Key > p2.Key || (p1.Key == p2.Key && p1.Value > p2.Value), _rbuff.Length);
644if (++irbuff == _rbuff.Length)
670Ch.Assert(_indices[s].Length == _len);
671Ch.Assert(_values[s].Length == _len);
748_splitters = new Splitter[toSlice.Length];
749_incolToLim = new int[toSlice.Length];
754for (int c = 0; c < toSlice.Length; ++c)
775for (int c = 0; c < _splitters.Length; ++c)
787_host.Assert(outputColumnCount == _colToSplitIndex.Length);
791for (int c = 0; c < _splitters.Length; ++c)
813_host.Assert(0 <= incol && incol < _incolToLim.Length);
826_host.Assert(0 <= col && col < _colToSplitIndex.Length);
853for (int i = 0; i < result.Length; ++i)
870activeSplitters = new bool[_splitters.Length];
873for (int i = 0; i < activeSplitters.Length; ++i)
941for (int i = 0; i < ends.Length; ++i)
947for (int i = 0; i < ends.Length; ++i)
950ends[ends.Length - 1] = vectorSize;
1078public override int ColumnCount { get { return _lims.Length; } }
1101Contracts.Assert(lims[lims.Length - 1] == type.Size);
1104_types = new VectorDataViewType[_lims.Length];
1106for (int c = 1; c < _lims.Length; ++c)
1111for (int c = 0; c < _lims.Length; ++c)
1144_srcIndicesLims = new int[Lims.Length];
1146_getters = new ValueGetter<VBuffer<T>>[Lims.Length];
1147for (int c = 0; c < _getters.Length; ++c)
1169Contracts.Check(IsColumnActive(column) && column.Index < _getters.Length);
1227Contracts.Assert(_inputValue.Length == Parent._lims[Parent._lims.Length - 1]);
1237Array.Clear(_srcIndicesLims, 0, _srcIndicesLims.Length);
1242for (int i = 0; i < Lims.Length; ++i)
1274Ch.Assert(Utils.Size(activeSplitters) == slicer._splitters.Length);
1277_sliceRows = new DataViewRow[_slicer._splitters.Length];
1278var activeSrc = new bool[slicer._splitters.Length];
1285for (int i = 0; i < activeSplitters.Length; ++i)
1375ctx.Assert(genTypeArgs.Length == 1);
Deprecated\Vector\VectorUtils.cs (18)
27return CpuMathUtils.DotProductDense(a, b, a.Length);
305Contracts.Check(0 <= offset && offset <= a.Length);
306Contracts.Check(b.Length <= a.Length - offset, "VBuffer b must be no longer than a.Length - offset.");
420return L2DistSquaredHalfSparse(a.AsSpan(0, a.Length), b.GetValues(), b.GetIndices());
430Contracts.CheckParam(src.Length == dst.Length, nameof(dst), "Arrays must have the same dimensionality.");
431if (src.Length == 0)
433CpuMathUtils.Add(src, dst, src.Length);
471Contracts.Check(0 <= offset && offset <= dst.Length);
472Contracts.Check(src.Length <= dst.Length - offset, "Vector src must be no longer than dst.Length - offset.");
499Contracts.Check(src.Length == dst.Length, "Arrays must have the same dimensionality.");
504CpuMathUtils.AddScale(c, src, dst, src.Length);
520if (a == null || a.Length == 0)
538Array.Clear(dst, 0, dst.Length);
543Contracts.Check(a.Length == b.Length, "Arrays must have the same dimensionality.");
546for (int i = 0; i < a.Length; i++)
Evaluators\BinaryClassifierEvaluator.cs (8)
337overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray());
358confDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, confStratCol.ToArray());
363dst = new VBuffer<ReadOnlyMemory<char>>(aggregator.ClassNames.Length, aggregator.ClassNames);
378dvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, prStratCol.ToArray());
1454for (int i = 0; i < metrics.Length; i++)
1460if (metrics.Length != 1)
1461idv = EvaluateUtils.AddFoldIndex(Host, idv, i, metrics.Length);
1466if (metrics.Length != 1)
Evaluators\MulticlassClassificationEvaluator.cs (16)
211overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray());
226dst = new VBuffer<ReadOnlyMemory<char>>(allTopK.First().Length, Enumerable.Range(1, allTopK.First().Length).Select(i => new ReadOnlyMemory<char>(i.ToString().ToCharArray())).ToArray());
235confDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, confStratCol.ToArray());
240dst = new VBuffer<ReadOnlyMemory<char>>(aggregator.ClassNames.Length, aggregator.ClassNames);
320var res = new double[_totalPerClassLogLoss.Length];
321for (int i = 0; i < _totalPerClassLogLoss.Length; i++)
335for (int i = 0; i < ConfusionTable.Length; i++)
418Host.Assert(score.Type.GetVectorSize() == _scoresArr.Length);
445Host.Check(_scores.Length == _scoresArr.Length);
470if (intLabel < _scoresArr.Length)
500for (int i = 0; i < _scoresArr.Length; i++)
535var editor = VBufferEditor.Create(ref slotNames, ClassNames.Length);
536for (int i = 0; i < ClassNames.Length; i++)
736foreach (var index in Enumerable.Range(0, scoresArr.Length).OrderByDescending(i => scoresArr[i]))
956for (int i = 0; i < metrics.Length; i++)
Evaluators\RankingEvaluator.cs (11)
86for (int i = 0; i < gains.Length; i++)
216overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray());
227groupDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, groupStratCol.ToArray());
780var editor = VBufferEditor.Create(ref dst, src.Length);
922if (metrics.Length == 1)
927for (int i = 0; i < metrics.Length; i++)
933idv = EvaluateUtils.AddFoldIndex(Host, idv, i, metrics.Length);
971for (int i = 0; i < discountMap.Length; i++)
987if (truncationLevel <= discountMap.Length)
1001int relevancyLevel = labelGains.Length;
1017int topLabel = labelGains.Length - 1;
Transforms\NormalizeColumnDbl.cs (77)
51Contracts.Assert(offsets == null || offsets.Length == scales.Length);
54Contracts.Assert(scales.Length == numFeatures);
59Contracts.Assert(indices.Length < numFeatures);
60Contracts.Assert(scales.Length == indices.Length);
79for (int ii = 0; ii < indices.Length; ii++)
131for (int iv = 0; iv < scales.Length; iv++)
164for (int iiv = 0; iiv < indicesMorph.Length; iiv++)
187Contracts.Assert(indicesMorph == null || indicesMorph.Length == scalesSparse.Length);
188Contracts.Assert(offsetsSparse == null || offsetsSparse.Length == scalesSparse.Length);
209ctx.Writer.Write(binUpperBounds.Length);
218writer.WriteLine("NumNormalizationFeatures={0}", binUpperBounds.Length);
219for (int i = 0; i < binUpperBounds.Length; i++)
222for (int j = 0; j < binUpperBounds[i].Length - 1; j++)
257for (int j = 1; j < curUpperBounds.Length; j++)
259Contracts.CheckDecode(curUpperBounds[curUpperBounds.Length - 1] == TFloat.PositiveInfinity);
276ctx.Writer.Write(mean.Length);
278ctx.Writer.WriteDoublesNoCount(stddev.AsSpan(0, mean.Length));
283writer.WriteLine("NumNormalizationFeatures={0}", mean.Length);
285for (int i = 0; i < mean.Length; i++)
355var size = _min.Length;
387var size = _min.Length;
468var size = _mean.Length;
498for (int i = 0; i < _mean.Length; i++)
678host.Assert(scales.Length == cfeat);
679host.Assert(offsets == null || offsets.Length == cfeat);
743host.Assert(scales.Length == cfeat);
744host.Assert(offsets == null || offsets.Length == cfeat);
754AffineNormSerializationUtils.SaveModel(ctx, Scale.Length, null, Scale, Offset, saveText: true);
793Contracts.Check(dst.Length == Scale.Length);
803Contracts.Check(dst.Length == Scale.Length);
813Contracts.Check(dst.Length == Scale.Length);
825Contracts.Assert(input.Length == scale.Length);
826int size = scale.Length;
855Contracts.Assert(input.Length == scale.Length);
856int size = scale.Length;
899Contracts.Assert(input.Length == scale.Length);
901int size = scale.Length;
933Contracts.Assert(inz < nz.Length && ivDst == nz[inz] || inz == nz.Length && ivDst == size);
940ivDst = ++inz < nz.Length ? nz[inz] : size;
958ivDst = ++inz < nz.Length ? nz[inz] : size;
959Contracts.Assert((inz == nz.Length) == (ivDst >= size));
963Contracts.Assert(inz == nz.Length);
1088Host.Check(dst.Length == Mean.Length);
1099Contracts.Assert(input.Length == mean.Length);
1100int size = mean.Length;
1167_den = Math.Max(1, _binUpperBounds.Length - 1);
1189if (binUpperBounds.Length != 1)
1190throw host.Except("Normalizer expected {0} slots, but the input data column has 1 slot.", binUpperBounds.Length);
1240_den = new TFloat[_binUpperBounds.Length];
1241for (int i = 0; i < _binUpperBounds.Length; i++)
1242_den[i] = Math.Max(1, _binUpperBounds[i].Length - 1);
1245_offset = new TFloat[_binUpperBounds.Length];
1247for (int i = 0; i < _binUpperBounds.Length; i++)
1275if (binUpperBounds.Length != cv)
1276throw host.Except("Normalizer expected {0} slots, but the input data column has {1} slots.", binUpperBounds.Length, cv);
1302Host.Check(dst.Length == _binUpperBounds.Length);
1310Contracts.Assert(input.Length == _binUpperBounds.Length);
1311int size = _binUpperBounds.Length;
1499int binIdx = binUpperBounds.FindIndexSorted(0, binUpperBounds.Length - 1, input);
1500Contracts.Check(binIdx < binUpperBounds.Length);
1510int binIdx = binUpperBounds.FindIndexSorted(0, binUpperBounds.Length - 1, input);
1511Contracts.Check(binIdx < binUpperBounds.Length);
1585var size = Aggregator.Min.Length;
1612var cv = Aggregator.Min.Length;
1782int cv = _aggregator.Mean.Length;
1831int cv = _aggregator.Mean.Length;
1933int size = _values.Length;
1962var count = _values.Length;
2145for (int i = 0; i < _medianAggregators.Length; i++)
2165double[] scale = new double[_medianAggregators.Length];
2166double[] median = new double[_medianAggregators.Length];
2169for (int i = 0; i < _medianAggregators.Length; i++)
Transforms\NormalizeColumnSng.cs (77)
51Contracts.Assert(offsets == null || offsets.Length == scales.Length);
54Contracts.Assert(scales.Length == numFeatures);
59Contracts.Assert(indices.Length < numFeatures);
60Contracts.Assert(scales.Length == indices.Length);
79for (int ii = 0; ii < indices.Length; ii++)
131for (int iv = 0; iv < scales.Length; iv++)
164for (int iiv = 0; iiv < indicesMorph.Length; iiv++)
187Contracts.Assert(indicesMorph == null || indicesMorph.Length == scalesSparse.Length);
188Contracts.Assert(offsetsSparse == null || offsetsSparse.Length == scalesSparse.Length);
209ctx.Writer.Write(binUpperBounds.Length);
218writer.WriteLine("NumNormalizationFeatures={0}", binUpperBounds.Length);
219for (int i = 0; i < binUpperBounds.Length; i++)
222for (int j = 0; j < binUpperBounds[i].Length - 1; j++)
257for (int j = 1; j < curUpperBounds.Length; j++)
259Contracts.CheckDecode(curUpperBounds[curUpperBounds.Length - 1] == TFloat.PositiveInfinity);
276ctx.Writer.Write(mean.Length);
278ctx.Writer.WriteSinglesNoCount(stddev.AsSpan(0, mean.Length));
283writer.WriteLine("NumNormalizationFeatures={0}", mean.Length);
285for (int i = 0; i < mean.Length; i++)
355var size = _min.Length;
388var size = _min.Length;
469var size = _mean.Length;
500for (int i = 0; i < _mean.Length; i++)
836host.Assert(scales.Length == cfeat);
837host.Assert(offsets == null || offsets.Length == cfeat);
900host.Assert(scales.Length == cfeat);
901host.Assert(offsets == null || offsets.Length == cfeat);
911AffineNormSerializationUtils.SaveModel(ctx, Scale.Length, null, Scale, Offset, saveText: true);
950Contracts.Check(dst.Length == Scale.Length);
960Contracts.Check(dst.Length == Scale.Length);
970Contracts.Check(dst.Length == Scale.Length);
982Contracts.Assert(input.Length == scale.Length);
983int size = scale.Length;
1013Contracts.Assert(input.Length == scale.Length);
1014int size = scale.Length;
1058Contracts.Assert(input.Length == scale.Length);
1060int size = scale.Length;
1093Contracts.Assert(inz < nz.Length && ivDst == nz[inz] || inz == nz.Length && ivDst == size);
1100ivDst = ++inz < nz.Length ? nz[inz] : size;
1118ivDst = ++inz < nz.Length ? nz[inz] : size;
1119Contracts.Assert((inz == nz.Length) == (ivDst >= size));
1123Contracts.Assert(inz == nz.Length);
1248Host.Check(dst.Length == Mean.Length);
1259Contracts.Assert(input.Length == mean.Length);
1260int size = mean.Length;
1328_den = Math.Max(1, _binUpperBounds.Length - 1);
1350if (binUpperBounds.Length != 1)
1351throw host.Except("Normalizer expected {0} slots, but the input data column has 1 slot.", binUpperBounds.Length);
1401_den = new TFloat[_binUpperBounds.Length];
1402for (int i = 0; i < _binUpperBounds.Length; i++)
1403_den[i] = Math.Max(1, _binUpperBounds[i].Length - 1);
1406_offset = new TFloat[_binUpperBounds.Length];
1408for (int i = 0; i < _binUpperBounds.Length; i++)
1436if (binUpperBounds.Length != cv)
1437throw host.Except("Normalizer expected {0} slots, but the input data column has {1} slots.", binUpperBounds.Length, cv);
1463Host.Check(dst.Length == _binUpperBounds.Length);
1471Contracts.Assert(input.Length == _binUpperBounds.Length);
1472int size = _binUpperBounds.Length;
1662int binIdx = binUpperBounds.FindIndexSorted(0, binUpperBounds.Length - 1, input);
1663Contracts.Check(binIdx < binUpperBounds.Length);
1673int binIdx = binUpperBounds.FindIndexSorted(0, binUpperBounds.Length - 1, input);
1674Contracts.Check(binIdx < binUpperBounds.Length);
1748var size = Aggregator.Min.Length;
1775var cv = Aggregator.Min.Length;
1945int cv = _aggregator.Mean.Length;
1994int cv = _aggregator.Mean.Length;
2096int size = _values.Length;
2126var count = _values.Length;
2307for (int i = 0; i < _medianAggregators.Length; i++)
2327TFloat[] scale = new TFloat[_medianAggregators.Length];
2328TFloat[] median = new TFloat[_medianAggregators.Length];
2331for (int i = 0; i < _medianAggregators.Length; i++)
Microsoft.ML.DataView (7)
Microsoft.ML.Ensemble (88)
Microsoft.ML.EntryPoints (22)
PermutationFeatureImportance.cs (10)
105Contracts.Assert(slotNames.Length == permutationMetrics.Length,
162Contracts.Assert(slotNames.Length == permutationMetrics.Length,
192ConvertVectorToKnownSize(nameof(metric.PerClassLogLoss), metric.PerClassLogLoss.Length, ref schema);
193ConvertVectorToKnownSize(nameof(metric.PerClassLogLossStdErr), metric.PerClassLogLossStdErr.Length, ref schema);
221Contracts.Assert(slotNames.Length == permutationMetrics.Length,
275Contracts.Assert(slotNames.Length == permutationMetrics.Length,
297ConvertVectorToKnownSize(nameof(metric.DiscountedCumulativeGains), metric.DiscountedCumulativeGains.Length, ref schema);
298ConvertVectorToKnownSize(nameof(metric.NormalizedDiscountedCumulativeGains), metric.NormalizedDiscountedCumulativeGains.Length, ref schema);
299ConvertVectorToKnownSize(nameof(metric.DiscountedCumulativeGainsStdErr), metric.DiscountedCumulativeGainsStdErr.Length, ref schema);
300ConvertVectorToKnownSize(nameof(metric.NormalizedDiscountedCumulativeGainsStdErr), metric.NormalizedDiscountedCumulativeGainsStdErr.Length, ref schema);
Microsoft.ML.FastTree (488)
Dataset\SparseIntArray.cs (15)
104Contracts.Assert(values.Length == deltas.Length);
194public int DeltaLength => _deltas.Length;
202IntArray[] parts = new IntArray[assignment.Length];
203for (int i = 0; i < assignment.Length; ++i)
206parts[i] = IntArray.New(assignment[i].Length, IntArrayType.Sparse, BitsPerItem, assignment[i].Select(x => indexer[x]));
221return IntArray.New(itemIndices.Length, IntArrayType.Sparse, BitsPerItem, itemIndices.Select(x => indexer[x]));
347int currentPos = _deltas.Length > 0 ? _deltas[iSparse] : _length;
357if (++iSparse >= _deltas.Length)
377if (++iSparse >= _deltas.Length)
406int currentPos = _deltas.Length > 0 ? _deltas[iSparse] : _length;
417if (++iSparse >= _deltas.Length)
440if (++iSparse >= _deltas.Length)
474SumupCPlusPlusSparse(input, histogram, (byte*)pValues, pDeltas2, _deltas.Length,
535if (_array._deltas.Length > 0)
589for (int i = 0; i < _deltas.Length; ++i)
FastTree.cs (60)
445for (int i = 0; i < TestSets.Length; ++i)
833for (int t = 0; t < TestSets.Length; ++t)
868Contracts.Check(scores.Length == initScores.Length, "Length of initscores and scores mismatch");
869for (int i = 0; i < scores.Length; i++)
881for (int i = 0; TestSets != null && i < TestSets.Length; i++)
1048for (int i = 1; i < hotFeatureStarts.Length; ++i)
1049hotFeatureStarts[i] = hotFeatureStarts[i - 1] + BinUpperBounds[features[i - 1]].Length - 1;
1050IntArrayBits flockBits = IntArray.NumBitsNeeded(hotFeatureStarts[hotFeatureStarts.Length - 1] + 1);
1060for (int i = 0; i < lastOn.Length; ++i)
1082ch.Assert(bub.Length > 1);
1084ch.Assert(0 < bin && bin < bub.Length); // If 0, should not have been considered "on", so what the heck?
1093for (int f = 0; f < hotFeatureStarts.Length; ++f)
1124for (int i = 1; i < hotFeatureStarts.Length; ++i)
1125hotFeatureStarts[i] = hotFeatureStarts[i - 1] + BinUpperBounds[features[i - 1]].Length - 1;
1126IntArrayBits flockBits = IntArray.NumBitsNeeded(hotFeatureStarts[hotFeatureStarts.Length - 1] + 1);
1135for (int i = 0; i < lastOn.Length; ++i)
1156ch.Assert(bub.Length == 2);
1167for (int f = 0; f < hotFeatureStarts.Length; ++f)
1195ch.Assert(binnedValues.Length == values.Length);
1207var numBitsNeeded = IntArray.NumBitsNeeded(binUpperBounds.Length);
1252double firstBinFrac = (double)firstBinCount / binnedValues.Length;
1254bins = IntArray.New(values.Length, arrayType, IntArray.NumBitsNeeded(binUpperBounds.Length), binnedValues);
1405pch.SetHeader(new ProgressHeader("features"), e => e.SetProgress(0, iFeature, features.Length));
1413Host.Assert(iFeature < features.Length);
1478for (int i = 0; i < lastOn.Length; ++i)
1486if (catRangeIndex < CategoricalFeatureIndices.Length &&
1496if (bup.Length == 1)
1551if (upperBounds.Length == 1)
1566if (upperBounds.Length == 1)
1575FeatureMap = Enumerable.Range(0, NumFeatures).Where(f => BinUpperBounds[f].Length > 1).ToArray();
1621boundaries = new int[qids.Length + 1];
1622for (int i = 0; i < qids.Length; ++i)
1627boundaries[boundaries.Length - 1] = numExamples;
1766for (int i = 0; i < _instanceList.Length; i++)
1939ch.Trace("{0} features stored in {1} flocks.", NumFeatures, flocks.Length);
1951for (int i = 1; i < hotFeatureStarts.Length; ++i)
1952hotFeatureStarts[i] = hotFeatureStarts[i - 1] + BinUpperBounds[features[i - 1]].Length - 1;
1953IntArrayBits flockBits = IntArray.NumBitsNeeded(hotFeatureStarts[hotFeatureStarts.Length - 1] + 1);
1976for (int i = 0; i < kvEnums.Length; ++i)
2030for (int f = 0; f < hotFeatureStarts.Length; ++f)
2040FeatureMap = Enumerable.Range(0, NumFeatures).Where(f => BinUpperBounds[f].Length > 1).ToArray();
2045Contracts.Assert(iFeature + flock.Count <= FeatureMap.Length);
2047int lim = iFeature + flock.Count == FeatureMap.Length
2056ch.Assert(iFeature == FeatureMap.Length);
2080if (bup.Length == 1) // Trivial.
2096for (int i = 0; i < lastOn.Length; ++i)
2102if (catRangeIndex < CategoricalFeatureIndices.Length)
2112if (bup.Length == 1)
2188for (int i = 0; i < lastOn.Length; ++i)
2232if (bup.Length == 1)
2239if (countBins > Utils.ArrayMaxSize - (bup.Length - 1))
2252countBins += bup.Length - 1;
2558IntArrayBits numBitsNeeded = IntArray.NumBitsNeeded(binUpperBounds.Length);
2646Contracts.Assert(0 <= featureIndex && featureIndex < _featureIndices.Length);
2696Contracts.Assert(Utils.IsIncreasing(0, features, values.Length));
2700Utils.EnsureSize(ref workArray, _featureIndices.Length, keepOld: false);
2703Array.Clear(_perFeaturePosition, 0, _featureIndices.Length);
2705_lastRow = new int[features.Length];
2706for (int i = 0; i < _lastRow.Length; ++i)
GamModelParameters.cs (34)
69Host.CheckParam(binUpperBounds.Length == binEffects.Length, nameof(binUpperBounds), "Must have same number of features as binEffects");
70Host.CheckParam(binEffects.Length > 0, nameof(binEffects), "Must have at least one entry");
72Host.CheckParam(shapeToInputMap == null || shapeToInputMap.Length == binEffects.Length, nameof(shapeToInputMap), "Must have same number of features as binEffects");
78NumberOfShapeFunctions = binEffects.Length;
89Host.CheckParam(binUpperBounds[i].Length == binEffects[i].Length, nameof(binEffects), "Array contained wrong number of effect values");
104_inputFeatureToShapeFunctionMap = new Dictionary<int, int>(_shapeToInputMap.Length);
105for (int i = 0; i < _shapeToInputMap.Length; i++)
142_binUpperBounds[i] = reader.ReadDoubleArray(_binEffects[i].Length);
177int diff = _binEffects.Sum(e => e.Take(e.Length - 1).Select((ef, i) => ef != e[i + 1] ? 1 : 0).Sum());
178int bound = _binEffects.Sum(e => e.Length - 1);
183Host.Assert(_binUpperBounds[i].Length == _binEffects[i].Length);
291var binUpperBounds = new double[_binUpperBounds[j].Length];
307binUpperBounds[i] = new double[_binUpperBounds[j].Length];
329var binEffects = new double[_binEffects[j].Length];
345binEffects[i] = new double[_binEffects[j].Length];
392for (int i = 0; i < effects.Length; ++i)
446Host.Check(effects.Length == binThresholds.Length, "Effects array must be same length as binUpperBounds array.");
447var numLeaves = effects.Length;
4890, binIndices.Length - 1, internalNodeIndices, lteChild, gtChild, ref internalNodeId);
643var numFeatures = _pred._binEffects.Length;
647var binDocList = new List<int>[_pred._binEffects[f].Length];
648for (int e = 0; e < _pred._binEffects[f].Length; e++)
675ch.Assert(_scores.Length == _labels.Length);
676if (_labels.Length > 0 && eval != null)
701if (bin < 0 || bin > effects.Length)
820UpperBounds = up.Take(up.Length - 1);
826if (catsMap != null && index < catsMap[catsMap.Length - 1])
828for (int i = 0; i < catsMap.Length; i += 2)
TreeEnsemble\InternalRegressionTree.cs (56)
134Contracts.Assert(indices.Length <= NumNodes);
151Contracts.Assert(indices.Length <= NumNodes);
210CategoricalSplitFeatureRanges = new int[CategoricalSplitFeatures.Length][];
211for (int i = 0; i < CategoricalSplitFeatures.Length; ++i)
213if (CategoricalSplitFeatures[i] != null && CategoricalSplitFeatures[i].Length > 0)
283if (categoricalNodeIndices?.Length > 0)
377Contracts.Assert(CategoricalSplit.Length >= NumNodes);
394CategoricalSplitFeatures[indexLocal].Length > 0);
397CategoricalSplitFeatureRanges[indexLocal].Length == 2);
443checker(GtChild != null && GtChild.Length == numMaxNodes, "bad gtchild");
444checker(LteChild != null && LteChild.Length == numMaxNodes, "bad ltechild");
445checker(SplitFeatures != null && SplitFeatures.Length == numMaxNodes, "bad split feature length");
447(CategoricalSplit.Length == numMaxNodes || CategoricalSplit.Length == NumNodes), "bad categorical split length");
452(CategoricalSplitFeatures.Length == NumNodes ||
453CategoricalSplitFeatures.Length == numMaxNodes),
457(CategoricalSplitFeatureRanges.Length == NumNodes ||
458CategoricalSplitFeatureRanges.Length == numMaxNodes),
461checker(CategoricalSplitFeatureRanges.All(x => x == null || x.Length == 0 || x.Length == 2),
464for (int index = 0; index < CategoricalSplit.Length; index++)
469checker(CategoricalSplitFeatures[index].Length > 0,
475checker(CategoricalSplitFeatureRanges[index].Length == 2,
479for (int featureIndex = 0; featureIndex < CategoricalSplitFeatures[index].Length; featureIndex++)
496checker(Utils.Size(Thresholds) == 0 || Thresholds.Length == numMaxNodes, "bad threshold length");
497checker(Utils.Size(RawThresholds) == 0 || RawThresholds.Length == NumLeaves - 1, "bad rawthreshold length");
500checker(Utils.Size(_splitGain) == 0 || _splitGain.Length == numMaxNodes, "bad splitgain length");
501checker(Utils.Size(_gainPValue) == 0 || _gainPValue.Length == numMaxNodes, "bad gainpvalue length");
502checker(Utils.Size(_previousLeafValue) == 0 || _previousLeafValue.Length == numMaxNodes, "bad previous leaf value length");
503checker(LeafValues != null && LeafValues.Length == numMaxLeaves, "bad leaf value length");
517CategoricalSplit.Length * sizeof(bool) +
534CategoricalSplit.Length.ToByteArray(buffer, ref position);
541for (int i = 0; i < CategoricalSplitFeatures.Length; i++)
558if (LeafValues.Length != tree.LeafValues.Length)
563for (int node = 0; node < LeafValues.Length; ++node)
565if (node < LeafValues.Length - 1 &&
613public int MaxNumLeaves => LeafValues.Length;
618public int MaxNumNodes => LteChild.Length;
675for (int node = 0; node < LeafValues.Length; ++node)
684for (int i = 0; i < LeafValues.Length; ++i)
948if (CategoricalSplitFeatures[node].TryFindIndexSorted(0, CategoricalSplitFeatures[node].Length, index, out int ii))
1115uint numBins = (uint)dataset.Flocks[flock].BinUpperBounds(subfeature).Length;
1136Contracts.Assert(0 <= SplitFeatures[n] && SplitFeatures[n] < oldToNewFeatures.Length);
1142(CategoricalSplitFeatureRanges[n].Length == 2 || CategoricalSplitFeatureRanges[n].Length == 0));
1144for (int i = 0; i < CategoricalSplitFeatures[n].Length; i++)
1147for (int i = 0; i < CategoricalSplitFeatureRanges[n].Length; i++)
1246CategoricalSplitFeatures.Length == 0 ||
1255Contracts.Assert(CategoricalSplitFeatures.Length == NumNodes);
1257for (int i = 0; i < CategoricalSplitFeatures.Length; ++i)
1266int numNonLeaves = CategoricalSplitFeatures[i].Length;
1427int innerLoopSize = 1 + docIndices.Length / BlockingThreadPool.NumThreads; // +1 is to make sure we don't have a few left over at the end
1430var actions = new Action[(int)Math.Ceiling(1.0 * docIndices.Length / innerLoopSize)];
1432for (int d = 0; d < docIndices.Length; d += innerLoopSize)
1435var toDoc = Math.Min(d + innerLoopSize, docIndices.Length);
Utils\ToByteArrayExtensions.cs (20)
255bytes.Length.ToByteArray(buffer, ref position);
256Array.Copy(bytes, 0, buffer, position, bytes.Length);
257position += bytes.Length;
263byte[] allBytes = new byte[bytes.Length + sizeof(int)];
265bytes.Length.ToByteArray(allBytes, ref position);
266Array.Copy(bytes, 0, allBytes, position, bytes.Length);
287a.Length.ToByteArray(buffer, ref position);
288Array.Copy(a, 0, buffer, position, a.Length);
289position += a.Length;
311int length = a.Length;
350int length = a.Length;
433int length = a.Length;
472int length = a.Length;
511int length = a.Length;
550int length = a.Length;
589int length = a.Length;
630a.Length.ToByteArray(buffer, ref position);
631for (int i = 0; i < a.Length; ++i)
641for (int i = 0; i < a.Length; ++i)
673for (int i = 0; i < a.Length; ++i)
Microsoft.ML.GenAI.Core (3)
Microsoft.ML.ImageAnalytics (20)
Microsoft.ML.IntegrationTests (28)
Microsoft.ML.InternalCodeAnalyzer (4)
Microsoft.ML.KMeansClustering (22)
Microsoft.ML.LightGbm (24)
WrappedLightGbmDataset.cs (8)
157Contracts.Assert(labels.Length == GetNumRows());
159LightGbmInterfaceUtils.Check(WrappedLightGbmInterface.DatasetSetField(_handle, "label", (IntPtr)ptr, labels.Length,
167Contracts.Assert(weights.Length == GetNumRows());
170for (int i = 1; i < weights.Length; ++i)
181LightGbmInterfaceUtils.Check(WrappedLightGbmInterface.DatasetSetField(_handle, "weight", (IntPtr)ptr, weights.Length,
192LightGbmInterfaceUtils.Check(WrappedLightGbmInterface.DatasetSetField(_handle, "group", (IntPtr)ptr, groups.Length,
202Contracts.Assert(initScores.Length % GetNumRows() == 0);
204LightGbmInterfaceUtils.Check(WrappedLightGbmInterface.DatasetSetField(_handle, "init_score", (IntPtr)ptr, initScores.Length,
Microsoft.ML.Maml (2)
Microsoft.ML.Mkl.Components (53)
Microsoft.ML.NugetPackageVersionUpdater (1)
Microsoft.ML.OnnxTransformer (20)
Microsoft.ML.OnnxTransformerTest (1)
Microsoft.ML.Parquet (16)
Microsoft.ML.PCA (32)
Microsoft.ML.PerformanceTests (8)
Microsoft.ML.Predictor.Tests (17)
Microsoft.ML.Recommender (9)
Microsoft.ML.ResultProcessor (9)
Microsoft.ML.Samples (24)
Dynamic\Transforms\Text\ProduceHashedNgrams.cs (1)
69.Length);
Dynamic\Transforms\Text\ProduceHashedWordBags.cs (1)
68.Length);
Dynamic\Transforms\Text\ProduceNgrams.cs (1)
77.Length);
Dynamic\Transforms\Text\ProduceWordBags.cs (1)
74.Length);
Dynamic\Transforms\Text\RemoveDefaultStopWords.cs (1)
56.Length);
Dynamic\Transforms\Text\RemoveStopWords.cs (1)
55.Length);
Microsoft.ML.Samples.GPU (1)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (1)
126.Length);
Microsoft.ML.SearchSpace (12)
Microsoft.ML.StandardTrainers (186)
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (31)
296Host.Assert(labelHistogram.Length == featureHistogram.Length);
297Host.Assert(featureHistogram.All(h => h == null || h.Length == featureCount));
301_labelCount = _labelHistogram.Length;
328_labelCount = _labelHistogram.Length;
388int labelCount = labelHistogram.Length;
390for (int iLabel = 0; iLabel < labelHistogram.Length; iLabel += 1)
427float[] featureHistogram = new float[_featureHistogram[0].Length * _labelHistogram.Length];
428float[] labelHistogramExpanded = new float[_featureHistogram[0].Length * _labelHistogram.Length];
430for (int i = 0; i < _featureHistogram.Length; i++)
432Array.Copy(_featureHistogram[i], 0, featureHistogram, i * _featureHistogram[i].Length, _featureHistogram[i].Length);
434for (int i = 0; i < _featureHistogram[0].Length; i++)
436Array.Copy(_labelHistogram, 0, labelHistogramExpanded, i * _featureHistogram.Length, _featureHistogram.Length);
444var labelHistogram = ctx.AddInitializer(labelHistogramExpanded.Take(_labelHistogram.Length), new long[] { _labelHistogram.Length, 1 }, "labelHistogram");
446var featureHistogramName = ctx.AddInitializer(featureHistogram, new long[] { _featureHistogram.Length, _featureHistogram[0].Length }, "featureHistogram");
447var labelHistogramName = ctx.AddInitializer(labelHistogramExpanded, new long[] { _featureHistogram[0].Length, _labelHistogram.Length }, "labelHistogramExpanded");
448var learnedAbsentFeatureLogProb = ctx.AddInitializer(_absentFeaturesLogProb, new long[] { _absentFeaturesLogProb.Length, 1 }, "absentFeaturesLogProb");
451var typeFea = new VectorDataViewType(NumberDataViewType.Single, _featureHistogram[0].Length);
452var typeLabelByFea = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, _featureHistogram[0].Length);
453var typeLabelByOne = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, 1);
455var greaterOutput = ctx.AddIntermediateVariable(new VectorDataViewType(BooleanDataViewType.Instance, _featureHistogram[0].Length), "greaterOutput");
466var isFeaturePresent = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, 1, _featureHistogram[0].Length), "isFeaturePresent");
576var logOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, _featureHistogram[0].Length), "LogOutput");
Standard\MulticlassClassification\OneVersusAllTrainer.cs (48)
155for (int i = 0; i < predictors.Length; i++)
223for (int i = 0; i < predictors.Length; i++)
325var dists = new IValueMapperDist[predictors.Length];
326for (int i = 0; i < predictors.Length; ++i)
363DistType = new VectorDataViewType(NumberDataViewType.Single, _impl.Predictors.Length);
395DistType = new VectorDataViewType(NumberDataViewType.Single, _impl.Predictors.Length);
409for (int i = 0; i < predictors.Length; i++)
425ctx.Writer.Write(preds.Length);
428for (int i = 0; i < preds.Length; i++)
462writer.WriteLine("double[] outputs = new double[{0}];", preds.Length);
464for (int i = 0; i < preds.Length; i++)
483for (int i = 0; i < preds.Length; i++)
538string[] outputs = new string[Predictors.Length];
542for (int i = 0; i < Predictors.Length; i++)
544var predictorOutputNames = new string[localOutputNames.Length];
573Contracts.Assert(outputNames.Length >= 2);
607Predictors = new IValueMapper[predictors.Length];
609for (int i = 0; i < predictors.Length; i++)
623var maps = new ValueMapper<VBuffer<float>, float>[Predictors.Length];
624for (int i = 0; i < Predictors.Length; i++)
627var buffer = new float[maps.Length];
636Parallel.For(0, maps.Length, i => maps[i](in tmp, ref buffer[i]));
638var editor = VBufferEditor.Create(ref dst, maps.Length);
651for (int i = 0; i < Predictors.Length; ++i)
668var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length);
691_mappers = new IValueMapperDist[predictors.Length];
693for (int i = 0; i < predictors.Length; i++)
716var maps = new ValueMapper<VBuffer<float>, float, float>[Predictors.Length];
717for (int i = 0; i < Predictors.Length; i++)
720var buffer = new float[maps.Length];
729Parallel.For(0, maps.Length,
740NormalizeSumToOne(buffer, maps.Length);
742var editor = VBufferEditor.Create(ref dst, maps.Length);
778for (int i = 0; i < Predictors.Length; ++i)
794Contracts.Assert(outputNames.Length >= 2);
826string[] divOutputs = new string[Predictors.Length];
827for (int i = 0; i < Predictors.Length; i++)
835var type = new VectorDataViewType(NumberDataViewType.Single, divOutputs.Length);
856Predictors = new IValueMapper[predictors.Length];
858for (int i = 0; i < predictors.Length; i++)
872var maps = new ValueMapper<VBuffer<float>, float>[Predictors.Length];
873for (int i = 0; i < Predictors.Length; i++)
876var buffer = new float[maps.Length];
885Parallel.For(0, maps.Length, i => maps[i](in tmp, ref buffer[i]));
886NormalizeSoftmax(buffer, maps.Length);
888var editor = VBufferEditor.Create(ref dst, maps.Length);
916Contracts.Assert(outputNames.Length >= 2);
924var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length);
Standard\SdcaBinary.cs (14)
546featureNormSquared = InitializeFeatureNormSquared(invariants.Length);
557ch.Assert(metricNames.Length == metrics.Length);
569Func<DataViewRowId, long, long> getIndexFromIdAndRow = GetIndexFromIdAndRowGetter(idToIdx, biasReg.Length);
580Contracts.Assert(0 <= longIdx && longIdx < invariants.Length, $"longIdx={longIdx}, invariants.Length={invariants.Length}");
811Func<DataViewRowId, long> getIndexFromId = GetIndexFromIdGetter(idToIdx, biasReg.Length);
964var reportedValues = new Double?[metrics.Length + 1];
965reportedValues[metrics.Length] = iter;
974Func<DataViewRowId, long, long> getIndexFromIdAndRow = GetIndexFromIdAndRowGetter(idToIdx, biasReg.Length);
1007metrics[(int)MetricKind.L1Sparsity] = SdcaTrainerOptions.L1Regularization == 0 ? 1 : (Double)firstWeights.GetValues().Count(w => w != 0) / weights.Length;
1023for (int i = 0; i < metrics.Length; i++)
1058public override long Length => _duals.Length;
1403for (int i = 0; i < Primes.Length; i++)
Standard\SdcaMulticlass.cs (14)
200Func<DataViewRowId, long> getIndexFromId = GetIndexFromIdGetter(idToIdx, biasReg.Length);
359int numClasses = weights.Length;
366var reportedValues = new Double?[metrics.Length + 1];
367reportedValues[metrics.Length] = iter;
375Func<DataViewRowId, long, long> getIndexFromIdAndRow = GetIndexFromIdAndRowGetter(idToIdx, biasReg.Length);
459for (int i = 0; i < metrics.Length; i++)
558Host.CheckParam(weights.Length > 0, nameof(weights));
559Host.CheckParam(weights.Length == bias.Length, nameof(weights));
561return new MaximumEntropyModelParameters(Host, weights, bias, bias.Length, weights[0].Length, null, stats: null);
655Host.CheckParam(weights.Length > 0, nameof(weights));
656Host.CheckParam(weights.Length == bias.Length, nameof(weights));
658return new LinearMulticlassModelParameters(Host, weights, bias, bias.Length, weights[0].Length, null, stats: null);
Microsoft.ML.Sweeper (86)
Algorithms\KdoSweeper.cs (35)
113var numSweeps = Math.Min(numOfCandidates, _args.NumberInitialPopulation - prevRuns.Length);
117if (prevRuns.Length < _args.NumberInitialPopulation)
125} while (rcs.Length < 1 && attempts < 100);
128if (rcs.Length == 0)
141if (viableRuns.Length == 0 && prevRuns.Length > 0)
161int totalHistoryLength = history.Length;
164if (history.Length > _args.HistoryLength)
179_host.Assert(history.Length == weights.Length && parentIndicies.Max() < history.Length);
182for (int i = 0; i < parentIndicies.Length; i++)
185children.Add(SampleChild(parent.ParameterSet, parent.MetricValue, history.Length, previousRuns, rMean, rVar, parent.IsMetricMaximizing));
219for (int i = 0; i < _sweepParameters.Length; i++)
251double[] stddevs = Enumerable.Repeat(_args.Simple ? 0.2 : bandwidthScale, mu.Length).ToArray();
254for (int j = 0; j < sampledPoint.Length; j++)
297int d = stddevs.Length;
323double[] weights = new double[history.Length];
325for (int i = 0; i < history.Length; i++)
329bool isMinimizing = history.Length > 0 && !history[0].IsMetricMaximizing;
336for (int i = 0; i < weights.Length; i++)
373for (int i = 0; i < weights.Length; i++)
381for (int i = 0; i < weights.Length; i++)
406for (int i = 0; i < weights.Length; i++)
454int d = mu.Length;
455_host.Assert(d > 0 && diagonalCovariance.Length == d);
458_host.Assert(diagonalCovariance[i].Length == d);
476for (int i = 0; i < points.Length; i++)
479points[i] = VectorTransformAdd(mu, _spu.NormalRVs(mu.Length, 0, 1), a);
487int d = m.Length;
502if (x.Length != y.Length)
503return x.Length > y.Length ? 1 : -1;
505for (int i = 0; i < x.Length; i++)
Algorithms\SmacSweeper.cs (19)
130_host.Assert(view.GetRowCount() == targets.Length, "This data view will have as many rows as there have been evaluations");
171ParameterSet[] randomChallengers = _randomSweeper.ProposeSweeps(numOfCandidates - eiChallengers.Length, previousRuns);
175ParameterSet[] configs = new ParameterSet[eiChallengers.Length + randomChallengers.Length];
176Array.Copy(eiChallengers, 0, configs, 0, eiChallengers.Length);
177Array.Copy(randomChallengers, 0, configs, eiChallengers.Length, randomChallengers.Length);
211_host.Assert(randomConfigs.Length == randomEIs.Length);
213for (int i = 0; i < randomConfigs.Length; i++)
273for (int i = 0; i < _sweepParameters.Length; i++)
344VBuffer<float> features = new VBuffer<float>(transformedParams.Length, transformedParams);
360double[][] meansAndStdDevs = new double[leafValues.Length][];
361for (int i = 0; i < leafValues.Length; i++)
413double[] eis = new double[forestStatistics.Length];
414for (int i = 0; i < forestStatistics.Length; i++)
424for (int i = 0; i < _sweepParameters.Length; i++)
439_host.Assert(parameterSet.Count == _sweepParameters.Length);
440_host.Assert(index >= 0 && index <= _sweepParameters.Length);
Microsoft.ML.Sweeper.Tests (14)
Microsoft.ML.TensorFlow (52)
Microsoft.ML.TensorFlow.Tests (19)
TensorflowTests.cs (19)
320Assert.Equal(sample.OneDim.Length, oneDimValues.Length);
324Assert.Equal(sample.TwoDim.Length, twoDimValues.Length);
328Assert.Equal(sample.ThreeDim.Length, threeDimValues.Length);
332Assert.Equal(sample.FourDim.Length, fourDimValues.Length);
336Assert.Equal(sample.FourDimKnown.Length, fourDimKnownValues.Length);
763if (directories != null && directories.Length > 0)
971for (int i = 0; i < onePrediction.PredictedLabels.Length; i++)
1205for (var i = 0; i < predictions.Length; i++)
1207for (var j = 0; j < predictions[i].PredictedScores.Length; j++)
1298Assert.Equal(2, prediction.Prediction.Length);
1361for (int i = 0; i < input.A.Length; i++)
1552string[] labels = new string[directories.Length];
1553for (int j = 0; j < labels.Length; j++)
1581Assert.Equal((int)labelCountFirst, predictionFirst.Score.Length);
1582Assert.Equal((int)labelCountSecond, predictionSecond.Score.Length);
1711string[] labels = new string[directories.Length];
1712for (int j = 0; j < labels.Length; j++)
1740Assert.Equal((int)labelCountFirst, predictionFirst.Score.Length);
1741Assert.Equal((int)labelCountSecond, predictionSecond.Score.Length);
Microsoft.ML.TestFramework (25)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.ML.Tests (80)
Microsoft.ML.TimeSeries (110)
SrCnnEntireAnomalyDetector.cs (39)
182return col => 0 <= col && col < active.Length && active[col];
485results = new double[values.Length][];
486for (int i = 0; i < results.Length; ++i)
491else if (results.Length > values.Length)
493Array.Resize<double[]>(ref results, values.Length);
502Array.Resize(ref _seriesToDetect, values.Length);
503for (int i = 0; i < values.Length; ++i)
513_mean = sum / values.Length;
514_std = Math.Sqrt((squareSum - (sum * sum) / values.Length) / values.Length);
554int length = _backAddArray.Length;
613AverageFilter(_ifftMagList, Math.Min(_ifftMagList.Length, _judgementWindowSize));
651for (int i = data.Length - _lookaheadWindowSize - 2; i < data.Length - 1; ++i)
656Array.Resize(ref _backAddArray, data.Length + _backAddWindowSize);
657for (int i = 0; i < data.Length; ++i)
663_backAddArray[data.Length + i] = predictedValue;
669var n = data.Length;
681int length = data.Length;
718for (int i = 0; i < results.Length; ++i)
727for (int i = 0; i < values.Length; ++i)
741for (int i = 0; i < results.Length; ++i)
756for (int i = 0; i < values.Length; ++i)
783for (int i = 0; i < values.Length; ++i)
813for (int i = 0; i < results.Length; ++i)
837for (int i = 0; i < results.Length; ++i)
888for (int i = 0; i < scores.Length; ++i)
899Array.Resize(ref _deAnomalyData, data.Length);
900Array.Copy(data, _deAnomalyData, data.Length);
906int end = Math.Min(data.Length - 1, idx + step);
917while (fitValues.Count < minPointsToFit && (start > 0 || end < data.Length - 1))
921end = Math.Min(data.Length - 1, idx + step);
955int length = data.Length;
977int window = Math.Min(data.Length / 3, 512);
984for (int i = 0; i < _trends.Length; ++i)
1004Array.Resize(ref _units, _trends.Length);
1005for (int i = 0; i < _units.Length; ++i)
1025int tLen = data.Length;
TrajectoryMatrix.cs (7)
120_ectx.Check(data.Length >= seriesLength, "The series length cannot be greater than the data length.");
150FftUtils.ComputeForwardFft(_inputRe, _allZerosIm, _cachedSeriesFftRe, _cachedSeriesFftIm, _inputRe.Length);
176FftUtils.ComputeForwardFft(_inputRe, _allZerosIm, _cachedSeriesFftRe, _cachedSeriesFftIm, _inputRe.Length);
312FftUtils.ComputeForwardFft(_inputRe, _allZerosIm, _outputRe, _outputIm, _inputRe.Length);
327FftUtils.ComputeBackwardFft(_outputRe, _outputIm, _outputRe, _outputIm, _inputRe.Length);
416FftUtils.ComputeForwardFft(_inputRe, _allZerosIm, _outputRe, _outputIm, _inputRe.Length);
431FftUtils.ComputeBackwardFft(_outputRe, _outputIm, _outputRe, _outputIm, _inputRe.Length);
Microsoft.ML.TimeSeries.Tests (6)
Microsoft.ML.Tokenizers (52)
Microsoft.ML.Tokenizers.Tests (201)
BpeTests.cs (29)
261Assert.Equal(expectedTokens.Length, encoding.Count);
262Assert.Equal(offsets.Length, encoding.Count);
263Assert.Equal(ids.Length, encoding.Count);
264Assert.Equal(ids.Length, idsList.Count);
265Assert.Equal(ids.Length, tokenizer.CountTokens(sentence));
304for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
308Assert.True(idsConsumed < ids.Length);
318Assert.Equal(ids.Length, idsConsumed);
442Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedString, out int length));
445Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedString, out length));
449Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text, expectedIds.Length - 2, out normalizedString, out length));
451int expectedLength = expectedOffsets[expectedOffsets.Length - 3].Index + expectedOffsets[expectedOffsets.Length - 3].Length;
453Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 2, out normalizedString, out length));
457Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text));
458Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan()));
460Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 3, out normalizedString, out int tokenCount));
462Assert.Equal(expectedIds.Length - 3, tokenCount);
463Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedString, out tokenCount));
465Assert.Equal(expectedIds.Length - 3, tokenCount);
467Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 3, out normalizedString, out tokenCount));
470Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedString, out tokenCount));
CodeGenTests.cs (68)
312for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
316Assert.True(idsConsumed < ids.Length);
326Assert.Equal(ids.Length, idsConsumed);
379Assert.Equal(ids, codeGenTokenizer.EncodeToIds(text, ids.Length, out string? normalizedString, out int length));
382Assert.Equal(ids, codeGenTokenizer.EncodeToIds(text.AsSpan(), ids.Length, out normalizedString, out length));
386Assert.Equal(expectedIds, codeGenTokenizer.EncodeToIds(text, expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length));
389Assert.Equal(expectedIds, codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length));
393Assert.Equal(expectedIdsWithSpace, codeGenTokenizer.EncodeToIds(text, expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length));
396Assert.Equal(expectedIdsWithSpace, codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length));
400int expectedTokensToExclude = expectedOffsets.Length > 1 && expectedOffsets[expectedOffsets.Length - 1].Index == expectedOffsets[expectedOffsets.Length - 2].Index ? 2 : 1;
401Assert.Equal(ids.Take(ids.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text, ids.Length - 1, out normalizedString, out length));
404int expectedLength = offsets.Length > expectedTokensToExclude ? offsets[offsets.Length - expectedTokensToExclude - 1].Index + offsets[offsets.Length - expectedTokensToExclude - 1].Length : 0;
406Assert.Equal(ids.Take(ids.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), ids.Length - 1, out normalizedString, out length));
410Assert.Equal(expectedIds.Take(expectedIds.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text, expectedIds.Length - 1, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length));
413Assert.Equal(expectedIds.Take(expectedIds.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 1, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length));
417Assert.Equal(expectedIdsWithSpace.Take(expectedIdsWithSpace.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text, expectedIdsWithSpace.Length - 1, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length));
420Assert.Equal(expectedIdsWithSpace.Take(expectedIdsWithSpace.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIdsWithSpace.Length - 1, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length));
428Assert.Equal(ids.Length, codeGenTokenizer.CountTokens(text));
429Assert.Equal(ids.Length, codeGenTokenizer.CountTokens(text.AsSpan()));
431Assert.Equal(expectedIds.Length, codeGenTokenizer.CountTokens(text, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false));
432Assert.Equal(expectedIds.Length, codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false));
434Assert.Equal(expectedIdsWithSpace.Length, codeGenTokenizer.CountTokens(text, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false));
435Assert.Equal(expectedIdsWithSpace.Length, codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false));
443Assert.Equal(offsets[offsets.Length - 1].Index + offsets[offsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text, ids.Length, out normalizedString, out int tokenCount));
445Assert.Equal(ids.Length, tokenCount);
446Assert.Equal(offsets[offsets.Length - 1].Index + offsets[offsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), ids.Length, out normalizedString, out tokenCount));
448Assert.Equal(ids.Length, tokenCount);
450Assert.Equal(expectedOffsets[expectedOffsets.Length - 1].Index + expectedOffsets[expectedOffsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text, expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out tokenCount));
452Assert.Equal(expectedIds.Length, tokenCount);
453Assert.Equal(expectedOffsets[expectedOffsets.Length - 1].Index + expectedOffsets[expectedOffsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out tokenCount));
455Assert.Equal(expectedIds.Length, tokenCount);
457Assert.Equal(expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index + expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text, expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out tokenCount));
459Assert.Equal(expectedIdsWithSpace.Length, tokenCount);
460Assert.Equal(expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index + expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out tokenCount));
462Assert.Equal(expectedIdsWithSpace.Length, tokenCount);
468int expectedIndex = offsets.Length > 1 && offsets[offsets.Length - 1].Index == offsets[offsets.Length - 2].Index ? text.Length : offsets[offsets.Length - 1].Index;
484expectedIndex = offsets.Length > 1 && expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index == expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 2].Index ? text.Length : expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index;
501for (int i = 0; i < tokens.Length; i++)
1017calculatedLengthUsingOffsets = expectedTokenCountFromEnd > 0 ? offsets[offsets.Length - expectedTokenCountFromEnd].Index : input.Length;
EnglishRobertaTests.cs (26)
194Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedString, out int length));
197Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedString, out length));
201Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text, expectedIds.Length - 2, out normalizedString, out length));
203int expectedLength = expectedOffsets[expectedOffsets.Length - 3].Index + expectedOffsets[expectedOffsets.Length - 3].Length;
205Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 2, out normalizedString, out length));
209Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text));
210Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan()));
212Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 3, out normalizedString, out int tokenCount));
214Assert.Equal(expectedIds.Length - 3, tokenCount);
215Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedString, out tokenCount));
217Assert.Equal(expectedIds.Length - 3, tokenCount);
219Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 3, out normalizedString, out tokenCount));
222Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedString, out tokenCount));
272Assert.Equal(((int[])p[1]).Length, idsCount);
289for (int i = 0; i < tokens.Length; i++)
317for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
321Assert.True(idsConsumed < ids.Length);
329Assert.Equal(ids.Length, idsConsumed);
LlamaTests.cs (42)
251Assert.Equal(ids.Length, llamaTokenizer.CountTokens(input));
255for (int i = 0; i < tokens.Length; i++)
274Assert.Equal(isEmptyInput ? 0 : ids.Length - 1, bpe.CountTokens(normalizedInput.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false));
284Assert.Equal(isEmptyInput ? 0 : ids.Length, bpe.CountTokens(normalizedInput.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: true, considerNormalization: false));
294Assert.Equal(isEmptyInput ? 0 : ids.Length + 1, bpe.CountTokens(normalizedInput.AsSpan(), addBeginningOfSentence: true, addEndOfSentence: true, considerNormalization: false));
308for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
312Assert.True(idsConsumed < ids.Length);
322Assert.Equal(ids.Length, idsConsumed);
558Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedString, out int length));
561Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedString, out length));
579expectedIds1.Length,
588expectedIds1.Length,
596Assert.Equal(expectedIds1.Take(expectedIds1.Length - 6), sentencePieceBpe.EncodeToIds(
600expectedIds1.Length - 6,
606(int Index, int Length)[] expectedOffsets1 = addBeginningOfSentence ? expectedOffsets.Take(expectedIds1.Length - 6).ToArray() : expectedOffsets.Skip(1).Take(expectedIds1.Length - 6).ToArray();
608int expectedLength = expectedOffsets1[expectedOffsets1.Length - 1].Index + expectedOffsets1[expectedOffsets1.Length - 1].Length;
611Assert.Equal(expectedIds1.Take(expectedIds1.Length - 6), sentencePieceBpe.EncodeToIds(
615expectedIds1.Length - 6,
632Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text));
633Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan()));
635Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index + expectedOffsets[expectedOffsets.Length - 7].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 6, out string? normalizedString, out int tokenCount));
637Assert.Equal(expectedIds.Length - 6, tokenCount);
638Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index + expectedOffsets[expectedOffsets.Length - 7].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 6, out normalizedString, out tokenCount));
640Assert.Equal(expectedIds.Length - 6, tokenCount);
642Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 7, out normalizedString, out tokenCount));
645Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 7, out normalizedString, out tokenCount));
697accumulatedStringFromEnd = (encodedTokens.Count == i ? DummyPrefix : (i % 2 == 0 ? $"{DummyPrefix}Hello" : specialTokens[specialTokens.Length - 1 - (i / 2)])) + accumulatedStringFromEnd;
846for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
860for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
885for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
899for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
TiktokenTests.cs (34)
168for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
172Assert.True(idsConsumed < ids.Length);
182Assert.Equal(ids.Length, idsConsumed);
581Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedString, out int length));
584Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedString, out length));
588Assert.Equal(expectedIds.Take(expectedIds.Length - 4), tokenizer.EncodeToIds(text, expectedIds.Length - 4, out normalizedString, out length));
590int expectedLength = expectedOffsets[expectedOffsets.Length - 5].Index + expectedOffsets[expectedOffsets.Length - 5].Length;
592Assert.Equal(expectedIds.Take(expectedIds.Length - 4), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 4, out normalizedString, out length));
596Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text));
597Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan()));
599Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 3, out normalizedString, out int tokenCount));
601Assert.Equal(expectedIds.Length - 3, tokenCount);
602Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedString, out tokenCount));
604Assert.Equal(expectedIds.Length - 3, tokenCount);
606Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 3, out normalizedString, out tokenCount));
609Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedString, out tokenCount));
690Assert.Equal(expectedIds.Length, GPT4.CountTokens(text));
692for (int tokenCount = 1; tokenCount <= ids.Length; tokenCount++)
695Assert.True(count <= ids.Length);
699Assert.True(count < ids.Length - 1);
713Assert.True(count <= ids.Length);
717Assert.True(ids.Length - tokenCount > 0);
718Assert.True(offsets[offsets.Length - tokenCount].Index < offsets[offsets.Length - tokenCount - 1].Index + offsets[offsets.Length - tokenCount - 1].Length);
723Assert.Equal(offsets[offsets.Length - count].Index, index);
Microsoft.ML.TorchSharp (33)
AutoFormerV2\Anchors.cs (6)
67for (int idx = 0; idx < this.pyramidLevels.Length; ++idx)
100var numAnchors = ratios.Length * scales.Length;
106anchors[RangeUtil.ToTensorIndex(..), RangeUtil.ToTensorIndex(2..)] = baseSize * torch.tile(scales, new long[] { 2, ratios.Length }).transpose(1, 0);
112anchors[RangeUtil.ToTensorIndex(..), 2] = torch.sqrt(areas / torch.repeat_interleave(ratios, new long[] { scales.Length }));
113anchors[RangeUtil.ToTensorIndex(..), 3] = torch.mul(anchors[RangeUtil.ToTensorIndex(..), 2], torch.repeat_interleave(ratios, new long[] { scales.Length }));
Microsoft.ML.Transforms (486)
Microsoft.ML.Vision (59)
DnnRetrainTransform.cs (55)
277var inputsForTraining = new string[_inputs.Length + 1];
278var inputColIndices = new int[inputsForTraining.Length];
279var isInputVector = new bool[inputsForTraining.Length];
280var tfInputTypes = new TF_DataType[inputsForTraining.Length];
281var tfInputShapes = new TensorShape[inputsForTraining.Length];
283for (int i = 0; i < _inputs.Length; i++)
287for (int i = 0; i < inputsForTraining.Length - 1; i++)
291var index = inputsForTraining.Length - 1;
303tfInputs = new TF_Output[_tfInputNodes.Length + 2]; //Inputs + Label + Learning Rate.
305tfInputs = new TF_Output[_tfInputNodes.Length + 1]; //Inputs + Label.
307Array.Copy(_tfInputNodes, tfInputs, _tfInputNodes.Length);
309tfInputs[_tfInputNodes.Length] = new TF_Output(labelOp, labelOpIdx);
311tfInputs[_tfInputNodes.Length + 1] = new TF_Output(lr.Item1, lr.Item2);
347for (int i = 0; i < inputsForTraining.Length; i++)
381for (int i = 0; i < inputs.Length; i++)
385if (tensor.Length > 0 && tensor[0] != IntPtr.Zero)
391if (tensor.Length > 1 && tensor[1] != IntPtr.Zero)
431if (tmpParamDir != null && tmpParamDir.Length > 0)
454if (tmpParamDir != null && tmpParamDir.Length > 0)
486var srcTensorGetters = new ITensorValueGetter[inputColIndices.Length];
487for (int i = 0; i < inputColIndices.Length; i++)
512for (int j = 0; j < inputs.Length; j++)
518for (int j = 0; j < outputs.Length; j++)
551_tfInputNodes = new TF_Output[_inputs.Length];
552_tfOutputNodes = new TF_Output[_outputs.Length];
554for (int index = 0; index < _tfInputOperations.Length; index += 1)
557for (int index = 0; index < _tfOutputOperations.Length; index += 1)
579var tfInputTypes = new TF_DataType[inputs.Length];
580var tfInputShapes = new TensorShape[inputs.Length];
581var tfInputOperations = new (Operation, int)[inputs.Length];
619c_api.TF_GraphGetTensorShape(graph, output, dims, dims.Length, cstatus.Handle);
626var tfOutputTypes = new TF_DataType[outputs.Length];
627var outputTypes = new DataViewType[outputs.Length];
629var tfOutputOperations = new (Operation, int)[outputs.Length];
631for (int i = 0; i < outputs.Length; i++)
649for (int j = 0; j < dims.Length; j++)
651if (dims == null || dims.Length == 0)
692ctx.Writer.Write(_inputs.Length);
697ctx.Writer.Write(_outputs.Length);
711w.Write(modelFilePaths.Length);
771_inputColIndices = new int[_parent._inputs.Length];
772_isInputVector = new bool[_parent._inputs.Length];
773_fullySpecifiedShapes = new TensorShape[_parent._inputs.Length];
774for (int i = 0; i < _parent._inputs.Length; i++)
794if (shape == null || (shape.Length == 0))
834for (int ishape = 1; ishape < l.Length; ishape++)
933for (int i = 0; i < _parent._inputs.Length; i++)
940for (int j = 0; j < activeOutputColNames.Length; j++)
949return col => Enumerable.Range(0, _parent._outputs.Length).Any(i => activeOutput(i)) && _inputColIndices.Any(i => i == col);
954var info = new DataViewSchema.DetachedColumn[_parent._outputs.Length];
955for (int i = 0; i < _parent._outputs.Length; i++)
986if (tfShape.dims.Length != 0)
1071if (tfShape.dims.Length != 0)
1258for (var i = 0; i < _options.InputColumns.Length; i++)
1269for (var i = 0; i < _options.OutputColumns.Length; i++)
Microsoft.Net.Http.Headers (3)
Microsoft.Net.Http.Headers.Tests (15)
Microsoft.NET.StringTools.net35.UnitTests (3)
Microsoft.NET.StringTools.UnitTests (3)
Microsoft.TestUtilities (1)
Microsoft.VisualBasic.Core (328)
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (54)
124If members Is Nothing OrElse members.Length = 0 Then
179(Arguments IsNot Nothing AndAlso Arguments.Length > 0) _
245reportErrors OrElse arguments.Length <> 0 OrElse baseReference.IsArray,
296If argumentNames.Length > 0 Then
332reportErrors = reportErrors OrElse arguments.Length <> 0 OrElse baseReference.IsArray
344Return argumentNames.Length = 0
354For index As Integer = 0 To copyBack.Length - 1
433If typeArguments.Length > 0 Then
438If arguments.Length = 0 Then
447If argumentNames.Length > arguments.Length OrElse
448(copyBack IsNot Nothing AndAlso copyBack.Length <> arguments.Length) Then
468ElseIf arguments.Length > 0 AndAlso members.Length = 1 AndAlso IsZeroArgumentCall(members(0)) Then
534If members Is Nothing OrElse members.Length = 0 Then
560If arguments.Length > 0 AndAlso members.Length = 1 AndAlso IsZeroArgumentCall(members(0)) Then
590DirectCast(member, MethodInfo).GetParameters().Length = 0) OrElse
592DirectCast(member, PropertyInfo).GetIndexParameters().Length = 0))
649If argumentNames.Length > 0 Then
657If argumentNames.Length > arguments.Length Then
661If arguments.Length < 1 Then
743Return argumentNames.Length = 0
750If members Is Nothing OrElse members.Length = 0 Then
964If members.Length = 0 And OptimisticSet Then
970If TypeArguments.Length > 0 Then
974If Arguments.Length = 1 Then
995If ArgumentNames.Length > Arguments.Length Then
1002If TypeArguments.Length = 0 Then
1071If TypeArguments.Length = 0 Then
1108If members Is Nothing OrElse members.Length = 0 Then
1113If arguments.Length = 1 AndAlso rValueBase AndAlso baseReference.IsValueType Then
1189If argumentNames.Length > arguments.Length OrElse
1190(copyBack IsNot Nothing AndAlso copyBack.Length <> arguments.Length) Then
1200If HasFlag(invocationFlags, BindingFlagsSetProperty) AndAlso arguments.Length < 1 Then
1213If members Is Nothing OrElse members.Length = 0 Then
1295Debug.Assert(members IsNot Nothing AndAlso members.Length > 0, "expected members")
1299argumentNames.Length <= arguments.Length,
1320Dim argumentCount As Integer = arguments.Length
1324If arguments.Length = 0 Then
1337System.Array.Copy(savedArguments, arguments, arguments.Length)
1432Dim lastParameter As ParameterInfo = parameters(parameters.Length - 1)
1497Dim callArguments As Object() = New Object(parameters.Length - 1) {}
1500Dim argumentCount As Integer = arguments.Length
1504Debug.Assert(arguments.Length > 0, "must have an argument for property set Value")
1507System.Array.Copy(savedArguments, arguments, arguments.Length)
1517Dim lastParameter As ParameterInfo = parameters(parameters.Length - 1)
1518callArguments(parameters.Length - 1) =
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (74)
48If leftSignature.Length >= rightSignature.Length Then
59For index As Integer = shorterSignature.Length To longerSignature.Length - 1
65For i As Integer = 0 To shorterSignature.Length - 1
493Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!")
728Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!")
732typeArgumentCount = typeArguments.Length
735Dim candidates As List(Of Method) = New List(Of Method)(members.Length)
737If members.Length = 0 Then
793candidateSignature = New ParameterInfo(setParameters.Length - 2) {}
794System.Array.Copy(setParameters, candidateSignature, candidateSignature.Length)
894Loop While index < members.Length AndAlso members(index).DeclaringType Is currentScope
896Loop While keepSearching AndAlso index < members.Length
1171Debug.Assert(parameterTypeParameters.Length = argumentTypeArguments.Length,
1174For index As Integer = 0 To argumentTypeArguments.Length - 1
1385Do While paramIndex < parameters.Length
1432If typeArguments.Length = 0 Then
1449Debug.Assert(arguments.Length <= parameters.Length OrElse
1453Dim argIndex As Integer = argumentNames.Length
1458Do While argIndex < arguments.Length
1497If argIndex = arguments.Length - 1 AndAlso arguments(argIndex) Is Nothing Then
1503Do While argIndex < arguments.Length
1527Debug.Assert(arguments.Length - argIndex <= 1,
1531If arguments.Length - argIndex <> 1 Then
1570If argumentNames.Length > 0 OrElse paramIndex < parameters.Length Then
1571matchedParameters = CreateMatchTable(parameters.Length, paramIndex - 1)
1576If argumentNames.Length > 0 Then
1578Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this.
1590Dim namedArgumentMapping As Integer() = New Integer(argumentNames.Length - 1) {}
1593Do While argIndex < argumentNames.Length
1646For index As Integer = 0 To matchedParameters.Length - 1
1672Debug.Assert(typeArguments.Length = targetProcedure.TypeParameters.Length, "expected length match")
1676For typeArgumentIndex As Integer = 0 To typeArguments.Length - 1
1717Debug.Assert(matchedArguments.Length = parameters.Length OrElse
1718matchedArguments.Length = parameters.Length + 1,
1720Debug.Assert(arguments.Length <= parameters.Length OrElse
1727If namedArgumentMapping IsNot Nothing Then argIndex = namedArgumentMapping.Length
1732Do While argIndex < arguments.Length
1754Dim remainingArgumentCount As Integer = arguments.Length - argIndex
1762Do While argIndex < arguments.Length
1775Debug.Assert(arguments.Length - argIndex = 1,
1795If namedArgumentMapping IsNot Nothing OrElse paramIndex < parameters.Length Then
1796matchedParameters = CreateMatchTable(parameters.Length, paramIndex - 1)
1803Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this.
1816Do While argIndex < namedArgumentMapping.Length
1832For index As Integer = 0 To matchedParameters.Length - 1
1857Debug.Assert(arguments.Length <= parameters.Length OrElse
1861Dim argIndex As Integer = argumentNames.Length
1866Do While argIndex < arguments.Length
1895Do While argIndex < arguments.Length
1915Debug.Assert(arguments.Length - argIndex <= 1,
1918If arguments.Length - argIndex <> 1 Then
1940If argumentNames.Length > 0 Then
1942Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this.
1945Do While argIndex < argumentNames.Length
1995For index As Integer = 0 To copyBack.Length - 1
2006Debug.Assert(copyBack.Length = arguments.Length, "array sizes must match")
2007Debug.Assert(parameterResults.Length = targetProcedure.Parameters.Length, "parameter arrays must match")
2013If namedArgumentMapping IsNot Nothing Then argIndex = namedArgumentMapping.Length
2018Do While argIndex < arguments.Length
2039Do While argIndex < namedArgumentMapping.Length
2166Dim argIndex As Integer = argumentNames.Length
2167Do While argIndex < arguments.Length
2231Do While argIndex < argumentNames.Length
2825arguments.Length,
Microsoft\VisualBasic\FileIO\FileSystem.vb (22)
756FileStream.Write(data, 0, data.Length)
1286ByteCount = FileStream.Read(ByteBuffer, 0, ByteBuffer.Length)
1311Dim AdditionalByteCount As Integer = FileStream.Read(ByteBuffer, ByteCount, ByteBuffer.Length - ByteCount)
1313Debug.Assert(ByteCount <= ByteBuffer.Length)
1323ByteCount = FileStream.Read(ByteBuffer, 0, ByteBuffer.Length)
1400If wildcards Is Nothing OrElse wildcards.Length = 0 Then
1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1")
1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1,
2189ByteBufferStartIndex = m_Preamble.Length
2190Count -= m_Preamble.Length ' Reduce the valid byte count if ByteBuffer was shrunk.
2203Dim CharBuffer(m_PreviousCharBuffer.Length + ExpectedCharCount - 1) As Char
2206destinationArray:=CharBuffer, destinationIndex:=0, length:=m_PreviousCharBuffer.Length)
2210chars:=CharBuffer, charIndex:=m_PreviousCharBuffer.Length)
2214If CharBuffer.Length > m_SearchText.Length Then
2215If m_PreviousCharBuffer.Length <> m_SearchText.Length Then
2218Array.Copy(sourceArray:=CharBuffer, sourceIndex:=(CharBuffer.Length - m_SearchText.Length),
2245Debug.Assert(BigBuffer.Length > SmallBuffer.Length, "BigBuffer should be longer")
2246If BigBuffer.Length < SmallBuffer.Length Or SmallBuffer.Length = 0 Then
2249For i As Integer = 0 To SmallBuffer.Length - 1
Microsoft.VisualBasic.Forms (3)
Microsoft.VisualBasic.Forms.Tests (8)
Microsoft.VisualBasic.Tests (15)
Microsoft.VisualStudio.LanguageServices (53)
Microsoft.VisualStudio.LanguageServices.CSharp (16)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (2)
Microsoft.VisualStudio.LanguageServices.UnitTests (28)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
MinimalSample (1)
MSBuild (126)
XMake.cs (75)
368if (parameterSections.Length == 2 &&
391string[] newArgArray = new string[args.Length + 1];
394Array.Copy(args, 0, newArgArray, 1, args.Length);
799&& switchesNotFromAutoResponseFile[CommandLineSwitches.ParameterizedSwitch.MaxCPUCount].Length == 0
800&& switchesFromAutoResponseFile[CommandLineSwitches.ParameterizedSwitch.MaxCPUCount].Length == 0
816bool outputPropertiesItemsOrTargetResults = getProperty.Length > 0 || getItem.Length > 0 || getTargetResult.Length > 0;
828getProperty.Length > 0 ? "getProperty" :
829getItem.Length > 0 ? "getItem" :
832else if ((getProperty.Length > 0 || getItem.Length > 0) && (targets is null || targets.Length == 0))
911if (outputPropertiesItemsOrTargetResults && targets?.Length > 0 && result is not null)
1089if (getProperty.Length == 1 && getItem.Length == 0)
1122else if (getProperty.Length == 1 && getItem.Length == 0 && getTargetResult.Length == 0)
1328if (loggers.Length == 1 &&
1561bool restoreOnly = targets.Length == 1 && string.Equals(targets[0], MSBuildConstants.RestoreTargetName, StringComparison.OrdinalIgnoreCase);
2667bool minimizeStdOutOutput = getProperty.Length + getItem.Length + getTargetResult.Length > 0 && getResultOutputFile.Length == 0;
2877if (parameterAndValue[0].Equals("default", StringComparison.InvariantCultureIgnoreCase) && parameterAndValue.Length > 1)
2910terminalLoggerArg = switches[switches.Length - 1];
2977return terminalLoggerParameters?.Length > 0 ? MSBuildApp.AggregateParameters(string.Empty, terminalLoggerParameters) : string.Empty;
3027ErrorUtilities.VerifyThrow(projectSwitchParameters.Length <= 1, "Expect exactly one project at a time.");
3029if (projectSwitchParameters.Length == 1)
3094if (parameters.Length == 1 && bool.TryParse(parameters[0], out bool boolValue))
3128if (parameters.Length == 1 && bool.TryParse(parameters[0], out var boolValue))
3186if (parameters.Length > 0)
3191enableNodeReuse = bool.Parse(parameters[parameters.Length - 1]);
3195CommandLineSwitchException.Throw("InvalidNodeReuseValue", parameters[parameters.Length - 1], ex.Message);
3199CommandLineSwitchException.Throw("InvalidNodeReuseValue", parameters[parameters.Length - 1], ex.Message);
3219if (parameters.Length > 0)
3223writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false);
3227CommandLineSwitchException.Throw("InvalidPreprocessPath", parameters[parameters.Length - 1], ex.Message);
3238if (parameters.Length > 0)
3242writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false);
3246CommandLineSwitchException.Throw("TargetsCouldNotBePrinted", parameters[parameters.Length - 1], ex.Message);
3301if (parameters.Length > 0)
3305value = bool.Parse(parameters[parameters.Length - 1]);
3309CommandLineSwitchException.Throw(resourceName, parameters[parameters.Length - 1], ex.Message);
3313CommandLineSwitchException.Throw(resourceName, parameters[parameters.Length - 1], ex.Message);
3330if (parameters == null || parameters.Length == 0)
3337var profilerFile = parameters[parameters.Length - 1];
3352CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1],
3357CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1],
3362CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1],
3381if (input.Length > 0)
3481if (parameters.Length > 0)
3485cpuCount = int.Parse(parameters[parameters.Length - 1], CultureInfo.InvariantCulture);
3489CommandLineSwitchException.Throw("InvalidMaxCPUCountValue", parameters[parameters.Length - 1], ex.Message);
3493CommandLineSwitchException.Throw("InvalidMaxCPUCountValue", parameters[parameters.Length - 1], ex.Message);
3496CommandLineSwitchException.VerifyThrow(cpuCount > 0 && cpuCount <= 1024, "InvalidMaxCPUCountValueOutsideRange", parameters[parameters.Length - 1]);
3514ErrorUtilities.VerifyThrow(parameters.Length <= 1, "Expect exactly one project at a time.");
3519if (parameters.Length == 1)
3646if (projectExtensionsToIgnore?.Length > 0)
3741if (parameters.Length > 0)
3745return parameters[parameters.Length - 1];
3766Debug.Assert((parameterSections.Length >= 1) && (parameterSections.Length <= 2),
3770CommandLineSwitchException.VerifyThrow((parameterSections[0].Length > 0) && (parameterSections.Length == 2),
3810if (verbositySwitchParameters.Length > 0)
3813originalVerbosity = ProcessVerbositySwitch(verbositySwitchParameters[verbositySwitchParameters.Length - 1]);
3865for (int i = 0; i < parametersToAggregate.Length; i++)
3890for (int i = 0; i < groupedFileLoggerParameters.Length; i++)
3910if (groupedFileLoggerParameters[i].Length > 0)
3945if (binaryLoggerParameters == null || binaryLoggerParameters.Length == 0)
3950string arguments = binaryLoggerParameters[binaryLoggerParameters.Length - 1];
3980if ((consoleLoggerParameters?.Length > 0))
4086if ((fileLoggerParameters?.Length > 0))
4174value = (nameValuePair.Length > 1) ? nameValuePair[1] : null;
4631if (features.Length == 1)
MSBuildTaskHost (69)
Concurrent\ConcurrentDictionary.cs (24)
112for (int i = 0; i < locks.Length; i++)
117int[] countPerLock = new int[locks.Length];
123_budget = buckets.Length / locks.Length;
133int bucketNo = GetBucket(hashcode, tables._buckets.Length);
169GetBucketAndLockNo(hashcode, out bucketNo, out lockNo, tables._buckets.Length, tables._locks.Length);
337for (int i = 0; i < tables._countPerLock.Length; i++)
345if (approxCount < tables._buckets.Length / 4)
365newLength = (tables._buckets.Length * 2) + 1;
400AcquireLocks(1, tables._locks.Length, ref locksAcquired);
405if (_growLockArray && tables._locks.Length < MaxLockNumber)
407newLocks = new object[tables._locks.Length * 2];
408Array.Copy(tables._locks, 0, newLocks, 0, tables._locks.Length);
409for (int i = tables._locks.Length; i < newLocks.Length; i++)
416int[] newCountPerLock = new int[newLocks.Length];
419for (int i = 0; i < tables._buckets.Length; i++)
426GetBucketAndLockNo(current._hashcode, out newBucketNo, out newLockNo, newBuckets.Length, newLocks.Length);
440_budget = Math.Max(1, newBuckets.Length / newLocks.Length);
486AcquireLocks(1, _tables._locks.Length, ref locksAcquired);
487Debug.Assert(locksAcquired == _tables._locks.Length);
NodeEndpointOutOfProcBase.cs (5)
398for (int i = 0; i < handshakeComponents.Length; i++)
524IAsyncResult result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null);
568if (bytesRead != headerByte.Length)
588CommunicationsUtilities.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length);
613result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null);
Mvc.RoutingWebSite (2)
PlaintextApp (1)
PortableTask (1)
PresentationBuildTasks (133)
PresentationCore (738)
MS\Internal\IO\Packaging\NetStream.cs (4)
147if (offset + count > buffer.Length)
344while (Read(buf, 0, buf.Length) > 0)
491_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this);
1022_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this);
System\Windows\dataobject.cs (33)
1271for (int i=0; i<formats.Length; i++)
1293for (int i=0; i<ALLOWED_TYMEDS.Length; i++)
1397if (buffer != null && buffer.Length != 0)
1399hEnhancedMetafile = NativeMethods.SetEnhMetaFileBits((uint)buffer.Length, buffer);
1812if (files == null || files.Length < 1)
1833for (int i = 0; i < files.Length; i++)
1858Marshal.Copy(structData, 0, currentPtr, structData.Length);
1867for (int i = 0; i < files.Length; i++)
1934UnsafeNativeMethods.CopyMemoryW(ptr, chars, chars.Length * 2);
1943*(char*)(IntPtr)((ulong)ptr + (ulong)chars.Length * 2) = '\0';
1972Win32WideCharToMultiByte(str, str.Length, strBytes, strBytes.Length);
2281_formats = new FORMATETC[formats == null ? 0 : formats.Length];
2285for (int i = 0; i < formats.Length; i++)
2341for (int i = 0; i < celt && _current < _formats.Length; i++)
2362return (_current < _formats.Length) ? NativeMethods.S_OK : NativeMethods.S_FALSE;
2516for (int i=0; i<mappedFormats.Length; i++)
2529for (int formatetcIndex = 0; formatetcIndex < formatetc.Length; formatetcIndex++)
2619for (int i = 0; i < mappedFormats.Length; i++)
2666for (int i = 0; i < mappedFormats.Length; i++)
3012if (size > _serializedObjectID.Length)
3015for(int i = 0; i < _serializedObjectID.Length; i++)
3028index = _serializedObjectID.Length;
3036return new MemoryStream(bytes, index, bytes.Length - index);
3251for (int i=0; i<ALLOWED_TYMEDS.Length; i++)
3407for (int baseFormatIndex = 0; baseFormatIndex < baseVar.Length; baseFormatIndex++)
3415for (int dataStoreIndex = 0; dataStoreIndex < entries.Length; dataStoreIndex++)
3429for (int mappedFormatIndex = 0; mappedFormatIndex < cur.Length; mappedFormatIndex++)
3435dataStoreIndex < entries.Length;
3539for (int i = 0; i < mappedFormats.Length; i++)
3594for (int i = 0; i < entries.Length; i++)
3628for (int i = 0; i < formats.Length; i++)
3655newlist = new DataStoreEntry[datalist.Length + 1];
3677for (int i = 0; i < dataStoreEntries.Length; i++)
PresentationFramework (898)
System\Windows\Controls\Grid.cs (66)
396Array.Clear(_definitionIndices, 0, _definitionIndices.Length);
404Array.Clear(_roundingErrors, 0, _roundingErrors.Length);
424Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0);
593bool canResolveStarsU = extData.CellGroup2 > PrivateCells.Length;
683Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0);
694for (int currentCell = 0; currentCell < PrivateCells.Length; ++currentCell)
782value = definitions[(columnIndex + 1) % definitions.Length].FinalOffset;
804value = definitions[(rowIndex + 1) % definitions.Length].FinalOffset;
900for (int i = PrivateCells.Length - 1; i >= 0; --i)
917cell.ColumnIndex = Math.Min(GetColumn(child), DefinitionsU.Length - 1);
920cell.RowIndex = Math.Min(GetRow(child), DefinitionsV.Length - 1);
925cell.ColumnSpan = Math.Min(GetColumnSpan(child), DefinitionsU.Length - cell.ColumnIndex);
929cell.RowSpan = Math.Min(GetRowSpan(child), DefinitionsV.Length - cell.RowIndex);
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);
1092for (int i = 0; i < definitions.Length; ++i)
1136double[] minSizes = isRows ? new double[DefinitionsV.Length] : new double[DefinitionsU.Length];
1138for (int j=0; j<minSizes.Length; j++)
1156} while (i < PrivateCells.Length);
1163for (int i=0; i<minSizes.Length; i++)
1208if (cellsHead >= PrivateCells.Length)
1261} while (i < PrivateCells.Length);
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);
1647for (int i = 0; i < definitions.Length; ++i)
1743int defCount = definitions.Length;
2041for (int i = 0; i < definitions.Length; ++i)
2077int nonStarIndex = definitions.Length; // traverses from the last entry down
2093for (int i = 0; i < definitions.Length; ++i)
2221Array.Sort(definitionIndices, 0, definitions.Length, new DistributionOrderIndexComparer(definitions));
2224for (int i = 0; i < definitions.Length; ++i)
2227double final = definitions[definitionIndex].SizeCache + (sizeToDistribute / (definitions.Length - i));
2252for (int i = 0; i < definitions.Length; ++i)
2259Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors));
2265int i = definitions.Length - 1;
2282while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length)
2299for (int i = 0; i < definitions.Length; ++i)
2301definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache;
2322int defCount = definitions.Length;
2668for (int i = 0; i < definitions.Length; ++i)
2722for (int i = 0; i < definitions.Length; ++i)
2728Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors));
2734int i = definitions.Length - 1;
2751while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length)
2769for (int i = 0; i < definitions.Length; ++i)
2771definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache;
2878Array.Clear(extData.TempDefinitions, 0, Math.Max(DefinitionsU.Length, DefinitionsV.Length));
3083int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length) * 2;
3086|| extData.TempDefinitions.Length < requiredLength )
3098|| extData.TempDefinitions.Length < requiredLength )
3116int requiredLength = Math.Max(Math.Max(DefinitionsU.Length, DefinitionsV.Length), 1) * 2;
3118if (_definitionIndices == null || _definitionIndices.Length < requiredLength)
3134int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length);
3140else if (_roundingErrors == null || _roundingErrors.Length < requiredLength)
4008for (int i = 1; i < grid.DefinitionsU.Length; ++i)
4016for (int i = 1; i < grid.DefinitionsV.Length; ++i)
System\Windows\Documents\TextSchema.cs (22)
56_inheritableTextElementProperties = new DependencyProperty[textElementPropertyList.Length + Typography.TypographyPropertiesList.Length];
57Array.Copy(textElementPropertyList, 0, _inheritableTextElementProperties, 0, textElementPropertyList.Length);
58Array.Copy(Typography.TypographyPropertiesList, 0, _inheritableTextElementProperties, textElementPropertyList.Length, Typography.TypographyPropertiesList.Length);
68_inheritableBlockProperties = new DependencyProperty[blockPropertyList.Length + _inheritableTextElementProperties.Length];
69Array.Copy(blockPropertyList, 0, _inheritableBlockProperties, 0, blockPropertyList.Length);
70Array.Copy(_inheritableTextElementProperties, 0, _inheritableBlockProperties, blockPropertyList.Length, _inheritableTextElementProperties.Length);
79_inheritableTableCellProperties = new DependencyProperty[tableCellPropertyList.Length + _inheritableTextElementProperties.Length];
80Array.Copy(tableCellPropertyList, _inheritableTableCellProperties, tableCellPropertyList.Length);
81Array.Copy(_inheritableTextElementProperties, 0, _inheritableTableCellProperties, tableCellPropertyList.Length, _inheritableTextElementProperties.Length);
662for (int i = 0; i < _inheritableBlockProperties.Length; i++)
671for (int i = 0; i < _paragraphProperties.Length; i++)
687for (int i = 0; i < _inheritableTextElementProperties.Length; i++)
696for (int i = 0; i < _inlineProperties.Length; i++)
711for (int i = 0; i < _nonFormattingCharacterProperties.Length; i++)
742for (i = 0; i < _structuralCharacterProperties.Length; i++)
748return (i < _structuralCharacterProperties.Length);
PresentationFramework.Aero (1)
PresentationFramework.Aero2 (1)
PresentationFramework.AeroLite (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework.Classic (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework.Luna (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework.Royale (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework-SystemCore (5)
PresentationUI (7)
RazorWebSite (2)
ReachFramework (65)
PrintConfig\PTProvider.cs (9)
400IntPtr umDevMode = Marshal.AllocCoTaskMem(devMode.Length);
404Marshal.Copy(devMode, 0, umDevMode, devMode.Length);
410(uint)devMode.Length,
644CopyIStreamToArray(stream, result, (uint)result.Length);
660Invariant.Assert(src.Length >= byteCount);
684int bytesToWrite = Math.Min(data.Length, (int)(byteCount - totalBytesWritten));
718Invariant.Assert(dst.Length >= byteCount);
738int bytesToRead = Math.Min(data.Length, (int)(byteCount - totalBytesRead));
740Array.Clear(data, 0, data.Length);
RemoteExecutorConsoleApp (4)
Replay (3)
ResultsOfTGenerator (4)
Roslyn.Compilers.Extension (2)
Roslyn.Test.PdbUtilities (33)
Roslyn.VisualStudio.DiagnosticsWindow (2)
Roslyn.VisualStudio.Next.UnitTests (9)
RoutingSandbox (3)
RoutingWebSite (4)
RunTests (2)
ScenarioTests.Common.Tests (8)
Security.TransportSecurity.IntegrationTests (1)
SemanticSearch.BuildTask (6)
Shared (16)
SignalR.Client.FunctionalTestApp (1)
SocialWeather (5)
Sockets.BindTests (1)
Sockets.FunctionalTests (63)
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
24} while (read != 0 && offset < buffer.Length);
41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken);
43} while (read != 0 && offset < buffer.Length);
45Assert.True(offset >= buffer.Length);
57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (19)
56for (int i = 0; i < bytes.Length; i++)
61context.Response.ContentLength = bytes.Length * 1024;
65await context.Response.BodyWriter.WriteAsync(new Memory<byte>(bytes, 0, bytes.Length));
85var count = await responseBody.ReadAsync(bytes, 0, bytes.Length);
93count = await responseBody.ReadAsync(bytes, 0, bytes.Length);
309await context.Response.BodyWriter.WriteAsync(new Memory<byte>(scratchBuffer, 0, scratchBuffer.Length), context.RequestAborted);
331$"Content-Length: {scratchBuffer.Length}",
335var ignore = connection.Stream.WriteAsync(scratchBuffer, 0, scratchBuffer.Length);
372await context.Response.Body.WriteAsync(scratchBuffer, 0, scratchBuffer.Length);
390await connection.Stream.ReadAsync(scratchBuffer, 0, scratchBuffer.Length);
535await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted);
673await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted);
701await sslStream.WriteAsync(request, 0, request.Length);
824await connection.Stream.WriteAsync(buffer, 0, buffer.Length);
888await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted);
1052await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted);
1101var bytes = await stream.ReadAsync(receiveBuffer, 0, receiveBuffer.Length).DefaultTimeout();
1127var received = await stream.ReadAsync(receiveBuffer, 0, Math.Min(receiveBuffer.Length, expectedBytes - totalReceived));
1151received = await stream.ReadAsync(receiveBuffer, 0, receiveBuffer.Length);
StackDepthTest (1)
Stress.ApiService (1)
Stress.AppHost (1)
StringTools.Benchmark (1)
Swaggatherer (4)
System.CodeDom (44)
System.Collections (108)
System.Collections.Concurrent (56)
System\Collections\Concurrent\ConcurrentBag.cs (10)
295if (index > array.Length - count)
791var newArray = new T[_array.Length << 1];
795Array.Copy(_array, newArray, _array.Length);
799Array.Copy(_array, headIdx, newArray, 0, _array.Length - headIdx);
800Array.Copy(_array, 0, newArray, _array.Length - headIdx, headIdx);
1030Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length);
1039Debug.Assert(arrayIndex <= array.Length - count);
1101if (_index < _array.Length)
1107_index = _array.Length + 1;
1117if (_index == 0 || _index == _array.Length + 1)
System.Collections.Immutable (141)
System\Collections\Immutable\ImmutableArray_1.Builder.cs (13)
55get { return _elements.Length; }
63if (value != _elements.Length)
229if (result.Length != _count)
369this.Count += items.Length;
371Array.Copy(items, 0, _elements, offset, items.Length);
384this.Count += items.Length;
386Array.Copy(items, 0, _elements, offset, items.Length);
397Requires.Range(length >= 0 && length <= items.Length, nameof(length));
703Requires.Range(index >= 0 && index + this.Count <= array.Length, nameof(index));
729Requires.Range(destinationIndex >= 0 && destinationIndex + length <= destination.Length, nameof(destinationIndex));
739if (_elements.Length < capacity)
741int newCapacity = Math.Max(_elements.Length * 2, capacity);
1094Array.Copy(_elements, copied + removed, _elements, copied, _elements.Length - (copied + removed));
System.Collections.NonGeneric (30)
System\Collections\Queue.cs (20)
87int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy;
91Array.Copy(_array, 0, q._array, _array.Length - _head, numToCopy);
113Array.Clear(_array, _head, _array.Length - _head);
136int arrayLen = array.Length;
143int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy;
147Array.Copy(_array, 0, array, index + _array.Length - _head, numToCopy);
154if (_size == _array.Length)
156int newcapacity = (int)((long)_array.Length * (long)_growFactor / 100);
157if (newcapacity < _array.Length + MinimumGrow)
159newcapacity = _array.Length + MinimumGrow;
165_tail = (_tail + 1) % _array.Length;
187_head = (_head + 1) % _array.Length;
234index = (index + 1) % _array.Length;
242return _array[(_head + i) % _array.Length];
261Array.Copy(_array, _head, arr, 0, _array.Length - _head);
262Array.Copy(_array, 0, arr, _array.Length - _head, _tail);
282Array.Copy(_array, _head, newarray, 0, _array.Length - _head);
283Array.Copy(_array, 0, newarray, _array.Length - _head, _tail);
System.Collections.Specialized (5)
System.ComponentModel.Annotations (10)
System.ComponentModel.Composition (71)
System.ComponentModel.Composition.Registration (3)
System.ComponentModel.TypeConverter (127)
System.Composition.Convention (4)
System.Composition.Hosting (9)
System.Composition.TypedParts (10)
System.Configuration.ConfigurationManager (34)
System.Console (14)
System.Data.Common (684)
System\Data\DataTableReader.cs (23)
47if (dataTables.Length == 0)
52_tables = new DataTable[dataTables.Length];
53for (int i = 0; i < dataTables.Length; i++)
143if ((_tableCounter == _tables.Length - 1))
364return tempBuffer.Length;
368int byteCount = Math.Min(tempBuffer.Length - srcIndex, length);
371throw ADP.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, nameof(dataIndex));
373else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length))
375throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, nameof(bufferIndex));
427return tempBuffer.Length;
431int charCount = Math.Min(tempBuffer.Length - srcIndex, length);
434throw ADP.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, nameof(dataIndex));
436else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length))
438throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, nameof(bufferIndex));
680Array.Copy(_currentDataRow!.ItemArray, values, _currentDataRow.ItemArray.Length > values.Length ? values.Length : _currentDataRow.ItemArray.Length);
681return (_currentDataRow.ItemArray.Length > values.Length ? values.Length : _currentDataRow.ItemArray.Length);
826for (int j = 0; j < dependency.Length; j++)
System\Data\ProviderBase\SchemaMapping.cs (28)
201bool[] readOnly = new bool[mapped.Length];
202for (int i = 0; i < readOnly.Length; ++i)
212for (int i = 0; i < readOnly.Length; ++i)
220for (int i = 0; i < mapped.Length; ++i)
232for (int i = 0; i < readOnly.Length; ++i)
284Debug.Assert(_mappedLength == _indexMap!.Length, "incorrect precomputed length");
299Debug.Assert(_mappedLength == Math.Min(_readerDataValues!.Length, _mappedDataValues!.Length), "incorrect precomputed length");
314for (int i = 0; i < _xmlMap.Length; ++i)
390for (int i = 0; i < _readerDataValues!.Length; ++i)
439for (int i = 0; i < _chapterMap!.Length; ++i)
458int rowLength = _chapterMap!.Length;
513for (int i = 0; i < fieldNames.Length; ++i)
524Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray");
657for (int x = 0; x < _xmlMap.Length; ++x)
770Debug.Assert(_dataReader.FieldCount <= schemaRows.Length, "unexpected fewer rows in Schema than FieldCount");
772if (0 == schemaRows.Length)
780bool addPrimaryKeys = (((0 == _dataTable.PrimaryKey.Length) && ((4 <= (int)_loadOption) || (0 == _dataTable.Rows.Count)))
803for (int sortedIndex = 0; sortedIndex < schemaRows.Length; ++sortedIndex)
825chapterIndexMap = new bool[schemaRows.Length];
834_xmlMap = new int[schemaRows.Length];
843_xmlMap = new int[schemaRows.Length];
859columnIndexMap = CreateIndexMap(schemaRows.Length, unsortedIndex);
891for (int x = 0; x < _xmlMap.Length; ++x)
1022keys ??= new DataColumn[schemaRows.Length];
1039columnIndexMap = CreateIndexMap(schemaRows.Length, unsortedIndex);
1076if (keyCount < keys.Length)
1112dataValues = SetupMapping(schemaRows.Length, columnCollection, chapterColumn, chapterValue);
System\Data\SQLTypes\SQLChars.cs (17)
72_lCurLen = _rgchBuf.Length;
152_ => (_rgchBuf == null) ? -1L : _rgchBuf.Length,
274ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _rgchBuf.Length);
300ArgumentOutOfRangeException.ThrowIfGreaterThan(offsetInBuffer, buffer.Length);
304ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer);
348if (offset > _rgchBuf.Length)
352ArgumentOutOfRangeException.ThrowIfGreaterThan(offsetInBuffer, buffer.Length);
355ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer);
357if (count > _rgchBuf.Length - offset)
433Debug.Assert(FStream() || (_rgchBuf != null && _lCurLen <= _rgchBuf.Length));
436Debug.Assert(_rgchWorkBuf == null || _rgchWorkBuf.Length == 1);
456if (_rgchBuf == null || _rgchBuf.Length < lStreamLen)
473_lCurLen = (_rgchBuf == null) ? x_lNull : _rgchBuf.Length;
650ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length);
652ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
666ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length);
668ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Data\SQLTypes\SQLString.cs (5)
140: this(lcid, compareOptions, data, 0, data.Length, fUnicode)
156: this(lcid, compareOptions, data, 0, data.Length, true)
723int cbX = rgDataX.Length;
724int cbY = rgDataY.Length;
917return SqlBinary.HashByteArray(rgbSortKey, rgbSortKey.Length);
System.Data.Odbc (92)
System\Data\Odbc\OdbcConnectionHandle.cs (3)
227ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetConnectAttrW(this, attribute, buffer, buffer.Length, out cbActual);
240ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), out cbActual);
246ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), ADP.PtrZero);
System.Diagnostics.DiagnosticSource (37)
System.Diagnostics.Process (18)
System.Diagnostics.TextWriterTraceListener (3)
System.Diagnostics.TraceSource (2)
System.Drawing.Common.Tests (96)
System\Drawing\Drawing2D\GraphicsPathTests.cs (18)
544for (int i = 0; i < points.Length - 1; i++)
764Assert.Equal(8, gpi.PathPoints.Length);
765Assert.Equal(8, gpi.PathTypes.Length);
766Assert.Equal(8, gpi.PathData.Points.Length);
769Assert.Equal(8, gpf.PathPoints.Length);
770Assert.Equal(8, gpf.PathTypes.Length);
771Assert.Equal(8, gpf.PathData.Points.Length);
792Assert.Equal(8, gpi.PathPoints.Length);
793Assert.Equal(8, gpi.PathTypes.Length);
794Assert.Equal(8, gpi.PathData.Points.Length);
797Assert.Equal(8, gpf.PathPoints.Length);
798Assert.Equal(8, gpf.PathTypes.Length);
799Assert.Equal(8, gpf.PathData.Points.Length);
844Assert.Equal(13, gpi.PathData.Points.Length);
847Assert.Equal(13, gpf.PathData.Points.Length);
1022int gpiLengthOld = gpi.PathPoints.Length;
1029int pgfLengthOld = gpf.PathPoints.Length;
2341Assert.Equal(expectedPoints.Length, gp.PointCount);
System\Drawing\ImageTests.cs (15)
41Assert.Equal(3, items.Length);
233item.Len = item.Value.Length;
248item.Len = item.Value.Length;
254Assert.Equal(2, items.Length);
269Assert.Equal(2, items.Length);
291item.Len = item.Value.Length;
297Assert.Equal(3, items.Length);
334item.Len = item.Value.Length;
340Assert.Equal(4, items.Length);
383Assert.Equal(4, items.Length);
434item.Len = item.Value.Length;
449item.Len = item.Value.Length;
455Assert.Equal(2, items.Length);
470Assert.Equal(2, items.Length);
548stream.Write(bytes, 0, bytes.Length);
System\Drawing\Imaging\EncoderParameterTests.cs (7)
118CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeByte, value.Length);
127CheckEncoderParameter(ep, s_anyEncoder, expected, value.Length);
136CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeShort, value.Length);
145CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeLong, value.Length);
153CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeRational, numerator.Length);
161CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeLongRange, rangeBegin.Length);
169CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeRationalRange, numerator1.Length);
System.Formats.Asn1 (10)
System.Formats.Cbor (1)
System.Formats.Nrbf (12)
System.Formats.Tar (3)
System.IO.Compression (58)
System\IO\Compression\DeflateZLib\DeflateStream.cs (10)
314int n = _stream.Read(_buffer, 0, _buffer.Length);
328else if (n > _buffer.Length)
459int n = await _stream.ReadAsync(new Memory<byte>(_buffer, 0, _buffer.Length), cancellationToken).ConfigureAwait(false);
473else if (n > _buffer.Length)
940int bytesRead = _deflateStream._inflater.Inflate(_arrayPoolBuffer, 0, _arrayPoolBuffer.Length);
953await _deflateStream._stream.CopyToAsync(this, _arrayPoolBuffer.Length, _cancellationToken).ConfigureAwait(false);
976int bytesRead = _deflateStream._inflater.Inflate(_arrayPoolBuffer, 0, _arrayPoolBuffer.Length);
989_deflateStream._stream.CopyTo(this, _arrayPoolBuffer.Length);
1010else if (count > buffer.Length - offset)
1059else if (count > buffer.Length - offset)
System.IO.Compression.Brotli (3)
System.IO.Compression.ZipFile (2)
System.IO.FileSystem.DriveInfo (2)
System.IO.FileSystem.Watcher (11)
System.IO.IsolatedStorage (9)
System.IO.Packaging (14)
System.IO.Pipelines (3)
System.IO.Pipes (1)
System.IO.Ports (26)
System\IO\Ports\SerialPort.cs (25)
631if (buffer.Length - offset < count)
772if (buffer.Length - offset < count)
784Debug.Assert(buffer.Length - offset >= count, "invalid offset/count!");
914Debug.Assert((buffer.Length - offset - totalCharsFound) >= currentCharsFound, "internal buffer to read one full unicode char sequence is not sufficient!");
967_internalSerialStream.ReadExactly(bytesReceived, CachedBytesToRead, bytesReceived.Length - CachedBytesToRead); // get everything
989int numCharsReceived = localDecoder.GetCharCount(bytesReceived, 0, bytesReceived.Length);
990int lastFullCharIndex = bytesReceived.Length;
994Buffer.BlockCopy(bytesReceived, 0, _inBuffer, 0, bytesReceived.Length); // put it all back!
997_readLen = bytesReceived.Length;
1008_readLen = bytesReceived.Length - (lastFullCharIndex + 1);
1010Buffer.BlockCopy(bytesReceived, lastFullCharIndex + 1, _inBuffer, 0, bytesReceived.Length - (lastFullCharIndex + 1));
1109if (readBuffer.Length > 0)
1120MaybeResizeBuffer(readBuffer.Length + bytesToSave);
1122Buffer.BlockCopy(readBuffer, 0, _inBuffer, _readLen, readBuffer.Length);
1123_readLen += readBuffer.Length;
1148_internalSerialStream.Write(bytesToWrite, 0, bytesToWrite.Length, _writeTimeout);
1163if (buffer.Length - offset < count)
1166if (buffer.Length == 0) return;
1169Write(byteArray, 0, byteArray.Length);
1183if (buffer.Length - offset < count)
1185if (buffer.Length == 0) return;
1284if (additionalByteLength + _readLen <= _inBuffer.Length)
1288if (CachedBytesToRead + additionalByteLength <= _inBuffer.Length / 2)
1293int newLength = Math.Max(CachedBytesToRead + additionalByteLength, _inBuffer.Length * 2);
1295Debug.Assert(_inBuffer.Length >= _readLen, "ResizeBuffer - readLen > inBuffer.Length");
System.Linq (82)
System\Linq\OrderedEnumerable.SpeedOpt.cs (21)
18if (buffer.Length <= 1)
23TElement[] array = new TElement[buffer.Length];
32List<TElement> list = new(buffer.Length);
33if (buffer.Length >= 2)
35Fill(buffer, SetCountAndGetSpan(list, buffer.Length));
37else if (buffer.Length == 1)
67if (buffer.Length <= minIdx)
72if (buffer.Length <= maxIdx)
74maxIdx = buffer.Length - 1;
79return [GetEnumerableSorter().ElementAt(buffer, buffer.Length, minIdx)];
92if (buffer.Length <= minIdx)
97if (buffer.Length <= maxIdx)
99maxIdx = buffer.Length - 1;
104return new List<TElement>(1) { GetEnumerableSorter().ElementAt(buffer, buffer.Length, minIdx) };
154if (index < buffer.Length)
157return GetEnumerableSorter().ElementAt(buffer, buffer.Length, index);
222if (minIdx < buffer.Length)
225return (maxIdx < buffer.Length - 1) ?
226GetEnumerableSorter().ElementAt(buffer, buffer.Length, maxIdx) :
241for (int i = 1; i < items.Length; ++i)
483int count = buffer.Length;
System.Linq.Expressions (301)
System.Linq.Parallel (97)
System.Linq.Queryable (16)
System.Memory (12)
System.Net.Http (116)
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (9)
48for (int i = 0; i < _blocks.Length; i++)
184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize);
187uint blockArraySize = (uint)_blocks.Length;
255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize);
272for (uint i = firstUnallocatedBlock; i < _blocks.Length; i++)
310Debug.Assert(start + length <= blocks.Length * BlockSize);
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}");
System.Net.HttpListener (45)
System\Net\Managed\HttpResponseStream.Managed.cs (7)
72ms.Write(bytes, 0, bytes.Length);
80InternalWrite(bytes, 0, bytes.Length);
106ms.Write(bytes, 0, bytes.Length);
181ms.Write(bytes, 0, bytes.Length);
195InternalWrite(bytes, 0, bytes.Length);
225ms.Write(bytes, 0, bytes.Length);
235InternalWrite(bytes, 0, bytes.Length);
System.Net.Mail (42)
System.Net.NameResolution (9)
System.Net.NetworkInformation (28)
System.Net.Ping (7)
System.Net.Primitives (14)
System.Net.Quic (24)
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (9)
48for (int i = 0; i < _blocks.Length; i++)
184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize);
187uint blockArraySize = (uint)_blocks.Length;
255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize);
272for (uint i = firstUnallocatedBlock; i < _blocks.Length; i++)
310Debug.Assert(start + length <= blocks.Length * BlockSize);
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}");
System.Net.Requests (19)
System\Net\CommandStream.cs (9)
190while (_index < _commands!.Length)
215BeginWrite(sendBuffer, 0, sendBuffer.Length, s_writeCallbackDelegate, this);
219Write(sendBuffer, 0, sendBuffer.Length);
281if (index < 0 || index >= commands!.Length ||
291if (_index >= _commands!.Length)
520BeginRead(state.Buffer, 0, state.Buffer.Length, s_readCallbackDelegate, state);
525bytesRead = Read(state.Buffer, 0, state.Buffer.Length);
630BeginRead(state.Buffer, 0, state.Buffer.Length, s_readCallbackDelegate, state);
635bytesRead = Read(state.Buffer, 0, state.Buffer.Length);
System.Net.Security (72)
System.Net.ServerSentEvents (7)
System.Net.Sockets (45)
System\Net\Sockets\Socket.cs (10)
939if (addresses.Length == 0)
1109return Send(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags);
1116return Send(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None);
1392return SendTo(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags, remoteEP);
1399return SendTo(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None, remoteEP);
1511return Receive(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags);
1518return Receive(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None);
1898return ReceiveFrom(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags, ref remoteEP);
1905return ReceiveFrom(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None, ref remoteEP);
2225int optionLength = optionValue != null ? optionValue.Length : 0;
System.Net.WebClient (24)
System\Net\WebClient.cs (21)
459_contentLength = data.Length;
526_contentLength = fs.Length + formHeaderBytes.Length + boundaryBytes.Length;
614_contentLength = buffer.Length;
841writeStream.SetLength(copyBuffer.Length);
849while ((bytesRead = readStream.Read(copyBuffer, 0, copyBuffer.Length)) != 0)
888writeStream.SetLength(copyBuffer.Length);
958writeStream.Write(header, 0, header.Length);
967int bytesRead = readStream.Read(buffer, 0, buffer.Length);
976for (int pos = 0; pos < buffer.Length;)
978int toWrite = buffer.Length - pos;
990writeStream.Write(footer, 0, footer.Length);
1026_progress.BytesSent += header.Length;
1047for (int pos = 0; pos < buffer.Length;)
1049int toWrite = buffer.Length - pos;
1064_progress.BytesSent += footer.Length;
1162return enc.GetString(data, bomLengthInData, data.Length - bomLengthInData);
1380_contentLength = requestData.Length;
1428_contentLength = data.Length;
1435chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, data.Length);
1511chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, buffer.Length);
System.Net.WebHeaderCollection (2)
System.Net.WebProxy (1)
System.Net.WebSockets (13)
System.Net.WebSockets.Client (5)
System.Numerics.Tensors (71)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (19)
37public ReadOnlyTensorSpan(T[]? array) : this(array, 0, [array?.Length ?? 0], [])
54: this(array, startIndex.GetOffset(array?.Length ?? 0), lengths, strides)
75lengths = [array.Length];
96if ((ulong)(uint)start + (ulong)(uint)maxElements >= (ulong)(uint)array.Length && array.Length != 0)
101if (((uint)start > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - start)) && array.Length != 0)
105_shape = new TensorShape(array.Length - start, lengths, strides);
177if ((ulong)(uint)startOffset + (ulong)(uint)maxElements >= (ulong)(uint)array.Length && array.Length != 0)
182if (((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) && array.Length != 0)
186_shape = new TensorShape(array.Length - startOffset, lengths, strides);
221if ((ulong)(uint)startOffset + (ulong)(uint)maxElements > (ulong)(uint)array.Length)
226if ((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset))
230_shape = new TensorShape(array.Length - startOffset, lengths, strides);
System\Numerics\Tensors\netcore\TensorSpan.cs (19)
38public TensorSpan(T[]? array) : this(array, 0, [array?.Length ?? 0], [])
56: this(array, startIndex.GetOffset(array?.Length ?? 0), lengths, strides)
77lengths = [array.Length];
98if ((ulong)(uint)start + (ulong)(uint)maxElements >= (ulong)(uint)array.Length && array.Length != 0)
103if (((uint)start > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - start)) && array.Length != 0)
107_shape = new TensorShape(array.Length - start, lengths, strides);
181if ((ulong)(uint)startOffset + (ulong)(uint)maxElements >= (ulong)(uint)array.Length && array.Length != 0)
186if (((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) && array.Length != 0)
190_shape = new TensorShape(array.Length - startOffset, lengths, strides);
224if ((ulong)(uint)startOffset + (ulong)(uint)maxElements > (ulong)(uint)array.Length)
229if ((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset))
233_shape = new TensorShape(array.Length, lengths, strides);
System.ObjectModel (3)
System.Private.CoreLib (1650)
src\libraries\System.Private.CoreLib\src\System\Array.cs (103)
36return array.Length == 0 ?
53if (larray.Length != newSize)
65(uint)Math.Min(newSize, larray.Length));
124if (lengths.Length == 0)
135for (int i = 0; i < lengths.Length; i++)
140return InternalCreate(t, lengths.Length, pLengths, null);
150if (lengths.Length != lowerBounds.Length)
152if (lengths.Length == 0)
163for (int i = 0; i < lengths.Length; i++)
169return InternalCreate(t, lengths.Length, pLengths, pLowerBounds);
177int[] intLengths = new int[lengths.Length];
179for (int i = 0; i < lengths.Length; ++i)
254if (t.GetArrayRank() != lengths.Length)
261for (int i = 0; i < lengths.Length; i++)
266return InternalCreateFromArrayType(t, lengths.Length, pLengths, null);
300if (lengths.Length != lowerBounds.Length)
310if (t.GetArrayRank() != lengths.Length)
320for (int i = 0; i < lengths.Length; i++)
326return InternalCreateFromArrayType(t, lengths.Length, pLengths, pLowerBounds);
426if (Rank != indices.Length)
484if (Rank != indices.Length)
532if (Rank != indices.Length)
535int[] intIndices = new int[indices.Length];
537for (int i = 0; i < indices.Length; ++i)
592if (Rank != indices.Length)
595int[] intIndices = new int[indices.Length];
597for (int i = 0; i < indices.Length; ++i)
624int ICollection.Count => Length;
700if (o == null || this.Length != o.Length)
708while (i < o.Length && c == 0)
732if (other is not Array o || o.Length != this.Length)
738while (i < o.Length)
760for (int i = (this.Length >= 8 ? this.Length - 8 : 0); i < this.Length; i++)
785return BinarySearch(array, array.GetLowerBound(0), array.Length, value, null);
824return BinarySearch(array, array.GetLowerBound(0), array.Length, value, comparer);
851if (array.Length - (index - lb) < length)
988return BinarySearch(array, 0, array.Length, value, null);
995return BinarySearch(array, 0, array.Length, value, comparer);
1012if (array.Length - index < length)
1030TOutput[] newArray = new TOutput[array.Length];
1031for (int i = 0; i < array.Length; i++)
1050Copy(this, GetLowerBound(0), array!, index, Length);
1088for (int i = 0; i < array.Length; i++)
1106if ((uint)startIndex > (uint)array.Length)
1111if ((uint)count > (uint)(array.Length - startIndex))
1142for (int i = 0; i < array.Length; i++)
1165for (int i = 0; i < array.Length; i++)
1182return FindIndex(array, 0, array.Length, match);
1192return FindIndex(array, startIndex, array.Length - startIndex, match);
1202if (startIndex < 0 || startIndex > array.Length)
1207if (count < 0 || startIndex > array.Length - count)
1238for (int i = array.Length - 1; i >= 0; i--)
1255return FindLastIndex(array, array.Length - 1, array.Length, match);
1280if (array.Length == 0)
1291if (startIndex < 0 || startIndex >= array.Length)
1326for (int i = 0; i < array.Length; i++)
1340return IndexOf(array, value, array.GetLowerBound(0), array.Length);
1354return IndexOf(array, value, startIndex, array.Length - startIndex + lb);
1371if (startIndex < lb || startIndex > array.Length + lb)
1373if (count < 0 || count > array.Length - startIndex + lb)
1480return IndexOf(array, value, 0, array.Length);
1490return IndexOf(array, value, startIndex, array.Length - startIndex);
1500if ((uint)startIndex > (uint)array.Length)
1505if ((uint)count > (uint)(array.Length - startIndex))
1562return LastIndexOf(array, value, array.Length - 1 + lb, array.Length);
1589if (array.Length == 0)
1594if (startIndex < lb || startIndex >= array.Length + lb)
1703return LastIndexOf(array, value, array.Length - 1, array.Length);
1713return LastIndexOf(array, value, startIndex, (array.Length == 0) ? 0 : (startIndex + 1));
1723if (array.Length == 0)
1743if ((uint)startIndex >= (uint)array.Length)
1814Reverse(array, array.GetLowerBound(0), array.Length);
1833if (array.Length - (index - lowerBound) < length)
1892if (array.Length > 1)
1893SpanHelpers.Reverse(ref MemoryMarshal.GetArrayDataReference(array), (nuint)array.Length);
1904if (array.Length - index < length)
1921Sort(array, null, array.GetLowerBound(0), array.Length, null);
1934Sort(keys, items, keys.GetLowerBound(0), keys.Length, null);
1967Sort(array, null, array.GetLowerBound(0), array.Length, comparer);
1982Sort(keys, items, keys.GetLowerBound(0), keys.Length, comparer);
2018if (keys.Length - (index - keysLowerBound) < length || (items != null && (index - keysLowerBound) > items.Length - length))
2109if (array.Length > 1)
2111var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length);
2120Sort(keys, items, 0, keys.Length, null);
2137Sort(array, 0, array.Length, comparer);
2144Sort(keys, items, 0, keys.Length, comparer);
2155if (array.Length - index < length)
2173if (keys.Length - index < length || (items != null && index > items.Length - length))
2202var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length);
2218for (int i = 0; i < array.Length; i++)
2235/// <see cref="Length"/> property may return larger value than this property for multi-dimensional arrays.</para>
2673new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\libraries\System.Private.CoreLib\src\System\Buffers\ConfigurableArrayPool.cs (14)
43for (int i = 0; i < buckets.Length; i++)
70if (index < _buckets.Length)
84log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, _buckets[i].Id);
89while (++i < _buckets.Length && i != index + MaxBucketsToTry);
105log.BufferRented(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId);
106log.BufferAllocated(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId, index >= _buckets.Length ?
118if (array.Length == 0)
126int bucket = Utilities.SelectBucketIndex(array.Length);
129bool haveBucket = bucket < _buckets.Length;
149log.BufferReturned(bufferId, array.Length, Id);
152log.BufferDropped(bufferId, array.Length, Id, ArrayPoolEventSource.NoBucketId, ArrayPoolEventSource.BufferDroppedReason.OverMaximumSize);
196if (_index < buffers.Length)
234if (array.Length != _bufferLength)
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (27)
61if (tlsBuckets is not null && (uint)bucketIndex < (uint)tlsBuckets.Length)
69log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, bucketIndex);
77if ((uint)bucketIndex < (uint)perCoreBuckets.Length)
87log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, bucketIndex);
114log.BufferRented(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId);
115log.BufferAllocated(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId, bucketIndex >= _buckets.Length ?
130int bucketIndex = Utilities.SelectBucketIndex(array.Length);
140if ((uint)bucketIndex < (uint)tlsBuckets.Length)
151if (array.Length != Utilities.GetMaxSizeForBucket(bucketIndex))
171if (log.IsEnabled() && array.Length != 0)
173log.BufferReturned(array.GetHashCode(), array.Length, Id);
176log.BufferDropped(array.GetHashCode(), array.Length, Id,
197for (int i = 0; i < perCoreBuckets.Length; i++)
222for (int i = 0; i < buckets.Length; i++)
226log.BufferTrimmed(buffer.GetHashCode(), buffer.Length, Id);
247for (int i = 0; i < buckets.Length; i++)
268log.BufferTrimmed(buffer.GetHashCode(), buffer.Length, Id);
327for (int i = 0; i < partitions.Length; i++)
345for (int i = 0; i < partitions.Length; i++)
348if (++index == partitions.Length) index = 0;
365for (int i = 0; i < partitions.Length; i++)
368if (++index == partitions.Length) index = 0;
376for (int i = 0; i < partitions.Length; i++)
399if ((uint)count < (uint)arrays.Length)
423if ((uint)count < (uint)arrays.Length)
482log.BufferTrimmed(array.GetHashCode(), array.Length, id);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (26)
52if (_size != _array.Length) _tail = _size;
60public int Capacity => _array.Length;
80Array.Clear(_array, _head, _array.Length - _head);
99if (arrayIndex < 0 || arrayIndex > array.Length)
104if (array.Length - arrayIndex < _size)
112int firstPart = Math.Min(_array.Length - _head, numToCopy);
117Array.Copy(_array, 0, array, arrayIndex + _array.Length - _head, numToCopy);
135int arrayLen = array.Length;
151int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy;
157Array.Copy(_array, 0, array, index + _array.Length - _head, numToCopy);
169if (_size == _array.Length)
278Array.IndexOf(_array, item, _head, _array.Length - _head) >= 0 ||
301Array.Copy(_array, _head, arr, 0, _array.Length - _head);
302Array.Copy(_array, 0, arr, _array.Length - _head, _tail);
322Array.Copy(_array, _head, newarray, 0, _array.Length - _head);
323Array.Copy(_array, 0, newarray, _array.Length - _head, _tail);
340if (tmp == _array.Length)
355int threshold = (int)(_array.Length * 0.9);
372if (capacity == _array.Length)
387if (_array.Length < capacity)
392return _array.Length;
397Debug.Assert(_array.Length < capacity);
402int newcapacity = GrowFactor * _array.Length;
409newcapacity = Math.Max(newcapacity, _array.Length + MinimumGrow);
462uint capacity = (uint)array.Length;
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (39)
430for (int i = 0; i < _buckets.Length; i++)
454int bucket = lbuckets.Length;
483uint hashcode = InitHash(key, lbuckets.Length, out uint seed, out uint incr);
487int bucketNumber = (int)(seed % (uint)lbuckets.Length);
498bucketNumber = (int)(((long)bucketNumber + incr) % (uint)lbuckets.Length);
499} while (b.hash_coll < 0 && ++ntry < lbuckets.Length);
513for (int i = _buckets.Length; --i >= 0;)
521for (int i = _buckets.Length; --i >= 0;)
540for (int i = lbuckets.Length; --i >= 0;)
559for (int i = lbuckets.Length; --i >= 0;)
579if (array.Length - arrayIndex < Count)
590for (int i = lbuckets.Length; --i >= 0;)
611for (int i = lbuckets.Length; --i >= 0;)
632uint hashcode = InitHash(key, lbuckets.Length, out uint seed, out uint incr);
636int bucketNumber = (int)(seed % (uint)lbuckets.Length);
677bucketNumber = (int)(((long)bucketNumber + incr) % (uint)lbuckets.Length);
678} while (b.hash_coll < 0 && ++ntry < lbuckets.Length);
694int rawsize = HashHelpers.ExpandPrime(_buckets.Length);
701rehash(_buckets.Length);
726for (nb = 0; nb < _buckets.Length; nb++)
845uint hashcode = InitHash(key, _buckets.Length, out uint seed, out uint incr);
849int bucketNumber = (int)(seed % (uint)_buckets.Length);
912bucketNumber = (int)(((long)bucketNumber + incr) % (uint)_buckets.Length);
913} while (++ntry < _buckets.Length);
943uint incr = unchecked((uint)(1 + ((seed * HashHelpers.HashPrime) % ((uint)newBuckets.Length - 1))));
944int bucketNumber = (int)(seed % (uint)newBuckets.Length);
960bucketNumber = (int)(((long)bucketNumber + incr) % (uint)newBuckets.Length);
975uint hashcode = InitHash(key, _buckets.Length, out uint seed, out uint incr);
979int bn = (int)(seed % (uint)_buckets.Length); // bucketNumber
1003bn = (int)(((long)bn + incr) % (uint)_buckets.Length);
1004} while (b.hash_coll < 0 && ++ntry < _buckets.Length);
1065info.AddValue(HashSizeName, _buckets.Length); // This is the length of the bucket array.
1160if (serKeys.Length != serValues.Length)
1164for (int i = 0; i < serKeys.Length; i++)
1196if (array.Length - arrayIndex < _hashtable._count)
1231if (array.Length - arrayIndex < _hashtable._count)
1411_bucket = hashtable._buckets.Length;
1490_bucket = _hashtable._buckets.Length;
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (60)
35if (match == null || match.Length == 0)
51int[][] paramOrder = new int[candidates.Length][];
53for (i = 0; i < candidates.Length; i++)
58paramOrder[i] = new int[(par.Length > args.Length) ? par.Length : args.Length];
76Type[] paramArrayTypes = new Type[candidates.Length];
78Type[] argTypes = new Type[args.Length];
83for (i = 0; i < args.Length; i++)
99for (i = 0; i < candidates.Length; i++)
113if (args.Length != 0)
126else if (par.Length > args.Length)
131for (j = args.Length; j < par.Length - 1; j++)
152else if (par.Length < args.Length)
187int argsToCheck = (paramArrayType != null) ? par.Length - 1 : args.Length;
200if (index < args.Length)
255for (; j < args.Length; j++)
283if (j == args.Length)
303state = new BinderState((int[])paramOrder[0].Clone(), args.Length, paramArrayTypes[0] != null);
311if (parms.Length == args.Length)
323else if (parms.Length > args.Length)
330if (k < args.Length)
356objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[0], args.Length - paramArrayPos);
357Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos);
394state = new BinderState((int[])paramOrder[currentMin].Clone(), args.Length, paramArrayTypes[currentMin] != null);
401if (parameters.Length == args.Length)
413else if (parameters.Length > args.Length)
417for (i = 0; i < args.Length; i++)
441objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[currentMin], args.Length - paramArrayPos);
442Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos);
469for (i = 0; i < candidates.Length; i++)
545Type[] realTypes = new Type[types.Length];
546for (i = 0; i < types.Length; i++)
555if (match == null || match.Length == 0)
563for (i = 0; i < candidates.Length; i++)
566if (par.Length != types.Length)
568for (j = 0; j < types.Length; j++)
598if (j == types.Length)
609int[] paramOrder = new int[types.Length];
610for (i = 0; i < types.Length; i++)
645if (match == null || match.Length == 0)
654int indexesLength = (indexes != null) ? indexes.Length : 0;
655for (i = 0; i < candidates.Length; i++)
660if (par.Length != indexesLength)
761int paramArrayPos = args.Length - 1;
762if (args.Length == binderState._originalSize)
769object[] newArgs = new object[args.Length];
771for (int i = paramArrayPos, j = 0; i < newArgs.Length; i++, j++)
780if (args.Length > binderState._originalSize)
795MethodBase[] aExactMatches = new MethodBase[match.Length];
798for (int i = 0; i < match.Length; i++)
806for (j = 0; j < types.Length; j++)
814if (j < types.Length)
838int typesLength = (types != null) ? types.Length : 0;
839for (int i = 0; i < match.Length; i++)
877for (int i = 0; i < types.Length; i++)
1162object?[] varsCopy = new object[vars.Length];
1163for (int i = 0; i < vars.Length; i++)
1168for (int i = 0, j = 0; i < vars.Length; j++)
1170if (paramOrder[j] < vars.Length)
1192for (int i = 0; i < names.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (10)
23EventParameterInfo[] eventParams = new EventParameterInfo[parameters.Length];
24for (int i = 0; i < parameters.Length; i++)
51EventParameterInfo[] eventParams = new EventParameterInfo[typeInfos.Length];
52for (int i = 0; i < typeInfos.Length; i++)
91if ((parameters.Length == 1) && (parameters[0].ParameterType == typeof(EmptyStruct)))
166WriteToBuffer(pMetadata, totalMetadataLength, ref offset, (uint)parameters.Length);
195WriteToBuffer(pMetadata, totalMetadataLength, ref offset, (uint)parameters.Length);
276EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length);
329EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length);
422EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (63)
455return (manifestBytes == null) ? null : Encoding.UTF8.GetString(manifestBytes, 0, manifestBytes.Length);
535for (int i = 0; i < m_traits.Length - 1; i += 2)
785int cnt = m_eventData.Length;
793uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0;
1125if (arg1 == null || arg1.Length == 0)
1138int blobSize = arg1.Length;
1163if (arg2 == null || arg2.Length == 0)
1176int blobSize = arg2.Length;
1459var argValues = new object?[args.Length];
1460for (int i = 0; i < args.Length; i++)
1639if (m_traits != null && m_traits.Length % 2 != 0)
1776for (int i = 0; i < decodedObjects.Length; i++, data++)
1926Marshal.Copy(data->DataPointer, blob, 0, blob.Length);
2086int paramCount = Math.Min(eventTypes.typeInfos.Length, args.Length); // parameter count mismatch get logged in LogEventArgsMismatches
2087var eventData = new object?[eventTypes.typeInfos.Length];
2106if (args.Length != infos.Length)
2108ReportOutOfBandMessage(SR.Format(SR.EventSource_EventParametersMismatch, eventId, args.Length, infos.Length));
2112for (int i = 0; i < args.Length; i++)
2137ReportOutOfBandMessage(SR.Format(SR.EventSource_EventParametersMismatch, eventCallbackArgs.EventId, eventDataCount, metadata.Parameters.Length));
2147args = new object?[Math.Min(eventDataCount, metadata.Parameters.Length)];
2151for (int i = 0; i < args.Length; i++, data++)
2160for (int i = 0; i < args.Length; i++, data++)
2281uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0;
2328for (int evtId = 0; evtId < dispatcher.m_EventEnabled.Length; ++evtId)
2380if (eventChannel != EventChannel.None && this.m_channelData != null && this.m_channelData.Length > (int)eventChannel)
2543var names = new string[parameters.Length];
2544for (int i = 0; i < names.Length; i++)
2563var types = new Type[parameters.Length];
2564for (int i = 0; i < types.Length; i++)
2682for (int i = 0; i < m_eventData.Length; i++)
2755for (int i = 0; i < m_eventData.Length; i++)
2824if (eventId >= m_eventData.Length)
2838if (eventId >= dispatcher.m_EventEnabled.Length)
2854for (int i = 0; i < m_eventData.Length; i++)
2896dispatcher.m_EventEnabled ??= new bool[m_eventData.Length];
2928int dataLeft = rawManifest.Length;
3156eventData = new EventMetadata[methods.Length + 1];
3230for (int i = 0; i < methods.Length; i++)
3321if (eventData != null && startEventId < eventData.Length)
3353for (int fieldIdx = 0; fieldIdx < args.Length; fieldIdx++)
3405bNeedsManifest = (flags & EventManifestOptions.OnlyIfNeededForRegistration) == 0 || manifest.GetChannelData().Length > 0;
3412res = (res.Length > 0) ? res : null;
3451if (args.Length > 0 && args[0].ParameterType == typeof(Guid) &&
3454var newargs = new ParameterInfo[args.Length - 1];
3455Array.Copy(args, 1, newargs, 0, args.Length - 1);
3503if (eventData.Length <= eventAttribute.EventId)
3505EventMetadata[] newValues = new EventMetadata[Math.Max(eventData.Length + 16, eventAttribute.EventId + 1)];
3506Array.Copy(eventData, newValues, eventData.Length);
3532int eventListenerParameterCount = eventParameters.Length;
3570int idx = eventData.Length;
3577if (eventData.Length - idx > 2) // allow one wasted slot.
3580Array.Copy(eventData, newValues, newValues.Length);
3593enabledArray = new bool[m_eventData.Length];
3613if (evtId < eventData.Length && eventData[evtId].Descriptor.EventId != 0)
3621for (int idx = 0; idx < eventData.Length; ++idx)
3712for (int idx = 0; idx < instrs.Length;)
3766for (int search = idx + 1; search < instrs.Length; search++)
3802if (idx >= instrs.Length || instrs[idx] >= 6)
4431for (int i = 0; i < eventDispatcher.m_EventEnabled.Length; ++i)
4633for (int i = 0; i < eventSourcesSnapshot.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (11)
442descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1);
443descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1);
455for (int i = 0; i < eventTypes.typeInfos.Length; i++)
537int descriptorsLength = eventTypes.dataCount + eventTypes.typeInfos.Length * 2 + 3;
549descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1);
550descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1);
553for (int i = 0; i < eventTypes.typeInfos.Length; i++)
620descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1);
621descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1);
746for (int i = 0; i < m_traits.Length - 1; i += 2)
773int startPos = providerMetadata.Length - traitMetaData.Count;
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (65)
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,
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");
386for (int i = 0; i < OptionalCalendars.Length; i++)
482for (int i = 0; i < EraNames.Length; i++)
493for (int i = 0; i < AbbreviatedEraNames.Length; i++)
501for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++)
530if ((uint)era >= names.Length)
545if (AbbreviatedEraNames.Length == 0)
559if ((uint)era >= (uint)names.Length)
1038Debug.Assert(values.Length >= length);
1058if (value.Length != 7)
1063CheckNullValue(value, value.Length);
1083if (value.Length != 7)
1088CheckNullValue(value, value.Length);
1103if (value.Length != 7)
1108CheckNullValue(value, value.Length);
1125if (value.Length != 13)
1130CheckNullValue(value, value.Length - 1);
1146if (value.Length != 13)
1151CheckNullValue(value, value.Length - 1);
1177if ((uint)month >= (uint)monthNamesArray.Length)
1179ThrowHelper.ThrowArgumentOutOfRange_Range(nameof(month), month + 1, 1, monthNamesArray.Length);
1196Debug.Assert(m_genitiveAbbreviatedMonthNames.Length == 13,
1206Debug.Assert(genitiveMonthNames.Length == 13,
1224Debug.Assert(leapYearMonthNames.Length == 13,
1235if ((uint)dow >= (uint)names.Length)
1250if ((uint)dow >= (uint)names.Length)
1267string[] result = new string[patterns1.Length * patterns2.Length];
1271for (int i = 0; i < patterns1.Length; i++)
1273for (int j = 0; j < patterns2.Length; j++)
1323if ((uint)dow >= (uint)names.Length)
1335if ((uint)month >= (uint)names.Length)
1347if ((uint)month >= (uint)names.Length)
1366Debug.Assert(patterns != null && patterns.Length > 0,
1379for (i = 0; i < patterns.Length; i++)
1390if (i < patterns.Length)
1402newPatterns = new string[patterns.Length + 1];
1405Array.Copy(patterns, 0, newPatterns, 1, patterns.Length);
1446Debug.Assert(allYearMonthPatterns.Length > 0,
1467Debug.Assert(allShortDatePatterns.Length > 0,
1488Debug.Assert(allLongDatePatterns.Length > 0,
1508Debug.Assert(allShortTimePatterns.Length > 0,
1528Debug.Assert(allLongTimePatterns.Length > 0,
1590if (patterns.Length == 0)
1595for (int i = 0; i < patterns.Length; i++)
1652if (value.Length != 13)
1657CheckNullValue(value, value.Length - 1);
1673if (value.Length != 13)
1678CheckNullValue(value, value.Length - 1);
2014for (int i = 0; i < dateWords.Length; i++)
2093for (int i = 1; i <= eras.Length; i++)
2114for (int i = 1; i <= jaDtfi.Calendar.Eras.Length; i++)
2127for (int i = 1; i <= twDtfi.Calendar.Eras.Length; i++)
2162for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++)
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (16)
354if (buffer.Length - index < count)
433if (buffer.Length - index < count)
465_ = byteBuffer.Length; // allow JIT to prove object is not null
526int newMaxCharsPerBuffer = _encoding.GetMaxCharCount(byteBuffer.Length);
599int len = _stream.Read(_byteBuffer, _bytePos, _byteBuffer.Length - _bytePos);
613_byteLen = _stream.Read(_byteBuffer, 0, _byteBuffer.Length);
626_isBlocked = (_byteLen < _byteBuffer.Length);
703int len = _stream.Read(_byteBuffer, _bytePos, _byteBuffer.Length - _bytePos);
717_byteLen = _stream.Read(_byteBuffer, 0, _byteBuffer.Length);
730_isBlocked = (_byteLen < _byteBuffer.Length);
964else if ((arrayPoolBuffer.Length - arrayPoolBufferPos) < (charLen - charPos))
1055if (buffer.Length - index < count)
1142int len = await tmpStream.ReadAsync(new Memory<byte>(tmpByteBuffer, tmpBytePos, tmpByteBuffer.Length - tmpBytePos), cancellationToken).ConfigureAwait(false);
1192_isBlocked = (_byteLen < tmpByteBuffer.Length);
1266if (buffer.Length - index < count)
1364_isBlocked = (_byteLen < tmpByteBuffer.Length);
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (8)
176return Convert(srcEncoding, dstEncoding, bytes, 0, bytes.Length);
529return GetByteCount(chars, 0, chars.Length);
540return GetByteCount(chars, 0, chars.Length);
596return GetBytes(chars, 0, chars.Length);
761return GetCharCount(bytes, 0, bytes.Length);
798return GetChars(bytes, 0, bytes.Length);
1002return GetString(bytes, 0, bytes.Length);
1383_bytes -= byteBuffer.Length; // Didn't use how many ever bytes we're falling back
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (20)
68if (chars.Length - index < count)
209if (chars!.Length - charIndex < charCount)
214if ((uint)byteIndex > bytes!.Length)
222return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex);
276if ((uint)byteIndex > bytes!.Length)
284return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex);
355return bytes.Length;
370if (bytes.Length - index < count)
436if (bytes.Length == 0)
443char[] chars = new char[bytes.Length];
448GetCharsCommon(pBytes, bytes.Length, pChars, chars.Length);
470if (bytes.Length - byteIndex < byteCount)
475if ((uint)charIndex > (uint)chars.Length)
483return GetCharsCommon(pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex);
503if (bytes.Length - index < count)
515GetCharsCommon(pBytes + index, count, pChars, chars.Length);
556string result = string.FastAllocateString(bytes.Length);
560GetCharsCommon(pBytes, bytes.Length, pChars, result.Length);
581if (bytes.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (25)
238Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue.");
248Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length);
266get => m_ChunkChars.Length + m_ChunkOffset;
334if ((uint)(chunkLength + chunkOffset) > (uint)result.Length || (uint)chunkLength > (uint)sourceArray.Length)
417int capacityToPreserve = Math.Min(Capacity, Math.Max(Length * 6 / 5, m_ChunkChars.Length));
419if (newLen > chunk.m_ChunkChars.Length)
431Debug.Assert(newLen == chunk.m_ChunkChars.Length, "The new chunk should be larger or equal to the one it is replacing.");
625if (_chunks.Length <= pos)
668if (((nuint)(uint)chunkLength + (nuint)(uint)repeatCount) <= (nuint)(uint)chunkChars.Length)
696int firstLength = chunkChars.Length - chunkLength;
700m_ChunkLength = chunkChars.Length;
733if (charCount > value.Length - startIndex)
845int length = Math.Min(m_ChunkChars.Length - m_ChunkLength, count);
849Debug.Assert(m_ChunkLength == 0 && m_ChunkChars.Length >= count);
876if (destinationIndex > destination.Length - count)
1008if ((uint)chars.Length > (uint)nextCharIndex)
1088Append(ref MemoryMarshal.GetArrayDataReference(value), value.Length);
1339Insert(index, ref MemoryMarshal.GetArrayDataReference(value), value.Length);
1363if (startIndex > value.Length - charCount)
2275if (((uint)chunkLength + (uint)valueCount) <= (uint)chunkChars.Length)
2311int firstLength = m_ChunkChars.Length - m_ChunkLength;
2315m_ChunkLength = m_ChunkChars.Length;
2392Debug.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen");
2523get => new Span<char>(m_ChunkChars, m_ChunkLength, m_ChunkChars.Length - m_ChunkLength);
2658if (!doNotMoveFollowingChars && chunk.m_ChunkLength <= DefaultCapacity * 2 && chunk.m_ChunkChars.Length - chunk.m_ChunkLength >= count)
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (12)
37var newQueues = new WorkStealingQueue[oldQueues.Length + 1];
38Array.Copy(oldQueues, newQueues, oldQueues.Length);
53if (oldQueues.Length == 0)
65var newQueues = new WorkStealingQueue[oldQueues.Length - 1];
68Array.Copy(oldQueues, 1, newQueues, 0, newQueues.Length);
70else if (pos == oldQueues.Length - 1)
72Array.Copy(oldQueues, newQueues, newQueues.Length);
77Array.Copy(oldQueues, pos + 1, newQueues, pos, newQueues.Length - pos);
137var newArray = new object?[m_array.Length << 1];
138for (int i = 0; i < m_array.Length; i++)
786int c = queues.Length;
1921for (int i = 0; i < items.Length; i++)
src\System\Array.CoreCLR.cs (9)
616return Length;
629return Length - 1;
750int length = @this.Length;
760Array.Copy(@this, 0, array, index, @this.Length);
768return @this.Length;
776if ((uint)index >= (uint)@this.Length)
789if ((uint)index >= (uint)@this.Length)
808return Array.IndexOf(@this, value, 0, @this.Length) >= 0;
829return Array.IndexOf(@this, value, 0, @this.Length);
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (6)
68new ReadOnlySpan<ushort>(ref Unsafe.As<byte, ushort>(ref src), array.Length),
69new Span<ushort>(ref Unsafe.As<byte, ushort>(ref dst), array.Length));
73new ReadOnlySpan<uint>(ref Unsafe.As<byte, uint>(ref src), array.Length),
74new Span<uint>(ref Unsafe.As<byte, uint>(ref dst), array.Length));
78new ReadOnlySpan<ulong>(ref Unsafe.As<byte, ulong>(ref src), array.Length),
79new Span<ulong>(ref Unsafe.As<byte, ulong>(ref dst), array.Length));
System.Private.CoreLib.Generators (29)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (28)
254int arrayLen = decomposedLeft.Length + decomposedRight.Length;
258var retVal = new INamedTypeSymbol[decomposedLeft.Length + decomposedRight.Length];
259Array.Copy(decomposedLeft, retVal, decomposedLeft.Length);
260Array.Copy(decomposedRight, 0, retVal, decomposedLeft.Length, decomposedRight.Length);
325if (decomposedLeft.Length == 0)
327else if (decomposedRight.Length == 0)
330if ((decomposedLeft.Length > 1) || (decomposedRight.Length > 1))
339if (decomposedLeft.Length == 0 || decomposedRight.Length == 0)
341if (decomposedLeft.Length != 0 || decomposedRight.Length != 0)
347var retVal = new INamedTypeSymbol[decomposedLeft.Length + decomposedRight.Length][];
348Array.Copy(decomposedLeft, retVal, decomposedLeft.Length);
349Array.Copy(decomposedRight, 0, retVal, decomposedLeft.Length, decomposedRight.Length);
354if (decomposedLeft.Length != 0 || decomposedRight.Length != 0)
364if (decomposedOperand.Length != 0)
371if (decomposedTrue.Length != 0 || decomposedFalse.Length != 0)
602if (decomposedCondition.Length == 0)
621for (int andClauseIndex = 0; andClauseIndex < decomposedCondition.Length; andClauseIndex++)
670if (decomposedCondition.Length == 1)
System.Private.DataContractSerialization (459)
System\Runtime\Serialization\Json\XmlJsonReader.cs (18)
721if (offset > buffer.Length)
723throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length));
726if (count > buffer.Length - offset)
728throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset));
743if (offset > chars.Length)
745throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
748if (count > chars.Length - offset)
750throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset));
780if (offset > buffer.Length)
782throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.JsonOffsetExceedsBufferSize, buffer.Length));
785if (count > buffer.Length - offset)
787throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - offset));
821if (offset > array.Length)
823throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length));
826if (count > array.Length - offset)
828throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
1011else if (_scopes.Length == _scopeDepth)
1493if ((_scopes != null) && (_scopes.Length > JsonGlobals.maxScopeSize))
System\Runtime\Serialization\XmlWriterDelegator.cs (15)
532writer.WriteBase64(bytes, 0, bytes.Length);
680for (int i = 0; i < value.Length; i++)
687dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
695for (int i = 0; i < value.Length; i++)
702dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
710for (int i = 0; i < value.Length; i++)
717dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
725for (int i = 0; i < value.Length; i++)
732dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
740for (int i = 0; i < value.Length; i++)
747dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
755for (int i = 0; i < value.Length; i++)
762dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
770for (int i = 0; i < value.Length; i++)
777dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
System\Text\Base64Encoding.cs (32)
54if (index > chars.Length)
55throw new ArgumentOutOfRangeException(nameof(index), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
57if (count > chars.Length - index)
58throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - index));
105if (charIndex > chars.Length)
106throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
109if (charCount > chars.Length - charIndex)
110throw new ArgumentOutOfRangeException(nameof(charCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - charIndex));
114if (byteIndex > bytes.Length)
115throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length));
130byte* pbMax = _bytes + bytes.Length - byteIndex;
178if (charIndex > chars.Length)
179throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
182if (charCount > chars.Length - charIndex)
183throw new ArgumentOutOfRangeException(nameof(charCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - charIndex));
187if (byteIndex > bytes.Length)
188throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length));
203byte* pbMax = _bytes + bytes.Length - byteIndex;
261if (byteIndex > bytes.Length)
262throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length));
264if (byteCount > bytes.Length - byteIndex)
265throw new ArgumentOutOfRangeException(nameof(byteCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex));
270if (charIndex > chars.Length)
271throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
272if (charCount < 0 || charCount > chars.Length - charIndex)
345if (byteIndex > bytes.Length)
346throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length));
348if (byteCount > bytes.Length - byteIndex)
349throw new ArgumentOutOfRangeException(nameof(byteCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex));
354if (charIndex > chars.Length)
355throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
357if (charCount < 0 || charCount > chars.Length - charIndex)
System\Text\BinHexEncoding.cs (14)
28if (charIndex > chars.Length)
29throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
31if (charCount > chars.Length - charIndex)
32throw new ArgumentOutOfRangeException(nameof(charCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - charIndex));
35if (byteIndex > bytes.Length)
36throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length));
38if (byteCount < 0 || byteCount > bytes.Length - byteIndex)
67if (byteIndex > bytes.Length)
68throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length));
70if (byteCount > bytes.Length - byteIndex)
71throw new ArgumentOutOfRangeException(nameof(byteCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex));
75if (charIndex > chars.Length)
76throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
77if (charCount < 0 || charCount > chars.Length - charIndex)
System\Xml\ArrayHelper.cs (7)
34while (read < array.Length)
36int actual = ReadArray(reader, localName, namespaceUri, array, read, array.Length - read);
44if (read < array.Length || reader.NodeType == XmlNodeType.EndElement)
50if (totalRead != array.Length || arrayCount > 0)
56Array.Copy(arrays![i], 0, newArray, offset, arrays[i].Length);
57offset += arrays[i].Length;
75int actual = ReadArray(reader, localName, namespaceUri, array, 0, array.Length);
System\Xml\EncodingStreamWrapper.cs (9)
388if (encCount == s_encodingUTF8.Length && CompareCaseInsensitive(s_encodingUTF8, buffer, encStart))
392else if (encCount == s_encodingUnicodeLE.Length && CompareCaseInsensitive(s_encodingUnicodeLE, buffer, encStart))
396else if (encCount == s_encodingUnicodeBE.Length && CompareCaseInsensitive(s_encodingUnicodeBE, buffer, encStart))
400else if (encCount == s_encodingUnicode.Length && CompareCaseInsensitive(s_encodingUnicode, buffer, encStart))
403ThrowEncodingMismatch(DataContractSerializer.UTF8NoBom.GetString(buffer, encStart, encCount), DataContractSerializer.UTF8NoBom.GetString(s_encodingUTF8, 0, s_encodingUTF8.Length));
416for (int i = 0; i < key.Length; i++)
601_byteCount = _stream.Read(_bytes, _byteCount, (_chars.Length - 1) * 2);
700int size = _chars.Length < count ? _chars.Length : count;
System\Xml\UniqueId.cs (13)
70if (offset > guid.Length)
71throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, guid.Length));
72if (guidLength > guid.Length - offset)
99if (offset > chars.Length)
100throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
102if (count > chars.Length - offset)
103throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset));
205if (offset > chars.Length)
206throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
208if (count > chars.Length - offset)
285if (offset > buffer.Length)
286throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length));
288if (guidLength > buffer.Length - offset)
System\Xml\XmlBaseReader.cs (37)
272else if (_elementNodes.Length == _depth)
306else if (_attributeNodes.Length == attributeIndex)
466if (_attributeNodes != null && _attributeNodes.Length > 16)
468if (_elementNodes != null && _elementNodes.Length > 16)
1055for (int i = 0; i < localNames.Length; i++)
1070for (int i = 0; i < localNames.Length; i++)
1096for (int i = 0; i < localNames.Length; i++)
1111for (int i = 0; i < localNames.Length; i++)
1131if (offset > chars.Length)
1132throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
1134if (count > chars.Length - offset)
1135throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset));
1159if (offset > buffer.Length)
1160throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length));
1162if (count > buffer.Length - offset)
1163throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset));
1304if (value.Length > _quotas.MaxArrayLength)
1312return ReadContentAsBase64(_quotas.MaxArrayLength, _bufferReader.Buffer.Length);
1347if (offset > buffer.Length)
1348throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length));
1350if (count > buffer.Length - offset)
1351throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset));
1383if (offset > buffer.Length)
1384throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length));
1386if (count > buffer.Length - offset)
1387throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset));
1900if (_chars == null || _chars.Length < count)
2625if (_indices != null && _indices.Length > 32)
2635if (_indices != null && _indices.Length == _attributeCount && IsSorted())
2639for (int i = 0; i < newIndices.Length; i++)
2648for (int i = 0; i < _indices!.Length - 1; i++)
2725if (_namespaces != null && _namespaces.Length > 32)
2727if (_attributes != null && _attributes.Length > 4)
2741nameSpace.Uri.SetValue(3, xmlBuffer.Length - 3);
2776for (int i = 0; i < _shortPrefixUri.Length; i++)
2863else if (_attributes.Length == _attributeCount)
2901else if (_namespaces.Length == _nsCount)
System\Xml\XmlBinaryReader.cs (9)
49if (offset > buffer.Length)
50throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length));
52if (count > buffer.Length - offset)
53throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset));
1026BufferReader.InsertBytes(buffer, 0, buffer.Length);
1230if (offset > array.Length)
1231throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length));
1233if (count > array.Length - offset)
1234throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlBinaryWriter.cs (8)
109Debug.Assert(offset >= 0 && offset + 1 + sizeof(T) <= buffer.Length, "WriteTextNodeRaw");
124Debug.Assert(offset >= 0 && offset + sizeof(T) <= buffer.Length, "WriteRaw");
1185while ((count = reader.ReadValueChunk(_chars, 0, _chars.Length)) > 0)
1207while ((count = reader.ReadValueAsBase64(_bytes, 0, _bytes.Length)) > 0)
1280if (offset > array.Length)
1281throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length));
1283if (count > array.Length - offset)
1284throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlCanonicalWriter.cs (50)
93_inclusivePrefixes = new string[inclusivePrefixes.Length];
94for (int i = 0; i < inclusivePrefixes.Length; ++i)
118if (_scopes != null && _scopes.Length > 16)
120if (_attributes != null && _attributes.Length > 16)
122if (_xmlnsBuffer != null && _xmlnsBuffer.Length > 1024)
153else if (_depth == _scopes.Length)
209if (prefixOffset > prefixBuffer.Length)
210throw new ArgumentOutOfRangeException(nameof(prefixOffset), SR.Format(SR.OffsetExceedsBufferSize, prefixBuffer.Length));
212if (prefixLength > prefixBuffer.Length - prefixOffset)
213throw new ArgumentOutOfRangeException(nameof(prefixLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset));
217if (localNameOffset > localNameBuffer.Length)
218throw new ArgumentOutOfRangeException(nameof(localNameOffset), SR.Format(SR.OffsetExceedsBufferSize, localNameBuffer.Length));
220if (localNameLength > localNameBuffer.Length - localNameOffset)
221throw new ArgumentOutOfRangeException(nameof(localNameLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, localNameBuffer.Length - localNameOffset));
250for (int i = 0; i < _inclusivePrefixes!.Length; ++i)
348else if (_xmlnsOffset + byteCount > _xmlnsBuffer.Length)
350byte[] newBuffer = new byte[Math.Max(_xmlnsOffset + byteCount, _xmlnsBuffer.Length * 2)];
385if (prefixOffset > prefixBuffer.Length)
386throw new ArgumentOutOfRangeException(nameof(prefixOffset), SR.Format(SR.OffsetExceedsBufferSize, prefixBuffer.Length));
388if (prefixLength > prefixBuffer.Length - prefixOffset)
389throw new ArgumentOutOfRangeException(nameof(prefixLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset));
393if (nsOffset > nsBuffer.Length)
394throw new ArgumentOutOfRangeException(nameof(nsOffset), SR.Format(SR.OffsetExceedsBufferSize, nsBuffer.Length));
396if (nsLength > nsBuffer.Length - nsOffset)
397throw new ArgumentOutOfRangeException(nameof(nsLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, nsBuffer.Length - nsOffset));
436if (prefixOffset > prefixBuffer.Length)
437throw new ArgumentOutOfRangeException(nameof(prefixOffset), SR.Format(SR.OffsetExceedsBufferSize, prefixBuffer.Length));
439if (prefixLength > prefixBuffer.Length - prefixOffset)
440throw new ArgumentOutOfRangeException(nameof(prefixLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset));
444if (localNameOffset > localNameBuffer.Length)
445throw new ArgumentOutOfRangeException(nameof(localNameOffset), SR.Format(SR.OffsetExceedsBufferSize, localNameBuffer.Length));
447if (localNameLength > localNameBuffer.Length - localNameOffset)
448throw new ArgumentOutOfRangeException(nameof(localNameLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, localNameBuffer.Length - localNameOffset));
507if (offset > chars.Length)
508throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
510if (count > chars.Length - offset)
511throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset));
562if (offset > chars.Length)
563throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
565if (count > chars.Length - offset)
566throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset));
599if (offset > chars.Length)
600throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length));
602if (count > chars.Length - offset)
603throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset));
663else if (_attributeCount == _attributes.Length)
681else if (_xmlnsAttributes.Length == _xmlnsAttributeCount)
877for (int i = 0; i < indices.Length; i++)
884Attribute[] attributes = new Attribute[_writer._attributes!.Length];
885for (int i = 0; i < indices.Length; i++)
System\Xml\XmlDictionaryReader.cs (20)
33return CreateBinaryReader(buffer, 0, buffer.Length, quotas);
92return CreateTextReader(buffer, 0, buffer.Length, quotas);
297for (int i = 0; i < localNames.Length; i++)
320for (int i = 0; i < localNames.Length; i++)
517while (read < buffer.Length)
521actual = ReadContentAsBase64(buffer, read, buffer.Length - read);
523actual = ReadContentAsBinHex(buffer, read, buffer.Length - read);
531if (read < buffer.Length)
539Buffer.BlockCopy(buffers[i], 0, buffer, offset, buffers[i].Length);
540offset += buffers[i].Length;
593Guid[] guids = new Guid[values.Length];
594for (int i = 0; i < values.Length; i++)
601UniqueId[] uniqueIds = new UniqueId[values.Length];
602for (int i = 0; i < values.Length; i++)
615for (int i = 0; i < strings.Length; i++)
635for (int i = 0; i < strings.Length; i++)
1010if (offset > array.Length)
1011throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length));
1013if (count > array.Length - offset)
1014throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System.Private.Uri (4)
System.Private.Windows.Core (36)
Windows\Win32\System\Variant\VARIANT.cs (19)
285new Span<sbyte>(psa->pvData, array.Length)
289new Span<byte>(psa->pvData, array.Length)
293new Span<short>(psa->pvData, array.Length)
297new Span<ushort>(psa->pvData, array.Length)
302new Span<int>(psa->pvData, array.Length)
308new Span<uint>(psa->pvData, array.Length)
312new Span<long>(psa->pvData, array.Length)
316new Span<ulong>(psa->pvData, array.Length)
320new Span<float>(psa->pvData, array.Length)
324new Span<double>(psa->pvData, array.Length)
329Span<VARIANT_BOOL> data = new(psa->pvData, array.Length);
341Span<DECIMAL> data = new(psa->pvData, array.Length);
353Span<long> data = new(psa->pvData, array.Length);
365Span<double> data = new(psa->pvData, array.Length);
377Span<IntPtr> data = new(psa->pvData, array.Length);
390Span<IntPtr> data = new(psa->pvData, array.Length);
402Span<VARIANT> data = new(psa->pvData, array.Length);
416else if (array.Length != 0)
869=> MemoryMarshal.CreateSpan(ref Unsafe.AsRef<T>(Marshal.UnsafeAddrOfPinnedArrayElement(array, 0).ToPointer()), array.Length);
System.Private.Windows.Core.TestUtilities (7)
System.Private.Xml (852)
System\Xml\Core\XmlEncodedRawTextWriter.cs (10)
148_bufBytes = new byte[_bufChars.Length];
654Debug.Assert(count >= 0 && index + count <= buffer.Length);
678Debug.Assert(count >= 0 && index + count <= buffer.Length);
857_encoder!.Convert(_bufChars, startOffset, endOffset - startOffset, _bufBytes!, _bufBytesUsed, _bufBytes!.Length - _bufBytesUsed, false, out chEnc, out bEnc, out _);
860if (_bufBytesUsed >= (_bufBytes.Length - 16))
880_encoder!.Convert(_bufChars, 1, 0, _bufBytes!, 0, _bufBytes!.Length, true, out _, out bEnc, out _);
1689if (_lastMarkPos + 1 == _textContentMarks!.Length)
1698Debug.Assert(_lastMarkPos + 1 == _textContentMarks!.Length);
1699int[] newTextContentMarks = new int[_textContentMarks.Length * 2];
1700Array.Copy(_textContentMarks, newTextContentMarks, _textContentMarks.Length);
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (5)
550Debug.Assert(count >= 0 && index + count <= buffer.Length);
572Debug.Assert(count >= 0 && index + count <= buffer.Length);
689_encoder!.Convert(_bufChars, startOffset, endOffset - startOffset, _bufBytes!, _bufBytesUsed, _bufBytes!.Length - _bufBytesUsed, false, out chEnc, out bEnc, out _);
692if (_bufBytesUsed >= (_bufBytes.Length - 16))
712_encoder!.Convert(_bufChars, 1, 0, _bufBytes!, 0, _bufBytes!.Length, true, out _, out bEnc, out _);
System\Xml\Core\XmlTextReaderImpl.cs (38)
1597ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
1644ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
1690ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
1737ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
1797ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
2856bufferSize = _ps.bytes.Length;
2869if (_ps.bytes == null || _ps.bytes.Length < bufferSize)
2876if (_ps.chars == null || _ps.chars.Length < bufferSize + 1)
2883if (_ps.bytesUsed < 4 && _ps.bytes.Length - _ps.bytesUsed > 0)
2885int bytesToRead = Math.Min(4, _ps.bytes.Length - _ps.bytesUsed);
3346if (_ps.charsUsed == _ps.chars.Length - 1)
3354char[] newChars = new char[_ps.chars.Length * 2];
3355BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length);
3365if (_ps.bytes.Length - _ps.bytesUsed < MaxByteSequenceLen)
3367byte[] newBytes = new byte[_ps.bytes.Length * 2];
3374charsRead = _ps.chars.Length - _ps.charsUsed - 1;
3382int charsLen = _ps.chars.Length;
3405char[] newChars = new char[_ps.chars.Length * 2];
3406BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length);
3431charsRead = _ps.chars.Length - _ps.charsUsed - 1;
3441if (_ps.bytePos == _ps.bytesUsed && _ps.bytes.Length - _ps.bytesUsed > 0)
3443int read = _ps.stream.Read(_ps.bytes, _ps.bytesUsed, _ps.bytes.Length - _ps.bytesUsed);
3465charsRead = _ps.textReader.Read(_ps.chars, _ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1);
3477Debug.Assert(_ps.charsUsed < _ps.chars.Length);
3490Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1);
5003if (_attrDuplSortingArray == null || _attrDuplSortingArray.Length < _attrCount)
7623Debug.Assert(nodeIndex < _nodes.Length);
7624Debug.Assert(_nodes[_nodes.Length - 1] == null);
7637Debug.Assert(nodeIndex < _nodes.Length);
7638if (nodeIndex >= _nodes.Length - 1)
7640NodeData[] newNodes = new NodeData[_nodes.Length * 2];
7641Array.Copy(_nodes, newNodes, _nodes.Length);
7644Debug.Assert(nodeIndex < _nodes.Length);
8101else if (_parsingStatesStackTop + 1 == _parsingStatesStack.Length)
8103ParsingState[] newParsingStateStack = new ParsingState[_parsingStatesStack.Length * 2];
8104Array.Copy(_parsingStatesStack, newParsingStateStack, _parsingStatesStack.Length);
8153if (array.Length - index < count)
9563Debug.Assert(endPos < chars.Length);
System\Xml\Core\XmlTextReaderImplAsync.cs (23)
393ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
449ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
514ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
570ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
622ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
882bufferSize = _ps.bytes.Length;
897if (_ps.bytes == null || _ps.bytes.Length < bufferSize)
904if (_ps.chars == null || _ps.chars.Length < bufferSize + 1)
911if (_ps.bytesUsed < 4 && _ps.bytes.Length - _ps.bytesUsed > 0)
913int bytesToRead = Math.Min(4, _ps.bytes.Length - _ps.bytesUsed);
1035if (_ps.charsUsed == _ps.chars.Length - 1)
1043char[] newChars = new char[_ps.chars.Length * 2];
1044BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length);
1053if (_ps.bytes!.Length - _ps.bytesUsed < MaxByteSequenceLen)
1055byte[] newBytes = new byte[_ps.bytes.Length * 2];
1062charsRead = _ps.chars.Length - _ps.charsUsed - 1;
1070int charsLen = _ps.chars.Length;
1093char[] newChars = new char[_ps.chars.Length * 2];
1094BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length);
1117charsRead = _ps.chars.Length - _ps.charsUsed - 1;
1125if (_ps.bytePos == _ps.bytesUsed && _ps.bytes!.Length - _ps.bytesUsed > 0)
1149charsRead = await _ps.textReader.ReadAsync(_ps.chars.AsMemory(_ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1)).ConfigureAwait(false);
1161Debug.Assert(_ps.charsUsed < _ps.chars.Length);
System\Xml\Serialization\XmlSerializationWriter.cs (41)
377for (int i = 0; i < xmlNodes.Length; i++)
406XmlCustomFormatter.WriteArrayBase64(_w, (byte[])o, 0, ((byte[])o).Length);
1005XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length);
1021XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length);
1040XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length);
1126XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length);
1263int arrayLength = a.Length;
1509for (int i = 0; i < parameterTypes.Length; i++)
1698for (int i = 0; i < structMapping.Members!.Length; i++)
1722for (int i = 0; i < enumFields.Length; i++)
1774for (int i = 0; i < memberInfos.Length; i++)
1821for (int i = 0; i < paramTypes.Length; i++)
1824if (i < (paramTypes.Length - 1))
1886for (int i = 0; i < args.Length; i++)
2467for (int i = 0; i < values.Length; i++)
2644for (int i = 0; i < mapping.Members!.Length; i++)
2658for (int j = 0; j < mapping.Members.Length; j++)
2698for (int i = 0; i < mapping.Members!.Length; i++)
2712for (int j = 0; j < mapping.Members.Length; j++)
2743for (int j = 0; j < mapping.Members.Length; j++)
2761if (isRpc && member.IsReturnValue && member.Elements!.Length > 0)
2793Writer.Write(mapping.Members.Length.ToString(CultureInfo.InvariantCulture));
2797WriteExtraMembers(mapping.Members.Length.ToString(CultureInfo.InvariantCulture), "pLength");
2883if (constants.Length > 0)
2891for (int i = 0; i < constants.Length; i++)
2911for (int i = 0; i < constants.Length; i++)
2922for (int i = 0; i < constants.Length; i++)
3182for (int i = 0; i < members.Length; i++)
3221for (int i = 0; i < members.Length; i++)
3227bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null);
3485!(elements.Length == 1 && elements[0].Mapping is ArrayMapping))
3494if (elements.Length == 0 && text == null) return;
3612int count = elements.Length + (text == null ? 0 : 1);
3642if (elements.Length == 0 && text == null) return;
3643if (elements.Length == 1 && text == null)
3666for (int i = 0; i < elements.Length; i++)
3734if (elements.Length - anyCount > 0) Writer.Write("else ");
3830if (elements.Length > 0)
3852if (elements.Length > 0)
4390for (int i = 0; i < members.Length; i++)
4447for (int i = 0; i < choiceMapping.Constants!.Length; i++)
System.Private.Xml.Linq (20)
System.Reflection.Context (43)
System\Reflection\Context\Projection\ProjectingType.cs (19)
240methods.Length +
241constructors.Length +
242properties.Length +
243events.Length +
244fields.Length +
245nestedTypes.Length];
248Array.Copy(methods, 0, members, i, methods.Length); i += methods.Length;
249Array.Copy(constructors, 0, members, i, constructors.Length); i += constructors.Length;
250Array.Copy(properties, 0, members, i, properties.Length); i += properties.Length;
251Array.Copy(events, 0, members, i, events.Length); i += events.Length;
252Array.Copy(fields, 0, members, i, fields.Length); i += fields.Length;
253Array.Copy(nestedTypes, 0, members, i, nestedTypes.Length); i += nestedTypes.Length;
255Debug.Assert(i == members.Length);
System.Reflection.DispatchProxy (14)
System.Reflection.Emit (76)
System.Reflection.Metadata (54)
System.Reflection.MetadataLoadContext (124)
System.Resources.Extensions (18)
System.Resources.Writer (5)
System.Runtime.Caching (22)
System.Runtime.InteropServices (7)
System.Runtime.Numerics (99)
System.Runtime.Serialization.Formatters (29)
System.Runtime.Serialization.Schema (1)
System.Security.Claims (9)
System.Security.Cryptography (397)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EcDsa.ImportExport.cs (8)
76p, p.Length,
77curve.A!, curve.A!.Length,
78curve.B!, curve.B!.Length,
79curve.G.X!, curve.G.X!.Length,
80curve.G.Y!, curve.G.Y!.Length,
81curve.Order!, curve.Order!.Length,
82curve.Cofactor, curve.Cofactor!.Length,
83curve.Seed, curve.Seed == null ? 0 : curve.Seed.Length);
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.ImportExport.cs (25)
117parameters.Q.X, parameters.Q.X?.Length ?? 0,
118parameters.Q.Y, parameters.Q.Y?.Length ?? 0,
119parameters.D, parameters.D == null ? 0 : parameters.D.Length);
129parameters.Q.X, parameters.Q.X?.Length ?? 0,
130parameters.Q.Y, parameters.Q.Y?.Length ?? 0,
131parameters.D, parameters.D == null ? 0 : parameters.D.Length,
132parameters.Curve.Prime!, parameters.Curve.Prime!.Length,
133parameters.Curve.A!, parameters.Curve.A!.Length,
134parameters.Curve.B!, parameters.Curve.B!.Length,
135parameters.Curve.G.X!, parameters.Curve.G.X!.Length,
136parameters.Curve.G.Y!, parameters.Curve.G.Y!.Length,
137parameters.Curve.Order!, parameters.Curve.Order!.Length,
138parameters.Curve.Cofactor, parameters.Curve.Cofactor!.Length,
139parameters.Curve.Seed, parameters.Curve.Seed == null ? 0 : parameters.Curve.Seed.Length);
149parameters.Q.X, parameters.Q.X?.Length ?? 0,
150parameters.Q.Y, parameters.Q.Y?.Length ?? 0,
151parameters.D, parameters.D == null ? 0 : parameters.D.Length,
152parameters.Curve.Polynomial!, parameters.Curve.Polynomial!.Length,
153parameters.Curve.A!, parameters.Curve.A!.Length,
154parameters.Curve.B!, parameters.Curve.B!.Length,
155parameters.Curve.G.X!, parameters.Curve.G.X!.Length,
156parameters.Curve.G.Y!, parameters.Curve.G.Y!.Length,
157parameters.Curve.Order!, parameters.Curve.Order!.Length,
158parameters.Curve.Cofactor, parameters.Curve.Cofactor!.Length,
159parameters.Curve.Seed, parameters.Curve.Seed == null ? 0 : parameters.Curve.Seed.Length);
System\Security\Cryptography\DSA.cs (11)
101return SignData(data, 0, data.Length, hashAlgorithm);
141ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
144ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
198ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
201ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
303return VerifyData(data, 0, data.Length, signature, hashAlgorithm);
311ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
314ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
371ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
374ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
1107int qLength = dsaParameters.Q!.Length;
System\Security\Cryptography\ECDsa.cs (12)
47return SignData(data, 0, data.Length, hashAlgorithm);
55ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
58ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
112ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
115ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
723return VerifyData(data, 0, data.Length, signature, hashAlgorithm);
731ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
734ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
791ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
794ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
1018if (hash.Length <= destination.Length)
1021bytesWritten = hash.Length;
System\Security\Cryptography\PasswordDeriveBytes.cs (6)
126ib = _extra.Length - _extraCount;
153if (rgb.Length + ib > cb)
203_hash.TransformBlock(_password, 0, _password.Length, _password, 0);
207_hash.TransformBlock(_salt, 0, _salt.Length, _salt, 0);
236cs.Write(_baseValue!, 0, _baseValue!.Length);
249cs.Write(_baseValue, 0, _baseValue.Length);
System\Security\Cryptography\RSA.cs (17)
106if (destination.Length >= result.Length)
109bytesWritten = result.Length;
121if (destination.Length >= result.Length)
124bytesWritten = result.Length;
330if (destination.Length >= result.Length)
333bytesWritten = result.Length;
345if (destination.Length >= result.Length)
348bytesWritten = result.Length;
376return SignData(data, 0, data.Length, hashAlgorithm, padding);
389ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
392ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
638return VerifyData(data, 0, data.Length, signature, hashAlgorithm, padding);
652ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length);
655ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset);
735rentSize = rented.Length;
778rentSize = rented.Length;
1454if (written > rented.Length)
System.Security.Cryptography.Cose (17)
System.Security.Cryptography.Pkcs (107)
System.Security.Cryptography.ProtectedData (3)
System.Security.Cryptography.Xml (84)
System\Security\Cryptography\Xml\CanonicalXmlAttribute.cs (3)
36hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
38hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
41hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlComment.cs (5)
56hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
60hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
62hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
64hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
68hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlElement.cs (3)
140hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
150hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
168hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlProcessingInstruction.cs (6)
51hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
55hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
58hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
63hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
67hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
72hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\EncryptedXml.cs (9)
302Buffer.BlockCopy(cipherValue, 0, IV, 0, IV.Length);
721cipher = enc.TransformFinalBlock(plaintext, 0, plaintext.Length);
738output = new byte[cipher.Length + IV.Length];
739Buffer.BlockCopy(IV, 0, output, 0, IV.Length);
740Buffer.BlockCopy(cipher, 0, output, IV.Length, cipher.Length);
793lengthIV = decryptionIV.Length;
799output = dec.TransformFinalBlock(cipherValue, lengthIV, cipherValue.Length - lengthIV);
System\Security\Cryptography\Xml\SymmetricKeyWrap.cs (35)
38byte[] rgbWKCKS = new byte[rgbWrappedKeyData.Length + 8];
51Buffer.BlockCopy(rgbWrappedKeyData, 0, rgbWKCKS, 0, rgbWrappedKeyData.Length);
52Buffer.BlockCopy(rgbCKS, 0, rgbWKCKS, rgbWrappedKeyData.Length, 8);
53byte[] temp1 = enc1.TransformFinalBlock(rgbWKCKS, 0, rgbWKCKS.Length);
54byte[] temp2 = new byte[rgbIV.Length + temp1.Length];
55Buffer.BlockCopy(rgbIV, 0, temp2, 0, rgbIV.Length);
56Buffer.BlockCopy(temp1, 0, temp2, rgbIV.Length, temp1.Length);
60return enc2.TransformFinalBlock(temp2, 0, temp2.Length);
74if (rgbEncryptedWrappedKeyData.Length != 32 && rgbEncryptedWrappedKeyData.Length != 40
75&& rgbEncryptedWrappedKeyData.Length != 48)
89byte[] temp2 = dec1.TransformFinalBlock(rgbEncryptedWrappedKeyData, 0, rgbEncryptedWrappedKeyData.Length);
94byte[] temp1 = new byte[temp2.Length - rgbIV.Length];
95Buffer.BlockCopy(temp2, 8, temp1, 0, temp1.Length);
98byte[] rgbWKCKS = dec2.TransformFinalBlock(temp1, 0, temp1.Length);
101byte[] rgbWrappedKeyData = new byte[rgbWKCKS.Length - 8];
102Buffer.BlockCopy(rgbWKCKS, 0, rgbWrappedKeyData, 0, rgbWrappedKeyData.Length);
106for (int index = rgbWrappedKeyData.Length, index1 = 0; index < rgbWKCKS.Length; index++, index1++)
123int N = rgbWrappedKeyData.Length >> 3;
125if ((rgbWrappedKeyData.Length % 8 != 0) || N <= 0)
143byte[] temp = new byte[s_rgbAES_KW_IV.Length + rgbWrappedKeyData.Length];
144Buffer.BlockCopy(s_rgbAES_KW_IV, 0, temp, 0, s_rgbAES_KW_IV.Length);
145Buffer.BlockCopy(rgbWrappedKeyData, 0, temp, s_rgbAES_KW_IV.Length, rgbWrappedKeyData.Length);
146return enc.TransformFinalBlock(temp, 0, temp.Length);
152Buffer.BlockCopy(rgbWrappedKeyData, 0, rgbOutput, 8, rgbWrappedKeyData.Length);
185int N = (rgbEncryptedWrappedKeyData.Length >> 3) - 1;
187if ((rgbEncryptedWrappedKeyData.Length % 8 != 0) || N <= 0)
206byte[] temp = dec.TransformFinalBlock(rgbEncryptedWrappedKeyData, 0, rgbEncryptedWrappedKeyData.Length);
218Buffer.BlockCopy(rgbEncryptedWrappedKeyData, 8, rgbOutput, 0, rgbOutput.Length);
System.Security.Permissions (5)
System.ServiceModel.Http (20)
System.ServiceModel.NetFramingBase (9)
System.ServiceModel.NetNamedPipe (3)
System.ServiceModel.NetTcp (3)
System.ServiceModel.Primitives (511)
Internals\System\Runtime\UrlUtility.cs (4)
91return AsciiEncoding.GetString(bytes, 0, bytes.Length);
155bytes = UrlEncodeBytesToBytesInternalNonAscii(bytes, 0, bytes.Length, false);
157return AsciiEncoding.GetString(bytes, 0, bytes.Length);
177return UrlEncodeBytesToBytesInternal(bytes, 0, bytes.Length, false);
Internals\System\Text\BinHexEncoding.cs (14)
66if (charIndex > chars.Length)
67throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(charIndex), SRP.Format(SRP.OffsetExceedsBufferSize, chars.Length)));
70if (charCount > chars.Length - charIndex)
71throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(charCount), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)));
76if (byteIndex > bytes.Length)
77throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(byteIndex), SRP.Format(SRP.OffsetExceedsBufferSize, bytes.Length)));
79if (byteCount < 0 || byteCount > bytes.Length - byteIndex)
132if (byteIndex > bytes.Length)
133throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(byteIndex), SRP.Format(SRP.OffsetExceedsBufferSize, bytes.Length)));
136if (byteCount > bytes.Length - byteIndex)
137throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(byteCount), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)));
143if (charIndex > chars.Length)
144throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(charIndex), SRP.Format(SRP.OffsetExceedsBufferSize, chars.Length)));
145if (charCount < 0 || charCount > chars.Length - charIndex)
Internals\System\Xml\XmlMtomReader.cs (47)
108for (int i = 0; i < encodings.Length; i++)
114_encodings = new Encoding[encodings.Length];
234for (int i = 0; i < _encodings.Length; i++)
247for (int i = 0; i < _encodings.Length; i++)
258for (int i = 0; i < _encodings.Length; i++)
271for (int i = 0; i < _encodings.Length; i++)
1214if (offset > buffer.Length)
1215throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length)));
1218if (count > buffer.Length - offset)
1219throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
1261if (offset > buffer.Length)
1262throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length)));
1265if (count > buffer.Length - offset)
1266throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
1306if (offset > buffer.Length)
1307throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length)));
1310if (count > buffer.Length - offset)
1311throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
1364if (offset > chars.Length)
1365throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, chars.Length)));
1368if (count > chars.Length - offset)
1369throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, chars.Length - offset)));
1411else if (_valueBuffer.Length < byteCount)
1956while (0 != Read(caller, scratch, 0, scratch.Length))
1994if (delimitter.Length > end - start)
2003for (int i = delimitter.Length - 1; i >= 1; i--)
2026ptr += delimitter.Length;
2075if (matchBuffer == null || matchBuffer.Length < delimitter.Length - read)
2076matchBuffer = new byte[delimitter.Length - read];
2078int matched = stream.ReadBlock(matchBuffer, 0, delimitter.Length - read);
2108if (start + count != delimitter.Length)
2189if (offset > buffer.Length)
2190throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length)));
2193if (count > buffer.Length - offset)
2194throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
2668maxOffset = stream.Read(buffer, 0, buffer.Length);
2927if (offset > buffer.Length)
2928throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length)));
2931if (count > buffer.Length - offset)
2932throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
2974if (storedBuffer == null || storedBuffer.Length < count)
2985else if (count <= storedBuffer.Length - storedLength + storedOffset)
3124else if (!(data[offset] < s_fqtext.Length && s_fqtext[data[offset]]))
3156if (data[offset] > s_ttext.Length)
3172for (; offset < data.Length && data[offset] < s_digits.Length && s_digits[data[offset]]; offset++)
3186if (!(data[i] < s_boundary.Length && s_boundary[data[i]]))
Internals\System\Xml\XmlMtomWriter.cs (18)
321if (count > buffer.Length - index)
322throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - index)));
377Writer.WriteBase64(data.chunk, 0, data.chunk.Length);
396await Writer.WriteBase64Async(data.chunk, 0, data.chunk.Length);
526s.Write(data.chunk, 0, data.chunk.Length);
565await s.WriteAsync(data.chunk, 0, data.chunk.Length);
799while ((count = reader.ReadValueChunk(_chars, 0, _chars.Length)) > 0)
823while ((count = reader.ReadValueAsBase64(_bytes, 0, _bytes.Length)) > 0)
1079int size = XmlMtomWriter.ValidateSizeOfMessage(maxSizeInBytes, 0, MimeGlobals.CRLF.Length * 3);
1175int size = XmlMtomWriter.ValidateSizeOfMessage(maxSizeInBytes, 0, MimeGlobals.COLONSPACE.Length + MimeGlobals.CRLF.Length);
1183byte[] boundaryBytes = new byte[boundary.Length + MimeGlobals.BoundaryPrefix.Length];
1184for (int i = 0; i < MimeGlobals.BoundaryPrefix.Length; i++)
1186Encoding.ASCII.GetBytes(boundary, 0, boundary.Length, boundaryBytes, MimeGlobals.BoundaryPrefix.Length);
1200return boundaryBytes.Length;
1407int currSize = buffer.Length;
1444Write(value, 0, value.Length);
1541return chunk.Length;
System\ServiceModel\Channels\SequenceRangeCollection.cs (19)
25if (sortedRanges.Length == 0)
29else if (sortedRanges.Length == 1)
41if (sortedRanges.Length == 0)
48if (sortedRanges.Length == 1)
78if (lowerBound == sortedRanges.Length)
80SequenceRange[] returnedRanges = new SequenceRange[sortedRanges.Length + 1];
81Array.Copy(sortedRanges, returnedRanges, sortedRanges.Length);
82returnedRanges[sortedRanges.Length] = range;
89if (sortedRanges.Length == 1)
116if ((upperBound == sortedRanges.Length) || (sortedRanges[upperBound].Lower != range.Upper + 1))
123SequenceRange[] returnedRanges = new SequenceRange[sortedRanges.Length + 1];
124Array.Copy(sortedRanges, 0, returnedRanges, 1, sortedRanges.Length);
134int rangesRemaining = sortedRanges.Length - rangesRemoved + 1;
144Array.Copy(sortedRanges, upperBound + 1, returnedRanges, lowerBound + 1, sortedRanges.Length - upperBound - 1);
193if (index < 0 || index >= _ranges.Length)
195SRP.Format(SRP.ValueMustBeInRange, 0, _ranges.Length - 1)));
200public override int Count => _ranges.Length;
204if (_ranges.Length == 0)
208else if (_ranges.Length == 1)
System\ServiceModel\Dispatcher\PrimitiveOperationFormatter.cs (18)
651if (parts.Length != parameters.Length)
654new ArgumentException(SRP.Format(SRP.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters"));
660for (int i = nextPartIndex; i < parts.Length; i++)
730if (parts.Length != parameters.Length)
733new ArgumentException(SRP.Format(SRP.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters"));
736for (int i = 0; i < parts.Length; i++)
958writer.WriteBase64(arrayValue, 0, arrayValue.Length);
964writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
970writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
976writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
982writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
988writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
994writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
1000writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
System\ServiceModel\Security\WSUtilitySpecificationVersion.cs (6)
122writer.WriteChars(creationTime, 0, creationTime.Length);
127writer.WriteChars(expiryTime, 0, expiryTime.Length);
173stream.Write(_fragment1, 0, _fragment1.Length);
175stream.Write(_fragment2, 0, _fragment2.Length);
177stream.Write(_fragment3, 0, _fragment3.Length);
179stream.Write(_fragment4, 0, _fragment4.Length);
System.ServiceModel.Primitives.Tests (7)
System.ServiceModel.Syndication (3)
System.Text.Encoding.CodePages (62)
System.Text.Encodings.Web (5)
System.Text.Json (105)
System\Text\Json\BitStack.cs (15)
67Debug.Assert(index >= 0, $"Set - Negative - index: {index}, arrayLength: {_array.Length}");
70Debug.Assert(_array.Length <= int.MaxValue / 32 + 1, $"index: {index}, arrayLength: {_array.Length}");
76if (elementIndex >= _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}");
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}");
135Debug.Assert(_array.Length < int.MaxValue / 2, $"Array too large - arrayLength: {_array.Length}");
136Debug.Assert(minSize >= 0 && minSize >= _array.Length);
138int nextDouble = Math.Max(minSize + 1, _array.Length * 2);
System\Text\Json\Document\JsonDocument.Parse.cs (11)
690MetadataDb database = MetadataDb.CreateLocked(utf8Json.Length);
691database.Append(tokenType, startLocation: 0, utf8Json.Length);
788Debug.Assert(rented.Length >= utf8Bom.Length);
807if (rented.Length == written)
810rented = ArrayPool<byte>.Shared.Rent(checked(toReturn.Length * 2));
811Buffer.BlockCopy(toReturn, 0, rented, 0, toReturn.Length);
816lastRead = stream.Read(rented, written, rented.Length - written);
871Debug.Assert(rented.Length >= JsonConstants.Utf8Bom.Length);
895if (rented.Length == written)
898rented = ArrayPool<byte>.Shared.Rent(toReturn.Length * 2);
899Buffer.BlockCopy(toReturn, 0, rented, 0, toReturn.Length);
System.Text.Json.SourceGeneration (11)
System.Text.RegularExpressions (192)
System\Text\RegularExpressions\RegexRunner.cs (19)
260runtrackpos = runtrack!.Length;
261runstackpos = runstack!.Length;
262runcrawlpos = runcrawl!.Length;
306runtrackpos = runtrack!.Length;
307runstackpos = runstack!.Length;
308runcrawlpos = runcrawl.Length;
455int[] newtrack = new int[runtrack!.Length * 2];
457Array.Copy(runtrack, 0, newtrack, runtrack.Length, runtrack.Length);
458runtrackpos += runtrack.Length;
468int[] newstack = new int[runstack!.Length * 2];
470Array.Copy(runstack, 0, newstack, runstack.Length, runstack.Length);
471runstackpos += runstack.Length;
480int[] newcrawl = new int[runcrawl!.Length * 2];
482Array.Copy(runcrawl, 0, newcrawl, runcrawl.Length, runcrawl.Length);
483runcrawlpos += runcrawl.Length;
511return runcrawl!.Length - runcrawlpos;
System\Text\RegularExpressions\Symbolic\BDDRangeConverter.cs (22)
55var result = new (uint, uint)[(1 << newBits) * ranges.Length];
70if (ranges[0].Item1 == 0 && ranges[ranges.Length - 1].Item2 == maximal)
76for (int i = 1; i < result.Length; i++)
115ranges = new (uint, uint)[ranges1.Length];
116for (int i = 0; i < ranges1.Length; i++)
136ranges = new (uint, uint)[rangesR.Length];
138for (int i = 1; i < rangesR.Length; i++)
145ranges = new (uint, uint)[rangesR.Length + 1];
147for (int i = 0; i < rangesR.Length; i++)
159(uint, uint) last = rangesL[rangesL.Length - 1];
169for (int i = 0; i < rangesL.Length - 1; i++)
195ranges = new (uint, uint)[rangesL.Length + rangesR.Length - 1];
196for (int i = 0; i < rangesL.Length - 1; i++)
201ranges[rangesL.Length - 1] = (last.Item1, first.Item2 | mask);
202for (int i = 1; i < rangesR.Length; i++)
204ranges[rangesL.Length - 1 + i] = (rangesR[i].Item1 | mask, rangesR[i].Item2 | mask);
209ranges = new (uint, uint)[rangesL.Length + rangesR.Length];
210for (int i = 0; i < rangesL.Length; i++)
215for (int i = 0; i < rangesR.Length; i++)
217ranges[rangesL.Length + i] = (rangesR[i].Item1 | mask, rangesR[i].Item2 | mask);
System.Text.RegularExpressions.Generator (64)
RegexGenerator.Emitter.cs (45)
1394literalChars.Length switch
4691Debug.Assert(args.Length is >= 1);
4694string key = $"{MethodName}{args.Length}";
4700var lines = new string[24 + args.Length];
4701lines[0] = $"/// <summary>Pushes {args.Length} value{(args.Length == 1 ? "" : "s")} onto the backtracking stack.</summary>";
4703lines[2] = $"internal static void {MethodName}(ref int[] stack, ref int pos{FormatN(", int arg{0}", args.Length)})";
4705lines[4] = $" // If there's space available for {(args.Length > 1 ? $"all {args.Length} values, store them" : "the value, store it")}.";
4708lines[7] = $" if ((uint){(args.Length > 1 ? $"(p + {args.Length - 1})" : "p")} < (uint)s.Length)";
4710for (int i = 0; i < args.Length; i++)
4714lines[9 + args.Length] = args.Length > 1 ? $" pos += {args.Length};" : " pos++;";
4715lines[10 + args.Length] = $" return;";
4716lines[11 + args.Length] = $" }}";
4717lines[12 + args.Length] = $"";
4718lines[13 + args.Length] = $" // Otherwise, resize the stack to make room and try again.";
4719lines[14 + args.Length] = $" WithResize(ref stack, ref pos{FormatN(", arg{0}", args.Length)});";
4720lines[15 + args.Length] = $"";
4721lines[16 + args.Length] = $" // <summary>Resize the backtracking stack array and push {args.Length} value{(args.Length == 1 ? "" : "s")} onto the stack.</summary>";
4722lines[17 + args.Length] = $" [MethodImpl(MethodImplOptions.NoInlining)]";
4723lines[18 + args.Length] = $" static void WithResize(ref int[] stack, ref int pos{FormatN(", int arg{0}", args.Length)})";
4724lines[19 + args.Length] = $" {{";
4725lines[20 + args.Length] = $" Array.Resize(ref stack, (pos + {args.Length - 1}) * 2);";
4726lines[21 + args.Length] = $" {MethodName}(ref stack, ref pos{FormatN(", arg{0}", args.Length)});";
4727lines[22 + args.Length] = $" }}";
4728lines[23 + args.Length] = $"}}";
4743Debug.Assert(args.Length is >= 1);
4745if (args.Length == 1)
4752string key = $"{MethodName}{args.Length}";
4756var lines = new string[5 + args.Length];
4757lines[0] = $"/// <summary>Pops {args.Length} value{(args.Length == 1 ? "" : "s")} from the backtracking stack.</summary>";
4759lines[2] = $"internal static void {MethodName}(int[] stack, ref int pos{FormatN(", out int arg{0}", args.Length)})";
4761for (int i = 0; i < args.Length; i++)
4765lines[4 + args.Length] = $"}}";
5433for (int i = 0; i < parts.Length; i++)
System.Threading.Channels (20)
System.Threading.RateLimiting (19)
System.Threading.Tasks.Dataflow (25)
System.Threading.Tasks.Parallel (13)
System.Transactions.Local (12)
System\Transactions\TransactionInteropNonWindows.cs (9)
57var whereaboutsCopy = new byte[whereabouts.Length];
58Buffer.BlockCopy(whereabouts, 0, whereaboutsCopy, 0, whereabouts.Length);
75if (cookie.Length < 32)
86var cookieCopy = new byte[cookie.Length];
87Buffer.BlockCopy(cookie, 0, cookieCopy, 0, cookie.Length);
145if (propagationToken.Length < 24)
246if (propagationToken.Length < 24)
251byte[] propagationTokenCopy = new byte[propagationToken.Length];
252Array.Copy(propagationToken, propagationTokenCopy, propagationToken.Length);
System.Web.HttpUtility (4)
System.Web.Services.Description (74)
System.Windows.Controls.Ribbon (9)
System.Windows.Forms (527)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (3)
781OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Refresh, null), indexStart, dataGridViewRows.Length);
1753if (dataGridViewRows.Length == 1)
1831OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Refresh, null), rowIndex, dataGridViewRows.Length, false, true, false, newCurrentCell);
System\Windows\Forms\Controls\ListView\ListView.cs (30)
464for (int i = 0; i < items.Length; i++)
509for (int i = 0; i < items.Length; i++)
2506ColumnHeader? col = (_columnHeaders is not null && _columnHeaders.Length > 0) ? _columnHeaders[0] : null;
3058for (int colIdx = _columnHeaders.Length - 1; colIdx >= 0; colIdx--)
3453for (int i = 0; i < _columnHeaders.Length; i++)
3798for (int i = 0; i < _columnHeaders.Length; i++)
3828int columnCount = _columnHeaders is null ? 0 : _columnHeaders.Length;
3988if (items is null || items.Length == 0)
4005for (int i = 0; i < items.Length; i++)
4019for (int i = 0; i < items.Length; i++)
4030for (int i = 0; i < items.Length; i++)
4084if (items is null || items.Length == 0)
4110for (int i = 0; i < items.Length; i++)
4125cColumns = (uint)(_columnHeaders is not null ? Math.Min(MAXTILECOLUMNS, _columnHeaders.Length) : 0),
4598int columnCount = _columnHeaders is null ? 0 : _columnHeaders.Length;
4674_savedSelectedItems = new List<ListViewItem>(lviArr.Length);
4675for (int i = 0; i < lviArr.Length; i++)
5242ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _columnHeaders?.Length ?? 0);
5320int[] orderedColumns = new int[indices.Length];
5321for (int i = 0; i < indices.Length; i++)
5334(WPARAM)orderedColumns.Length,
5601for (int i = 0; i < _columnHeaders.Length; i++)
5801cLines = _columnHeaders is not null ? _columnHeaders.Length : 0,
6043if (_columnHeaders is not null && _columnHeaders.Length > nmheader->iItem)
6059if (_columnHeaders is not null && nmheader->iItem < _columnHeaders.Length &&
6094if (_columnHeaders is not null && nmheader->iItem < _columnHeaders.Length)
6152if (_columnHeaders is not null && _columnHeaders.Length > nmheader->iItem)
6274if (_columnHeaders is not null && _columnHeaders.Length > nmheader->iItem)
6292Debug.Assert(_columnHeaders!.Length > 0, "there should be a column that we need to compensate for");
6824Marshal.Copy(charBuf, 0, destPtr, Math.Min(charBuf.Length, infoTip->cchTextMax));
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (20)
376if (_selectedObjects is not null && _selectedObjects.Length > 0 && _rootEntry is not null)
890get => _selectedObjects is null || _selectedObjects.Length == 0 ? null : _selectedObjects[0];
917if (value is not null && value.Length > 0)
919for (int count = 0; count < value.Length; count++)
923throw new ArgumentException(string.Format(SR.PropertyGridSetNull, count, value.Length));
936&& _selectedObjects.Length == value.Length)
941for (int i = 0; i < value.Length && (isSame || classesSame); i++)
1544int oldArraySize = tabComponents is null ? 0 : tabComponents.Length;
1784if (verbs is not null && verbs.Length > 0)
2152if (components is null || components.Length == 0)
2165for (int i = 0; i < tabAttribute.TabScopes.Length; i++)
2173for (int i = 1; i < components.Length && tabClasses.Count > 0; i++)
2436for (int i = 0; i < tabAttribute.TabClasses.Length; i++)
2483for (int i = 0; i < tabAttribute.TabClasses.Length; i++)
2499if (i < newObjects.Length)
2502Array.Copy(_selectedObjects, i + 1, newObjects, i, newObjects.Length - i);
3455for (int i = 0; i < tabAttribute.TabClasses.Length; i++)
3501object[] newComponents = new object[components!.Length - 1];
3503Array.Copy(components, index + 1, newComponents, index, components.Length - index - 1);
3508killTab = components is not null && components.Length == 0;
System\Windows\Forms\Layout\TableLayout.cs (34)
27if (array.Length > 1)
30sorter.QuickSort(0, array.Length - 1);
119CommonProperties.SetLayoutBounds(containerInfo.Container, new Size(SumStrips(containerInfo.Columns, 0, containerInfo.Columns.Length),
120SumStrips(containerInfo.Rows, 0, containerInfo.Rows.Length)));
180if (tempInfo.Columns is not null && containerInfo.Columns is not null && (tempInfo.Columns.Length != containerInfo.Columns.Length))
185if (tempInfo.Rows is not null && containerInfo.Rows is not null && (tempInfo.Rows.Length != containerInfo.Rows.Length))
226if (cols.Length != 0 && totalSpace.Width > usedSpace.Width)
231if (rows.Length != 0 && totalSpace.Height > usedSpace.Height)
473if (containerInfo.Rows is null || containerInfo.Rows.Length != numRows)
478if (containerInfo.Columns is null || containerInfo.Columns.Length != numColumns)
493for (int i = ++index; i < layoutInfo.Length; i++)
502index = layoutInfo.Length;
655for (int i = 0; i < strips.Length; i++)
739int colStop = Math.Min(layoutInfo.ColumnStart + layoutInfo.ColumnSpan, containerInfo.Columns.Length);
760for (int i = 0; i < strips.Length; i++)
780for (int i = 0; i < strips.Length; i++)
856int rowStop = Math.Min(layoutInfo.RowStart + layoutInfo.RowSpan, containerInfo.Rows.Length);
872for (int i = start; i < Math.Min(start + span, strips.Length); i++)
949if (!(i == strips.Length - 1) // this is not the last strip
1023for (int i = 0; i < strips.Length; i++)
1088totalPercentAllocatedSpace = maxSize - totalAbsoluteAndAutoSizeAllocatedSpace - (strips.Length * cellBorderWidth);
1093for (int i = 0; i < strips.Length; i++)
1117for (int i = 0; i < strips.Length; i++)
1151for (int i = 0; i < strips.Length; i++)
1169Debug.Assert((dontHonorConstraint || (usedSpace == SumStrips(strips, 0, strips.Length))), "Error computing usedSpace.");
1195for (int i = 0; i < childrenInfo.Length; i++)
1232for (; currentCol < colStop && currentCol < containerInfo.Columns.Length; currentCol++)
1246for (int rowIndex = currentRow; rowIndex < rowStop && rowIndex < containerInfo.Rows.Length; rowIndex++)
1429Debug.Assert((containerInfo.Columns is null && cols is null) || containerInfo.Columns!.Length == cols.Length,
1431Debug.Assert((containerInfo.Rows is null && rows is null) || containerInfo.Rows!.Length == rows.Length,
System.Windows.Forms.Analyzers.CSharp (1)
System.Windows.Forms.Analyzers.Tests (2)
System.Windows.Forms.Design (322)
System.Windows.Forms.IntegrationTests.Common (1)
System.Windows.Forms.Interop.Tests (1)
System.Windows.Forms.Primitives (11)
System.Windows.Forms.Primitives.Tests (99)
System.Windows.Forms.Primitives.TestUtilities (8)
System.Windows.Forms.Tests (63)
System.Windows.Forms.UI.IntegrationTests (18)
System.Xaml (97)
TaskUsageLogger (3)
Templates.Blazor.Tests (17)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
555Array.Clear(keyBytes, 0, keyBytes.Length);
556Array.Clear(pem, 0, pem.Length);
562Array.Clear(keyBytes, 0, keyBytes.Length);
563Array.Clear(pem, 0, pem.Length);
613Array.Clear(bytes, 0, bytes.Length);
641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
Templates.Blazor.WebAssembly.Auth.Tests (17)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
555Array.Clear(keyBytes, 0, keyBytes.Length);
556Array.Clear(pem, 0, pem.Length);
562Array.Clear(keyBytes, 0, keyBytes.Length);
563Array.Clear(pem, 0, pem.Length);
613Array.Clear(bytes, 0, bytes.Length);
641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
Templates.Blazor.WebAssembly.Tests (17)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
555Array.Clear(keyBytes, 0, keyBytes.Length);
556Array.Clear(pem, 0, pem.Length);
562Array.Clear(keyBytes, 0, keyBytes.Length);
563Array.Clear(pem, 0, pem.Length);
613Array.Clear(bytes, 0, bytes.Length);
641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
Templates.Mvc.Tests (17)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
555Array.Clear(keyBytes, 0, keyBytes.Length);
556Array.Clear(pem, 0, pem.Length);
562Array.Clear(keyBytes, 0, keyBytes.Length);
563Array.Clear(pem, 0, pem.Length);
613Array.Clear(bytes, 0, bytes.Length);
641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
Templates.Tests (17)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
555Array.Clear(keyBytes, 0, keyBytes.Length);
556Array.Clear(pem, 0, pem.Length);
562Array.Clear(keyBytes, 0, keyBytes.Length);
563Array.Clear(pem, 0, pem.Length);
613Array.Clear(bytes, 0, bytes.Length);
641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
TestDiscoveryWorker (1)
TestingAppHost1.MyWebApp (1)
TestProject.AppHost (2)
TestTasks (1)
UIAutomationClient (67)
UIAutomationClientSideProviders (68)
UIAutomationProvider (1)
UIAutomationTypes (20)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsCLR.cs (17)
5905get { return buffer.Length; }
5910IntPtr result = Marshal.AllocCoTaskMem(buffer.Length);
5911Marshal.Copy(buffer, 0, result, buffer.Length);
5919while (i < buffer.Length && buffer[i] != 0)
5924if (i < buffer.Length)
5934Marshal.Copy(ptr, buffer, 0, buffer.Length);
5941int count = Math.Min(bytes.Length, buffer.Length - offset);
5946if (offset < buffer.Length)
5963get { return buffer.Length; }
5968IntPtr result = Marshal.AllocCoTaskMem(buffer.Length * 2);
5969Marshal.Copy(buffer, 0, result, buffer.Length);
5977while (i < buffer.Length && buffer[i] != 0)
5982if (i < buffer.Length)
5991Marshal.Copy(ptr, buffer, 0, buffer.Length);
5997int count = Math.Min(s.Length, buffer.Length - offset);
6002if (offset < buffer.Length)
UnitTests.Common (12)
vbc (2)
VBCSCompiler (2)
VBCSCompiler.UnitTests (4)
VersioningWebSite (1)
VisualBasicErrorFactsGenerator (1)
VisualBasicRuntimeTest (1)
VisualBasicSyntaxGenerator (2)
Wasm.Performance.ConsoleHost (4)
Wasm.Performance.Driver (1)
WebSocketSample (1)
WinFormsControlsTest (19)
WinShimmer (2)
XmlFileLogger (3)
xunit.assert (10)
xunit.console (8)