220 references to MaxValue
BinaryFormatTests (4)
FormatTests\FormattedObject\ListTests.cs (2)
25short.MaxValue, 98new List<short>() { 0, -2, short.MinValue, short.MaxValue },
FormatTests\FormattedObject\PrimitiveTypeTests.cs (2)
55{ (byte)PrimitiveType.Int16, short.MaxValue }, 123short.MaxValue,
dotnet-svcutil-lib (13)
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeHelper.cs (1)
184Debug.Assert(pageNode[0].PageInfo.PageNumber <= Int16.MaxValue);
FrameworkFork\Microsoft.Xml\Xml\schema\DatatypeImplementation.cs (1)
3388private static readonly FacetsChecker s_numeric10FacetsChecker = new Numeric10FacetsChecker(short.MinValue, short.MaxValue);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (1)
919if (value < (int)Int16.MinValue || value > (int)Int16.MaxValue)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlReaderDelegator.cs (1)
423if (value < short.MinValue || value > short.MaxValue)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryReader.cs (1)
963if (i < Int16.MinValue || i > Int16.MaxValue)
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointAddress.cs (8)
527buffer = new XmlBuffer(short.MaxValue); 723buffer = new XmlBuffer(short.MaxValue); 803buffer = new XmlBuffer(short.MaxValue); 817buffer = new XmlBuffer(short.MaxValue); 831buffer = new XmlBuffer(short.MaxValue); 860buffer = new XmlBuffer(short.MaxValue); 928buffer = new XmlBuffer(short.MaxValue); 1336_metadataBuffer = new XmlBuffer(short.MaxValue);
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTests.SpecialTypes.cs (1)
200new object[] {"short", "short.MaxValue", short.MaxValue, true },
Microsoft.CodeAnalysis (6)
EnumConstantHelper.cs (1)
53overflowKind = CheckOverflow(short.MaxValue, previous, offset);
MetadataReader\MetadataHelpers.cs (1)
538if (intArity <= short.MaxValue)
MetadataReader\MetadataTypeName.cs (3)
95Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 126Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 155Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue);
Symbols\Attributes\MarshalPseudoCustomAttributeData.cs (1)
154Debug.Assert(_marshalType == UnmanagedType.LPArray && _marshalParameterIndex <= short.MaxValue);
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
48{ short.MaxValue, nameof(short.MaxValue) },
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Conversions.cs (2)
3611case SpecialType.System_Int16: return (short.MinValue - 1D) < value && value < (short.MaxValue + 1D); 3641case SpecialType.System_Int16: return (short.MinValue - 1M) < value && value < (short.MaxValue + 1M);
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1376return short.MinValue <= value && value <= short.MaxValue;
Utilities\ValueSetFactory.ShortTC.cs (2)
20short INumericTC<short>.MaxValue => short.MaxValue; 45Debug.Assert(value != short.MaxValue);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenIncrementTests.cs (1)
102TestIncrementCompilationAndOutput<short>(short.MaxValue, short.MinValue);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (5)
Compilation\GetSemanticInfoTests.cs (4)
908EnumOffset(ConstantValue.Create((short)(short.MaxValue - 3)), 3, EnumOverflowKind.NoOverflow, ConstantValue.Create((short)short.MaxValue)); 909EnumOffset(ConstantValue.Create((short)(short.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad); 910EnumOffset(ConstantValue.Create((short)(short.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad);
Symbols\LookupSymbolsInfoTests.cs (1)
45if (_current == short.MaxValue)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxFactoryTests.cs (1)
325CheckLiteralToString(short.MaxValue, @"32767");
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
135VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(short.MaxValue), "global::System.Int16.MaxValue");
Microsoft.CodeAnalysis.VisualBasic (2)
Binding\Binder_InterpolatedString.vb (2)
54If constantValue.Int64Value < -Short.MaxValue Then 58If constantValue.UInt64Value > Short.MaxValue Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (1)
118value >= Short.MinValue AndAlso value <= Short.MaxValue Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (1)
118value >= Short.MinValue AndAlso value <= Short.MaxValue Then
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
48{ short.MaxValue, nameof(short.MaxValue) },
Microsoft.CodeAnalysis.Workspaces.UnitTests (11)
ObjectSerializationTests.cs (11)
280TestRoundTripValue(Int16.MaxValue); 283TestRoundTripValue(Int16.MaxValue); 367TestRoundTripValue<Int64>(Int16.MaxValue); 415writer.WriteInt16(Int16.MaxValue); 418writer.WriteInt32(Int16.MaxValue); 439Assert.Equal(Int16.MaxValue, reader.ReadInt16()); 442Assert.Equal(Int16.MaxValue, reader.ReadInt32()); 469writer.WriteScalarValue(Int16.MaxValue); 472writer.WriteScalarValue((Int32)Int16.MaxValue); 507Assert.Equal(Int16.MaxValue, (Int16)reader.ReadScalarValue()); 510Assert.Equal(Int16.MaxValue, (Int32)reader.ReadScalarValue());
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (1)
1531if (value <= (ulong)short.MaxValue)
Microsoft.Data.Analysis (3)
PrimitiveDataFrameColumnComputations.cs (3)
4256var ret = short.MaxValue; 4473var value = short.MaxValue; 4496var value = short.MaxValue;
Microsoft.Data.Analysis.PerformanceTests (1)
PerformanceTests.cs (1)
38var shortValues = values.Select(v => (short)(v % short.MaxValue + 1)).ToArray();
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
224InterimProperty = short.MaxValue
Microsoft.Gen.Metrics.Generated.Tests (1)
MetricTests.cs (1)
146const int Value = short.MaxValue + 2;
Microsoft.ML.Core (2)
Data\DataKind.cs (2)
175return (ulong)short.MaxValue; 202return (ulong)short.MaxValue;
Microsoft.ML.Core.Tests (1)
UnitTests\DataTypes.cs (1)
120short maxValue = short.MaxValue;
Microsoft.ML.Data (2)
Data\Conversion.cs (2)
1239TryParseSigned(I2.MaxValue, in src, out long? res); 1461TryParseSigned(I2.MaxValue, in src, out long? res);
Microsoft.ML.Tests (8)
CollectionsDataViewTest.cs (2)
122fShort = short.MaxValue - 1, 137fShort = short.MaxValue,
TextLoaderTests.cs (2)
36string.Format("{0},{1},{2},{3}", sbyte.MaxValue, short.MaxValue, int.MaxValue, long.MaxValue), 55short[] shortTargets = new short[] { short.MinValue, short.MaxValue, default };
Transformers\ConvertTests.cs (3)
159AG = new short[]{ short.MinValue, short.MaxValue}, 227AG = new short[]{ short.MinValue, short.MaxValue}, 239ConvG = new float[] { short.MinValue, short.MaxValue },
Transformers\HashTests.cs (1)
249if (value <= (ulong)short.MaxValue)
Microsoft.ML.Transforms (1)
Expression\IlGeneratorExtensions.cs (1)
214Contracts.Assert(0 <= arg && arg <= short.MaxValue);
Microsoft.VisualBasic.Core (10)
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (5)
1754If result >= Short.MinValue AndAlso result <= Short.MaxValue Then 2068If result >= Short.MinValue AndAlso result <= Short.MaxValue Then 2362ElseIf result >= Int16.MinValue AndAlso result <= Int16.MaxValue Then 2372If result >= Short.MinValue AndAlso result <= Short.MaxValue Then 3010If result < Int16.MinValue OrElse result > Int16.MaxValue Then
Microsoft\VisualBasic\CompilerServices\Operators.vb (4)
2840If result > Int16.MaxValue OrElse result < Int16.MinValue Then 3308If result < Int16.MinValue OrElse result > Int16.MaxValue Then 3723If result > Int16.MaxValue Then 3748If result > Int16.MaxValue OrElse result < Int16.MinValue Then
Microsoft\VisualBasic\VBFixedStringAttribute.vb (1)
18If (Length < 1 OrElse Length > Short.MaxValue) Then
PresentationCore (1)
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (1)
262if (scaled > short.MaxValue || scaled < short.MinValue)
ReachFramework (10)
PrintConfig\PrintSchemaShim.cs (10)
555ticket.JobCopyCount.Value = Clamp(devModeCopies, 1, short.MaxValue); 560devMode.Copies = Clamp(copyCount, 1, short.MaxValue); 746w = LengthValueFromTenthOfMillimeterToDIP(Clamp(devModePaperWidth, 1, short.MaxValue)); 752h = LengthValueFromTenthOfMillimeterToDIP(Clamp(devModePaperHeight, 1, short.MaxValue)); 773devMode.PaperLength = Clamp(LengthValueFromDIPToTenthOfMillimeter(pageHeightInDIPs), 1, short.MaxValue); 778devMode.PaperWidth = Clamp(LengthValueFromDIPToTenthOfMillimeter(pageWidthInDIPs), 1, short.MaxValue); 990short devModXResolution = Clamp(dpiX, 1, short.MaxValue); 1000short devModYResolution = Clamp(dpiY, 1, short.MaxValue); 1011short devModYResolution = Clamp(dpiY, 1, short.MaxValue); 1072devMode.Scale = Clamp(scale, short.MinValue, short.MaxValue);
ScenarioTests.Common.Tests (2)
ScenarioTestHelpers.cs (2)
125ShortValue = short.MaxValue, 167ShortValue = short.MaxValue,
System.Console (2)
System\Console.cs (2)
552if (left < 0 || left >= short.MaxValue) 554if (top < 0 || top >= short.MaxValue)
System.Data.Common (6)
System\Data\Common\Int16Storage.cs (1)
106short min = short.MaxValue;
System\Data\SQLTypes\SQLInt16.cs (5)
206if (value > short.MaxValue || value < short.MinValue) 219if (value > short.MaxValue || value < short.MinValue) 232if (value < short.MinValue || value > short.MaxValue) 245if (value < short.MinValue || value > short.MaxValue) 527public static readonly SqlInt16 MaxValue = new SqlInt16(short.MaxValue);
System.Drawing.Common.Tests (9)
System\Drawing\BitmapTests.cs (2)
635[InlineData(short.MaxValue, 1)] 636[InlineData(1, short.MaxValue)]
System\Drawing\Imaging\EncoderParameterTests.cs (1)
58[InlineData(short.MaxValue)]
System\Drawing\Imaging\ImageAttributesTests.cs (1)
1105string fileNameTooLong = new('a', short.MaxValue);
System\Drawing\Imaging\MetafileTests.cs (1)
435string fileName = GetPath(new string('a', short.MaxValue));
System\Drawing\Imaging\MetaHeaderTests.cs (1)
22[InlineData(short.MaxValue)]
System\Drawing\Imaging\PropertyItemTests.cs (1)
65yield return new object[] { int.MaxValue, int.MaxValue, short.MaxValue, new byte[1] { 0 } };
System\Drawing\Imaging\WmfPlaceableFileHeaderTests.cs (1)
24[InlineData(short.MaxValue)]
System\Drawing\Printing\PrinterSettingsTests.cs (1)
58[InlineData(short.MaxValue)]
System.Net.Security (2)
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (2)
336if (length > short.MaxValue) 461if (spnSize > short.MaxValue)
System.Private.CoreLib (47)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Integer.Signed.D.cs (1)
171if ((uint)answer > (uint)short.MaxValue + (-1 * sign + 1) / 2)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Integer.Signed.N.cs (1)
155if (answer > short.MaxValue + (-1 * sign + 1) / 2)
src\libraries\System.Private.CoreLib\src\System\Char.cs (2)
1798short actualResult = (value >= short.MaxValue) ? short.MaxValue : (short)value;
src\libraries\System.Private.CoreLib\src\System\Convert.cs (7)
775if (value > short.MaxValue) ThrowInt16OverflowException(); 793if (value > short.MaxValue) ThrowInt16OverflowException(); 799if (value < short.MinValue || value > short.MaxValue) ThrowInt16OverflowException(); 806if (value > (uint)short.MaxValue) ThrowInt16OverflowException(); 817if (value < short.MinValue || value > short.MaxValue) ThrowInt16OverflowException(); 824if (value > (ulong)short.MaxValue) ThrowInt16OverflowException(); 2115if (r < short.MinValue || r > short.MaxValue)
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (2)
1753short actualResult = (value >= short.MaxValue) ? short.MaxValue :
src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
117if ((long)uint64Value < short.MinValue || (long)uint64Value > short.MaxValue) return null;
src\libraries\System.Private.CoreLib\src\System\Int16.cs (20)
588static short IMinMaxValue<short>.MaxValue => MaxValue; 964result = (actualValue >= MaxValue) ? MaxValue : 971result = (actualValue >= BitConverter.UInt16BitsToHalf(0x7800)) ? MaxValue : 978result = (actualValue >= MaxValue) ? MaxValue : 985result = (actualValue >= MaxValue) ? MaxValue : 992result = (actualValue >= MaxValue) ? MaxValue : 999result = (actualValue >= MaxValue) ? MaxValue : 1012result = (actualValue >= MaxValue) ? MaxValue : 1043result = (actualValue >= MaxValue) ? MaxValue : 1050result = (actualValue >= BitConverter.UInt16BitsToHalf(0x7800)) ? MaxValue : 1087result = (actualValue >= MaxValue) ? MaxValue : 1401static short IBinaryIntegerParseAndFormatInfo<short>.MaxValueDiv10 => MaxValue / 10;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (2)
1693short actualResult = (value >= short.MaxValue) ? short.MaxValue :
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (1)
18private const short MaxPossibleThreadCount = short.MaxValue;
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerTracking.cs (1)
88Debug.Assert(Current != short.MaxValue);
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
1870short actualResult = (value >= new UInt128(0x0000_0000_0000_0000, 0x0000_0000_0000_7FFF)) ? short.MaxValue : (short)value;
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (2)
1004short actualResult = (value >= short.MaxValue) ? short.MaxValue : (short)value;
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (2)
1043short actualResult = (value >= (uint)short.MaxValue) ? short.MaxValue : (short)value;
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (2)
1042short actualResult = (value >= (ulong)short.MaxValue) ? short.MaxValue : (short)value;
src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (2)
1045short actualResult = (value >= (nuint)short.MaxValue) ? short.MaxValue : (short)value;
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
556if (value < short.MinValue || value > short.MaxValue)
System\Xml\XmlBinaryWriter.cs (1)
724if (f >= short.MinValue && f <= short.MaxValue && (i = (int)f) == f)
System\Xml\XmlDictionaryReader.cs (1)
1075if (i < short.MinValue || i > short.MaxValue)
System.Private.Uri (1)
System\Uri.cs (1)
1266if (string.IsNullOrEmpty(name) || name.Length > short.MaxValue)
System.Private.Windows.Core.Tests (4)
System\Private\Windows\Ole\BinaryFormatUtilitiesTests.cs (2)
71new List<short> { short.MinValue, short.MaxValue }, 91new short[] { short.MinValue, short.MaxValue },
System\Value\StoringEnum.cs (1)
166MaxValue = short.MaxValue
System\Value\StoringShort.cs (1)
12{ short.MaxValue },
System.Private.Xml (3)
System\Xml\Cache\XPathNodeHelper.cs (1)
181Debug.Assert(pageNode[0].PageInfo!.PageNumber <= short.MaxValue);
System\Xml\Schema\DataTypeImplementation.cs (1)
3322private static readonly Numeric10FacetsChecker s_numeric10FacetsChecker = new Numeric10FacetsChecker(short.MinValue, short.MaxValue);
System\Xml\Schema\XmlValueConverter.cs (1)
834if (value < (int)short.MinValue || value > (int)short.MaxValue)
System.Runtime.Numerics (7)
System\Numerics\BigInteger.cs (3)
4719actualResult = IsNegative(value) ? short.MinValue : short.MaxValue; 4723actualResult = (value._sign >= short.MaxValue) ? short.MaxValue :
System\Numerics\Complex.cs (4)
1859short actualResult = (value.m_real >= short.MaxValue) ? short.MaxValue : 1995short actualResult = (value.m_real >= short.MaxValue) ? short.MaxValue :
System.Text.Json (1)
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (1)
377/// than <see cref="short.MaxValue"/>.
System.Threading (3)
System\Threading\Barrier.cs (3)
199/// or greater than <see cref="short.MaxValue"/>.</exception> 280/// exceed <see cref="short.MaxValue"/>. 312/// barrier's participant count to exceed <see cref="short.MaxValue"/>.</exception>
System.Windows.Forms (10)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
774Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 785Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
798ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(value, short.MaxValue);
System\Windows\Forms\Layout\LayoutUtils.cs (2)
50Size textSize = TextRenderer.MeasureText(obj.ToString(), font, new Size(short.MaxValue, short.MaxValue), TextFormatFlags.SingleLine);
System\Windows\Forms\Layout\TableLayout.cs (2)
693if (dontHonorConstraint && (proposedConstraints.Width < short.MaxValue)) 821if (dontHonorConstraint && (proposedConstraints.Height < short.MaxValue))
System\Windows\Forms\NativeWindow.cs (2)
434if (cp.Caption is not null && cp.Caption.Length > short.MaxValue) 436cp.Caption = cp.Caption[..short.MaxValue];
System\Windows\Forms\ToolTip\ToolTip.cs (1)
27private const int InfiniteDelay = short.MaxValue;
System.Windows.Forms.Primitives (3)
Windows\Win32\PInvoke.GetModuleFileNameLongPath.cs (3)
34if (buffer.Length >= short.MaxValue) 37Debug.Fail($"Module File Name is greater than {short.MaxValue}."); 41buffer.EnsureCapacity(Math.Min(buffer.Length * 2, short.MaxValue));
System.Windows.Forms.Primitives.Tests (14)
Interop\Oleaut32\VARIANTTests.cs (14)
182yield return new object[] { VT_I1, (nint)short.MaxValue, (sbyte)(-1) }; 213yield return new object[] { VT_I2, (nint)short.MaxValue, short.MaxValue }; 243yield return new object[] { VT_I4, (nint)short.MaxValue, (int)short.MaxValue }; 274yield return new object[] { VT_INT, (nint)short.MaxValue, (int)short.MaxValue }; 309yield return new object[] { VT_ERROR, (nint)short.MaxValue, (int)short.MaxValue }; 402yield return new object[] { (nint)short.MaxValue, (long)short.MaxValue }; 428yield return new object[] { short.MaxValue }; 691yield return new object[] { (nint)short.MaxValue, (int)short.MaxValue };
System.Windows.Forms.Tests (5)
System\Windows\Forms\AxHost.PropertyBagStreamTests.cs (1)
96short.MaxValue,
System\Windows\Forms\NativeWindowTests.cs (2)
138yield return new object[] { new string('a', short.MaxValue + 1), new string('a', short.MaxValue) };
TextBoxBaseTests.cs (2)
4479yield return new object[] { string.Empty, (IntPtr)short.MaxValue, 0 }; 4488yield return new object[] { "text", (IntPtr)short.MaxValue, 3 };