2090 references to Assert
mscorlib (1674)
system\_localdatastore.cs (2)
220Contract.Assert(capacity >= m_DataTable.Length, "LocalDataStore corrupted: capacity >= m_DataTable.Length"); 233Contract.Assert(slotIdx < m_DataTable.Length, "LocalDataStore corrupted: slotIdx < m_DataTable.Length");
system\activationcontext.cs (2)
113Contract.Assert(_definitionIdentities.Count == 2, "An application must have exactly 1 deployment component and 1 application component in Whidbey"); 182Contract.Assert(_manifests.Count == 2, "An application must have exactly 1 deployment component and 1 application component in Whidbey");
system\appdomain.cs (9)
498Contract.Assert(_domainManager == null, "_domainManager == null"); 825Contract.Assert(assembly != null, "assembly != null"); 826Contract.Assert(type != null, "type != null"); 2542Contract.Assert(false, "Need to handle new LoaderInformation value in AppDomain.GetData()"); 2902Contract.Assert( !(obj is IPermission), "IPermission should be xml deserialized" ); 2903Contract.Assert( !(obj is PermissionSet), "PermissionSet should be xml deserialized" ); 3222Contract.Assert(_FusionStore != null, 4210Contract.Assert(FusionStore.LoaderOptimization == LoaderOptimization.NotSpecified, 4703Contract.Assert(i != -1, "invalid image location");
system\AppDomainSetup.cs (17)
221Contract.Assert(activationArguments.ActivationContext != null, "Cannot set base directory without activation context"); 1339Contract.Assert('A' == ACTAG_APP_CONFIG_FILE[0] , "Assumption violated"); 1340Contract.Assert('A' == ACTAG_APP_NAME[0] , "Assumption violated"); 1341Contract.Assert('A' == ACTAG_APP_BASE_URL[0] , "Assumption violated"); 1342Contract.Assert('B' == ACTAG_BINPATH_PROBE_ONLY[0] , "Assumption violated"); 1343Contract.Assert('C' == ACTAG_APP_CACHE_BASE[0] , "Assumption violated"); 1344Contract.Assert('D' == ACTAG_DEV_PATH[0] , "Assumption violated"); 1345Contract.Assert('D' == ACTAG_APP_DYNAMIC_BASE[0] , "Assumption violated"); 1346Contract.Assert('F' == ACTAG_FORCE_CACHE_INSTALL[0] , "Assumption violated"); 1347Contract.Assert('L' == LICENSE_FILE[0] , "Assumption violated"); 1348Contract.Assert('P' == ACTAG_APP_PRIVATE_BINPATH[0] , "Assumption violated"); 1349Contract.Assert('S' == ACTAG_APP_SHADOW_COPY_DIRS[0], "Assumption violated"); 1350Contract.Assert('D' == ACTAG_DISALLOW_APPLYPUBLISHERPOLICY[0], "Assumption violated"); 1351Contract.Assert('C' == ACTAG_CODE_DOWNLOAD_DISABLED[0], "Assumption violated"); 1352Contract.Assert('D' == ACTAG_DISALLOW_APP_BINDING_REDIRECTS[0], "Assumption violated"); 1353Contract.Assert('D' == ACTAG_DISALLOW_APP_BASE_PROBING[0], "Assumption violated"); 1354Contract.Assert('A' == ACTAG_APP_CONFIG_BLOB[0], "Assumption violated");
system\array.cs (6)
615Contract.Assert( hi - low >= 0, "Length overflow!"); 2063Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 2380Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 2578Contract.Assert(array.Rank == 1 && array.GetLowerBound(0) == 0, "SZArrayEnumerator only works on single dimension arrays w/ a lower bound of zero."); 2738Contract.Assert(false, "Hey! How'd I get here?"); 2863Contract.Assert((array == null && endIndex == -1) || (array.Rank == 1 && array.GetLowerBound(0) == 0),
system\arraysegment.cs (3)
69Contract.Assert( (null == _array && 0 == _offset && 0 == _count) 88Contract.Assert( (null == _array && 0 == _offset && 0 == _count) 107Contract.Assert( (null == _array && 0 == _offset && 0 == _count)
system\attribute.cs (1)
639Contract.Assert(false, "Invalid type for ParameterInfo member in Attribute class");
system\bitconverter.cs (3)
352Contract.Assert( i >=0 && i <16, "i is out of range."); 450Contract.Assert(IsLittleEndian, "This method is implemented assuming little endian with an ambiguous spec."); 461Contract.Assert(IsLittleEndian, "This method is implemented assuming little endian with an ambiguous spec.");
system\buffer.cs (6)
73Contract.Assert(src != null, "src should not be null"); 245Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); 246Contract.Assert(dest.Length - destIndex >= len, "not enough bytes in dest"); 260Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); 261Contract.Assert(src.Length - srcIndex >= len, "not enough bytes in src"); 290Contract.Assert(len >= 0, "Negative length in memcopy!");
system\char.cs (1)
93Contract.Assert(IsLatin1(ch), "Char.GetLatin1UnicodeCategory(): ch should be <= 007f");
system\collections\bitarray.cs (3)
95Contract.Assert(bytes.Length - j >= 0, "BitArray byteLength problem"); 96Contract.Assert(bytes.Length - j < 4, "BitArray byteLength problem #2"); 469Contract.Assert(div > 0, "GetArrayLength: div arg must be greater than 0");
system\collections\concurrent\PartitionerStatic.cs (6)
723Contract.Assert(m_useSingleChunking, "Expected m_useSingleChecking to be true"); 724Contract.Assert(requestedChunkSize == 1, "Got requested chunk size of " + requestedChunkSize + " when single-chunking was on"); 725Contract.Assert(actualNumElementsGrabbed == 0, "Expected actualNumElementsGrabbed == 0, instead it is " + actualNumElementsGrabbed); 726Contract.Assert(destArray.Length == 1, "Expected destArray to be of length 1, instead its length is " + destArray.Length); 773Contract.Assert(!m_useSingleChunking, "Did not expect to be in single-chunking mode"); 1731Contract.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
system\collections\generic\arraysorthelper.cs (14)
130Contract.Assert(keys != null, "Check the arguments in the caller!"); 131Contract.Assert( index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!"); 263Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 470Contract.Assert(keys != null, "Check the arguments in the caller!"); 471Contract.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!"); 535Contract.Assert(array != null, "Check the arguments in the caller!"); 536Contract.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 664Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 906Contract.Assert(keys != null, "Check the arguments in the caller!"); // Precondition on interface method 907Contract.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!"); 1012Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 1238Contract.Assert(keys != null, "Check the arguments in the caller!"); 1239Contract.Assert( index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!"); 1369Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?");
system\collections\hashtable.cs (10)
293Contract.Assert( loadsize < hashsize, "Invalid hashtable loadsize!"); 447Contract.Assert(!isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); 771Contract.Assert(loadsize < newsize, "Our current implementaion means this is not possible."); 823Contract.Assert(key != null, "key can't be null here!"); 1041Contract.Assert(false, "hash table insert failed! Load factor too high, or our double hashing function is incorrect."); 1047Contract.Assert(hashcode >= 0, "hashcode >= 0"); // make sure collision bit (sign bit) wasn't set. 1079Contract.Assert(!isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); 1753Contract.Assert( MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 1788Contract.Assert(false, "Missing case in GetRandomizedEqualityComparer!"); 1827Contract.Assert(bufferSize % 8 == 0, "We increment our current index by 8, so our buffer size must be a multiple of 8");
system\collections\objectmodel\keyedcollection.cs (1)
229Contract.Assert(key != null, "key shouldn't be null!");
system\collections\sortedlist.cs (1)
218Contract.Assert( _size == 0, "Size is not zero");
system\console.cs (10)
381Contract.Assert((stdout && _out != null) || (!stdout && _error != null), "Didn't set Console::_out or _error appropriately!"); 464Contract.Assert(false, "Unexpected handleType value (" + handleType + ")"); 771Contract.Assert(_haveReadDefaultColors, "Setting the foreground color before we've read the default foreground color!"); 812Contract.Assert(_haveReadDefaultColors, "Setting the foreground color before we've read the default foreground color!"); 837Contract.Assert(_haveReadDefaultColors, "Setting the foreground color before we've read the default foreground color!"); 927Contract.Assert(numWritten == sourceWidth, "FillConsoleOutputCharacter wrote the wrong number of chars!"); 995Contract.Assert((int)Win32Native.Color.ColorMask == 0xff, "Make sure one byte is large enough to store a Console color value!"); 1759Contract.Assert(false, "ThreadPool.QueueUserWorkItem returned false without throwing. Unable to execute ControlC handler"); 1769Contract.Assert(false, "ThreadPool.QueueUserWorkItem did not execute the handler within 30 seconds."); 1829Contract.Assert(_cancelCallbacks == null || _cancelCallbacks.GetInvocationList().Length > 0, "Teach Console::CancelKeyPress to handle a non-null but empty list of callbacks");
system\datetimeoffset.cs (1)
798Contract.Assert(offset.Ticks >= MinOffset && offset.Ticks <= MaxOffset, "Offset not validated.");
system\defaultbinder.cs (1)
998Contract.Assert(cur1.IsStatic != cur2.IsStatic, "hierarchyDepth1 == hierarchyDepth2");
system\diagnostics\eventing\eventsource.cs (4)
4504Contract.Assert(false, "EventSource did not have a registered EventListener!"); 4544Contract.Assert(eventSource.m_id == id, "Unexpected event source ID."); 4550Contract.Assert(allListeners.ContainsKey(dispatcher.m_Listener), "EventSource has a listener not on the global list."); 4560Contract.Assert(dispatcher != null, "Listener is not on all eventSources.");
system\enum.cs (7)
129Contract.Assert(false, "Invalid Object type in Format"); 236Contract.Assert(false, "Invalid Object type in ToUInt64"); 327Contract.Assert(false, "Unknown EnumParseFailure: " + m_failure); 726Contract.Assert(false, "Invalid primitive type"); 789Contract.Assert(false, "Invalid primitive type"); 843Contract.Assert(ret == retInvalidEnumType, "Enum.InternalCompareTo return code was invalid"); 947Contract.Assert(false, "Unknown underlying type.");
system\environment.cs (10)
100Contract.Assert(false, "Environment::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?"); 110Contract.Assert(false, "Environment::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?"); 213Contract.Assert(s!=null, "Managed resource string lookup failed. Was your resource name misspelled? Did you rebuild mscorlib after adding a resource to resources.txt? Debug this w/ cordbg and bug whoever owns the code that called Environment.GetResourceString. Resource name was: \""+key+"\""); 413Contract.Assert(r < Path.MAX_PATH, "r < Path.MAX_PATH"); 436Contract.Assert(r < Path.MAX_PATH, "r < Path.MAX_PATH"); 673Contract.Assert(environmentKey != null, @"HKLM\System\CurrentControlSet\Control\Session Manager\Environment is missing!"); 686Contract.Assert(environmentKey != null, @"HKCU\Environment is missing!"); 985Contract.Assert(environmentKey != null, @"HKLM\System\CurrentControlSet\Control\Session Manager\Environment is missing!"); 1002Contract.Assert(environmentKey != null, @"HKCU\Environment is missing!"); 1148Contract.Assert(m_os != null, "m_os != null");
system\exception.cs (3)
497Contract.Assert(methBase is MethodInfo, "[Exception.GetExceptionMethodString]methBase is MethodInfo"); 519Contract.Assert(_exceptionMethodString != null, "Method string cannot be NULL!"); 601Contract.Assert(((_safeSerializationManager != null) || (this.GetType().Assembly == typeof(object).Assembly)),
system\globalization\calendar.cs (2)
233Contract.Assert(BaseCalendarID > 0, "[Calendar.CurrentEraValue] Expected ID > 0"); 533Contract.Assert(offset >= 0, "Calendar.GetFirstDayWeekOfYear(): offset >= 0");
system\globalization\calendardata.cs (1)
129Contract.Assert(false, "[CalendarData] nativeGetCalendarData call isn't expected to fail for calendar " + calendarId + " locale " +localeName);
system\globalization\CalendricalCalculationsHelper.cs (1)
220Contract.Assert(false, "Not expected to come here");
system\globalization\charunicodeinfo.cs (16)
151Contract.Assert(s != null, "s != null"); 152Contract.Assert(index >= 0 && index < s.Length, "index < s.Length"); 189Contract.Assert(s != null, "s != null"); 190Contract.Assert(s.Length > 0, "s.Length > 0"); 191Contract.Assert(index >= 0 && index < s.Length, "index >= 0 && index < s.Length"); 217Contract.Assert(s != null, "s!=null"); 218Contract.Assert(index >= 0 && index < s.Length, "index >= 0 && index < s.Length"); 255Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); 288Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); 451Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); 497Contract.Assert(value != null, "value can not be null"); 498Contract.Assert(index < value.Length, "index < value.Length"); 511Contract.Assert(str != null, "str can not be null"); 512Contract.Assert(str.Length > 0, "str.Length > 0");; 513Contract.Assert(index >= 0 && index < str.Length, "index >= 0 && index < str.Length"); 519Contract.Assert(uc >= 0, "uc >= 0");
system\globalization\compareinfo.cs (5)
299Contract.Assert(m_name != null, "CompareInfo.OnSerializing - expected m_name to be set already"); 329Contract.Assert(m_name != null, "CompareInfo.Name Expected m_name to be set"); 361Contract.Assert(options != CompareOptions.OrdinalIgnoreCase, "[CompareInfo.GetNativeCompareFlags]CompareOptions.OrdinalIgnoreCase should be handled separately"); 376Contract.Assert(((options & ~(CompareOptions.IgnoreCase | 384Contract.Assert((nativeCompareFlags & RESERVED_FIND_ASCII_STRING) == 0, "[CompareInfo.GetNativeCompareFlags] RESERVED_FIND_ASCII_STRING shouldn't be set here");
system\globalization\culturedata.cs (22)
1028Contract.Assert(arrayLength == cultureNames.Length + 2, "CultureData.nativeEnumCultureNames() Incorrect array size"); 1074Contract.Assert(name != null, "IsReplacementCultureName(): name should not be null"); 1084Contract.Assert(name != null, "IsReplacementCultureName(): replacementCultureNames should not be null"); 1109Contract.Assert(this.sRealName != null, "[CultureData.CultureName] Expected this.sRealName to be populated by COMNlsInfo::nativeInitCultureData already"); 1162Contract.Assert(this.sName != "zh-CHS" && this.sName != "zh-CHT", 1339Contract.Assert(this.sSpecificCulture != null, "[CultureData.SSPECIFICCULTURE] Expected this.sSpecificCulture to be populated by COMNlsInfo::nativeInitCultureData already"); 2311Contract.Assert(this.sWindowsName != null, "[CultureData.CalendarIds] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 2386Contract.Assert(calendarId > 0 && calendarId <= CalendarData.MAX_CALENDARS, 2409Contract.Assert(this.sWindowsName != null, "[CultureData.GetCalendar] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 2462Contract.Assert(this.sRealName != null, "[CultureData.IsRightToLeft] Expected this.sRealName to be populated by COMNlsInfo::nativeInitCultureData already"); 2673Contract.Assert(this.sRealName != null, "[CultureData.ILANGUAGE] Expected this.sRealName to be populated by COMNlsInfo::nativeInitCultureData already"); 2730Contract.Assert(calendarId > 0, "[CultureData.saEraNames] Expected Calendar.ID > 0"); 2737Contract.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 2744Contract.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 3017Contract.Assert(startIndex >= 0, "startIndex cannot be negative"); 3018Contract.Assert(timeParts.IndexOfAny(new char[] { '\'', '\\' }) == -1, "timeParts cannot include quote characters"); 3056Contract.Assert(this.sWindowsName != null, "[CultureData.DoGetLocaleInfo] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 3072Contract.Assert(localeName != null, "[CultureData.DoGetLocaleInfo] Expected localeName to be not be null"); 3093Contract.Assert(this.sWindowsName != null, "[CultureData.DoGetLocaleInfoInt] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 3102Contract.Assert(this.sWindowsName != null, "[CultureData.DoEnumTimeFormats] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 3111Contract.Assert(this.sWindowsName != null, "[CultureData.DoEnumShortTimeFormats] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 3176Contract.Assert(this.sWindowsName != null, "[CultureData.GetNFIValues] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already");
system\globalization\cultureinfo.cs (10)
454Contract.Assert(cultureID >=0, "[CultureInfo.OnDeserialized] cultureID >= 0"); 460Contract.Assert(m_name != null, "[CultureInfo.OnDeserialized] m_name != null"); 528Contract.Assert(m_createdDomainID != 0, "[CultureInfo.IsSafeCrossDomain] m_createdDomainID != 0"); 535Contract.Assert(m_createdDomainID != 0, "[CultureInfo.CreatedDomain] m_createdDomainID != 0"); 689Contract.Assert(culture!=null, "[CultureInfo.VerifyCultureName]culture!=null"); 1135Contract.Assert(m_name != null, "[CultureInfo.DisplayName]Always expect m_name to be set"); 1360Contract.Assert(m_name != null, "[CultureInfo.ToString]Always expect m_name to be set"); 1504Contract.Assert(calType!=Calendar.CAL_GREGORIAN, "calType!=Calendar.CAL_GREGORIAN"); 1556Contract.Assert(this.m_cultureData.CalendarIds.Length > 0, "this.m_cultureData.CalendarIds.Length > 0"); 2028Contract.Assert(localeType == LOCALE_USER_DEFAULT || localeType == LOCALE_SYSTEM_DEFAULT, "[CultureInfo.GetDefaultLocaleName] localeType must be LOCALE_USER_DEFAULT or LOCALE_SYSTEM_DEFAULT");
system\globalization\datetimeformat.cs (5)
175Contract.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); 181Contract.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); 227Contract.Assert(dayOfWeek >= 0 && dayOfWeek <= 6, "dayOfWeek >= 0 && dayOfWeek <= 6"); 239Contract.Assert(month >=1 && month <= 12, "month >=1 && month <= 12"); 280Contract.Assert(repeatCount != 3 || repeatCount != 4, "repeateCount should be 3 or 4");
system\globalization\datetimeformatinfo.cs (39)
253Contract.Assert(this.abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week"); 276Contract.Assert(this.m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.internalGetSuperShortDayNames] Expected 7 day names in a week"); 293Contract.Assert(this.dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week"); 310Contract.Assert(this.abbreviatedMonthNames.Length == 12 || this.abbreviatedMonthNames.Length == 13, 329Contract.Assert(this.monthNames.Length == 12 || this.monthNames.Length == 13, 367Contract.Assert(calendarID > 0, "[DateTimeFormatInfo.Populate] Expected Calendar.ID > 0"); 378Contract.Assert(this.allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns"); 381Contract.Assert(this.allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns"); 384Contract.Assert(this.allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns"); 387Contract.Assert(this.allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns"); 390Contract.Assert(this.allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns"); 586Contract.Assert(this.amDesignator != null, "DateTimeFormatInfo.AMDesignator, amDesignator != null"); 610Contract.Assert(this.calendar != null, "DateTimeFormatInfo.Calendar: calendar != null"); 846Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.AbbreviatedEnglishEraNames] Expected Calendar.ID > 0"); 866Contract.Assert(this.dateSeparator != null, "DateTimeFormatInfo.DateSeparator, dateSeparator != null"); 896Contract.Assert(this.firstDayOfWeek != -1, "DateTimeFormatInfo.FirstDayOfWeek, firstDayOfWeek != -1"); 925Contract.Assert(this.calendarWeekRule != -1, "DateTimeFormatInfo.CalendarWeekRule, calendarWeekRule != -1"); 1056Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.MonthDayPattern] Expected calID > 0"); 1059Contract.Assert(this.monthDayPattern != null, "DateTimeFormatInfo.MonthDayPattern, monthDayPattern != null"); 1090Contract.Assert(this.pmDesignator != null, "DateTimeFormatInfo.PMDesignator, pmDesignator != null"); 1311Contract.Assert(this.timeSeparator != null, "DateTimeFormatInfo.TimeSeparator, timeSeparator != null"); 1588Contract.Assert(this.m_genitiveAbbreviatedMonthNames.Length == 13, 1597Contract.Assert(this.genitiveMonthNames.Length == 13, 1613Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.internalGetLeapYearMonthNames] Expected Calendar.ID > 0"); 1615Contract.Assert(this.leapYearMonthNames.Length == 13, 1808Contract.Assert(patterns != null && patterns.Length > 0, 1810Contract.Assert(defaultPattern != null, 1907Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedYearMonthPatterns] Expected Calendar.ID > 0"); 1909Contract.Assert(this.allYearMonthPatterns.Length > 0, 1926Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedShortDatePatterns] Expected Calendar.ID > 0"); 1928Contract.Assert(this.allShortDatePatterns.Length > 0, 1944Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedLongDatePatterns] Expected Calendar.ID > 0"); 1946Contract.Assert(this.allLongDatePatterns.Length > 0, 1963Contract.Assert(this.allShortTimePatterns.Length > 0, 1980Contract.Assert(this.allLongTimePatterns.Length > 0, 2727Contract.Assert(state == HebrewNumberParsingState.ContinueParsing || state == HebrewNumberParsingState.FoundEndOfHebrewNumber, 2774Contract.Assert(str.Index < str.Value.Length, "DateTimeFormatInfo.Tokenize(): start < value.Length"); 2884Contract.Assert(true, "The hashtable is full. This should not happen."); 2977Contract.Assert(true, "The hashtable is full. This should not happen.");
system\globalization\datetimeparse.cs (19)
119Contract.Assert(dtfi != null, "dtfi == null"); 201Contract.Assert(dtfi != null, "dtfi == null"); 554Contract.Assert(hourOffset >= 0 && hourOffset <= 99, "hourOffset >= 0 && hourOffset <= 99"); 555Contract.Assert(minuteOffset >= 0 && minuteOffset <= 99, "minuteOffset >= 0 && minuteOffset <= 99"); 1949Contract.Assert(raw.numCount >= 2, "raw.numCount >= 2"); 1969Contract.Assert(raw.numCount >= 3, "raw.numCount >= 3"); 2340Contract.Assert(dtfi != null, "dtfi == null"); 2610Contract.Assert(result.parsedDate.Kind == DateTimeKind.Unspecified, "result.parsedDate.Kind == DateTimeKind.Unspecified"); 2900Contract.Assert(minDigitLen > 0, "minDigitLen > 0"); 2901Contract.Assert(maxDigitLen < 9, "maxDigitLen < 9"); 2902Contract.Assert(minDigitLen <= maxDigitLen, "minDigitLen <= maxDigitLen"); 4188Contract.Assert(false, "Unkown DateTimeParseFailure: " + result); 4417Contract.Assert(Index + count <= len, "__DTString::Advance: Index + count <= len"); 4712Contract.Assert(Index >= 0 && Index < len, "Index >= 0 && Index < len"); 4720Contract.Assert(Index >= 0 && Index < len, "Index >= 0 && Index < len"); 4721Contract.Assert(DateTimeParse.IsDigit(Value[Index]), "IsDigit(Value[Index])"); 4854Contract.Assert(number >= 0 && number <= 9, "number >= 0 && number <= 9"); 4873Contract.Assert(sub.index == Index, "sub.index == Index"); 4874Contract.Assert(sub.index + sub.length <= len, "sub.index + sub.length <= len");
system\globalization\globalizationassembly.cs (3)
41Contract.Assert(assembly != null, "assembly can not be null. This should be generally the mscorlib.dll assembly."); 42Contract.Assert(tableName != null, "table name can not be null"); 53Contract.Assert(
system\globalization\hebrewcalendar.cs (2)
609Contract.Assert(NumDays >= 1, "NumDays >= 1"); 813Contract.Assert(hebrewYearType>= 1 && hebrewYearType <= 6,
system\globalization\hebrewnumber.cs (1)
102Contract.Assert(Number > 0 && Number <= 999, "Number is out of range.");;
system\globalization\idnmapping.cs (13)
133Contract.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii]Expected 0 length strings to fail before now."); 482Contract.Assert(d >= 0 && d < punycodeBase, "[IdnMapping.encode_digit]Expected 0 <= d < punycodeBase"); 519Contract.Assert(numpoints != 0, "[IdnMapping.adapt]Expected non-zero numpoints."); 527Contract.Assert(delta + skew != 0, "[IdnMapping.adapt]Expected non-zero delta+skew."); 577Contract.Assert(iNextDot <= unicode.Length, "[IdnMapping.punycode_encode]IndexOfAny is broken"); 627Contract.Assert(Char.IsLowSurrogate(unicode, basicCount) == false, 711Contract.Assert(delta > 0, "[IdnMapping.cs]1 punycode_encode - delta overflowed int"); 725Contract.Assert(delta > 0, "[IdnMapping.cs]2 punycode_encode - delta overflowed int"); 737Contract.Assert(punycodeBase != t, "[IdnMapping.punycode_encode]Expected punycodeBase (36) to be != t"); 756Contract.Assert(delta > 0, "[IdnMapping.cs]3 punycode_encode - delta overflowed int"); 947Contract.Assert(w > 0, "[IdnMapping.punycode_decode]Expected w > 0"); 956Contract.Assert(punycodeBase != t, "[IdnMapping.punycode_decode]Expected t != punycodeBase (36)"); 968Contract.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0,
system\globalization\regioninfo.cs (2)
319Contract.Assert(m_dataItem >= 0, "[RegionInfo.OnDeserialized] null name and invalid dataItem"); 391Contract.Assert(m_name != null, "Expected RegionInfo.m_name to be populated already");
system\globalization\sortkey.cs (2)
143Contract.Assert(key1Data!=null, "key1Data!=null"); 144Contract.Assert(key2Data!=null, "key2Data!=null");
system\globalization\stringinfo.cs (2)
213Contract.Assert(index >= 0 && len >= 0, "StringInfo.GetCurrentTextElementLen() : index = " + index + ", len = " + len); 214Contract.Assert(index < len, "StringInfo.GetCurrentTextElementLen() : index = " + index + ", len = " + len);
system\globalization\textelementenumerator.cs (3)
49Contract.Assert(str != null, "TextElementEnumerator(): str != null"); 50Contract.Assert(startIndex >= 0 && strLen >= 0, "TextElementEnumerator(): startIndex >= 0 && strLen >= 0"); 51Contract.Assert(strLen >= startIndex, "TextElementEnumerator(): strLen >= startIndex");
system\globalization\textinfo.cs (11)
267Contract.Assert(strA.Length >= indexA + lengthA, "[TextInfo.CompareOrdinalIgnoreCaseEx] Caller should've validated strA.Length >= indexA + lengthA"); 268Contract.Assert(strB.Length >= indexB + lengthB, "[TextInfo.CompareOrdinalIgnoreCaseEx] Caller should've validated strB.Length >= indexB + lengthB"); 276Contract.Assert(source != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated source != null"); 277Contract.Assert(value != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated value != null"); 278Contract.Assert(startIndex + count <= source.Length, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex + count <= source.Length"); 321Contract.Assert(source != null, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated source != null"); 322Contract.Assert(value != null, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated value != null"); 323Contract.Assert(startIndex - count+1 >= 0, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex - count+1 >= 0"); 324Contract.Assert(startIndex <= source.Length, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex <= source.Length"); 803Contract.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddNonLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!"); 817Contract.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddTitlecaseLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!");
system\globalization\timespanformat.cs (13)
148Contract.Assert(dtfi != null, "dtfi == null"); 376Contract.Assert(field >= 0 && field <= 5, "field >= 0 && field <= 5"); 396Contract.Assert(false, "Unexpected special token '%', Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 406Contract.Assert((field == 0 && sb.Length == 0) || field == 1, 414Contract.Assert((field == 1 && sb.Length == 0) || field == 2, 422Contract.Assert((field == 2 && sb.Length == 0) || field == 3, 430Contract.Assert((field == 3 && sb.Length == 0) || field == 4, 439Contract.Assert((field == 4 && sb.Length == 0) || field == 5, 454Contract.Assert(0 < dd && dd < 3, "0 < dd && dd < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 455Contract.Assert(0 < hh && hh < 3, "0 < hh && hh < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 456Contract.Assert(0 < mm && mm < 3, "0 < mm && mm < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 457Contract.Assert(0 < ss && ss < 3, "0 < ss && ss < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 458Contract.Assert(0 < ff && ff < 8, "0 < ff && ff < 8, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
system\globalization\timespanparse.cs (4)
429Contract.Assert(tokenCount == (SepCount + NumCount), "tokenCount == (SepCount + NumCount)"); 499Contract.Assert(false, "Unknown TimeSpanParseFailure: " + m_failure); 1171Contract.Assert(input != null, "input != null"); 1172Contract.Assert(format != null, "format != null");
system\globalization\umalquracalendar.cs (6)
342Contract.Assert( (HijriYear >= MinCalendarYear) && (HijriYear <= MaxCalendarYear), "Hijri year is out of range."); 343Contract.Assert( HijriMonth >= 1, "Hijri month is out of range."); 344Contract.Assert( HijriDay >= 1, "Hijri day is out of range."); 432Contract.Assert((time.Ticks >= minDate.Ticks) && (time.Ticks <= maxDate.Ticks), "Gregorian date is out of range."); 633Contract.Assert( (year >= MinCalendarYear) && (year <= MaxCalendarYear), "Hijri year is out of range."); 642Contract.Assert((days == 354)||(days == 355), "Hijri year has to be 354 or 355 days.");
system\guid.cs (2)
191Contract.Assert(failure != ParseFailureKind.NativeException, "ParseFailureKind.NativeException should not be used with this overload"); 220Contract.Assert(false, "Unknown GuidParseFailure: " + m_failure);
system\io\__consolestream.cs (1)
52Contract.Assert(handle != null && !handle.IsInvalid, "__ConsoleStream expects a valid handle!");
system\io\binaryreader.cs (7)
78Contract.Assert(m_decoder!=null, "[BinaryReader.ctor]m_decoder!=null"); 178Contract.Assert(mStream != null, "m_stream as MemoryStream != null"); 360Contract.Assert(mStream != null, "m_stream as MemoryStream != null"); 376Contract.Assert(byteBuffer != null, "expected byteBuffer to be non-null"); 402Contract.Assert(charsRemaining >= 0, "We read too many characters."); 451Contract.Assert(numBytes == 1 || numBytes == 2, "BinaryReader::InternalReadOneChar assumes it's reading one or 2 bytes only."); 468Contract.Assert(charsRead < 2, "InternalReadOneChar - assuming we only got 0 or 1 char, not 2!");
system\io\binarywriter.cs (1)
196Contract.Assert(_encoding.GetMaxByteCount(1) <= 16, "_encoding.GetMaxByteCount(1) <= 16)");
system\io\bufferedstream.cs (8)
247Contract.Assert(! (_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 402Contract.Assert(_writePos == 0, "BufferedStream: Write buffer must be empty in FlushRead!"); 416Contract.Assert(_readPos <= _readLen, "_readPos <= _readLen [" + _readPos +" <= " + _readLen + "]"); 440Contract.Assert(_readPos == 0 && _readLen == 0, 442Contract.Assert(_buffer != null && _bufferSize >= _writePos, 454Contract.Assert(_readPos == 0 && _readLen == 0, 456Contract.Assert(_buffer != null && _bufferSize >= _writePos, 1318Contract.Assert(newPos == Position, "newPos (=" + newPos + ") == Position (=" + Position + ")");
system\io\directory.cs (1)
422Contract.Assert(false, "Ignore this assert and send a repro to Microsoft. This assert was tracking purposes only.");
system\io\directoryinfo.cs (1)
113Contract.Assert(Path.GetRootLength(fullPath) > 0, "fullPath must be fully qualified!");
system\io\file.cs (2)
429Contract.Assert(path != null, "File.Exists: GetFullPathInternal returned null"); 1401Contract.Assert(false, "File::FillAttributeInfo - FindClose failed!");
system\io\fileinfo.cs (1)
143Contract.Assert(Path.GetRootLength(fullPath) > 0, "fullPath must be fully qualified!");
system\io\filestream.cs (63)
163Contract.Assert(_overlapped != null, "Did Overlapped.Pack or Overlapped.UnsafePack just return a null?"); 302Contract.Assert(_isComplete == true, "FileStreamAsyncResult::Wait - AsyncFSCallback didn't set _isComplete to true!"); 357Contract.Assert(!wh.SafeWaitHandle.IsClosed, "ManualResetEvent already closed!"); 359Contract.Assert(r, "ManualResetEvent::Set failed!"); 372Contract.Assert(_handle != null, "_handle should not be null."); 373Contract.Assert(_overlapped != null, "Cancel should only be called on true asynchronous FileStreamAsyncResult, i.e. _overlapped is not null"); 919Contract.Assert(!_exposedHandle, "Are we closing handle that we exposed/not own, how?"); 1025Contract.Assert(handleType == Win32Native.FILE_TYPE_DISK || handleType == Win32Native.FILE_TYPE_PIPE || handleType == Win32Native.FILE_TYPE_CHAR, "FileStream was passed an unknown file type!"); 1227Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 1361Contract.Assert(_writePos == 0, "FileStream: Write buffer must be empty in FlushRead!"); 1363Contract.Assert(CanSeek, "FileStream will lose buffered read data now."); 1374Contract.Assert(_readPos == 0 && _readLen == 0, "FileStream: Read buffer must be empty in FlushWrite!"); 1474Contract.Assert(value >= 0, "value >= 0"); 1510Contract.Assert((_readPos==0 && _readLen==0 && _writePos >= 0) || (_writePos==0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 1555Contract.Assert(_readPos == _readLen, "Read buffer should be empty!"); 1570Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed"); 1571Contract.Assert(CanRead, "CanRead"); 1573Contract.Assert(buffer != null, "buffer != null"); 1574Contract.Assert(_writePos == 0, "_writePos == 0"); 1575Contract.Assert(offset >= 0, "offset is negative"); 1576Contract.Assert(count >= 0, "count is negative"); 1602Contract.Assert(r >= 0, "FileStream's ReadCore is likely broken."); 1616Contract.Assert((_readPos==0 && _readLen==0 && _writePos >= 0) || (_writePos==0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 1680Contract.Assert(_readLen >= 0 && _readPos <= _readLen, "_readLen should be nonnegative, and _readPos should be less than or equal _readLen"); 1681Contract.Assert(pos == Position, "Seek optimization: pos != Position! Buffer math was mangled."); 1691Contract.Assert(!_handle.IsClosed && CanSeek, "!_handle.IsClosed && CanSeek"); 1692Contract.Assert(origin>=SeekOrigin.Begin && origin<=SeekOrigin.End, "origin>=SeekOrigin.Begin && origin<=SeekOrigin.End"); 1811Contract.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 1826Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed"); 1827Contract.Assert(CanWrite, "CanWrite"); 1829Contract.Assert(buffer != null, "buffer != null"); 1830Contract.Assert(_readPos == _readLen, "_readPos == _readLen"); 1831Contract.Assert(offset >= 0, "offset is negative"); 1832Contract.Assert(count >= 0, "count is negative"); 1862Contract.Assert(r >= 0, "FileStream's WriteCore is likely broken."); 1903Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 1932Contract.Assert(_writePos == 0, "FileStream must not have buffered write data here! Pipes should be unidirectional."); 1937Contract.Assert(!_isPipe, "Should not be a pipe."); 2012Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed"); 2013Contract.Assert(CanRead, "CanRead"); 2014Contract.Assert(bytes != null, "bytes != null"); 2015Contract.Assert(_writePos == 0, "_writePos == 0"); 2016Contract.Assert(_isAsync, "BeginReadCore doesn't work on synchronous file streams!"); 2017Contract.Assert(offset >= 0, "offset is negative"); 2018Contract.Assert(numBytes >= 0, "numBytes is negative"); 2163Contract.Assert((_readPos==0 && _readLen==0 && _writePos >= 0) || (_writePos==0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 2166Contract.Assert(_bufferSize > 0, "_bufferSize > 0"); 2215Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 2232Contract.Assert(_readPos == 0 && _readLen == 0, "FileStream must not have buffered data here! Pipes should be unidirectional."); 2272Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed"); 2273Contract.Assert(CanWrite, "CanWrite"); 2274Contract.Assert(bytes != null, "bytes != null"); 2275Contract.Assert(_readPos == _readLen, "_readPos == _readLen"); 2276Contract.Assert(_isAsync, "BeginWriteCore doesn't work on synchronous file streams!"); 2277Contract.Assert(offset >= 0, "offset is negative"); 2278Contract.Assert(numBytes >= 0, "numBytes is negative"); 2422Contract.Assert(_bufferSize > 0, "_bufferSize > 0"); 2498Contract.Assert((_isAsync && overlapped != null) || (!_isAsync && overlapped == null), "Async IO parameter ----up in call to ReadFileNative."); 2555Contract.Assert((_isAsync && overlapped != null) || (!_isAsync && overlapped == null), "Async IO parameter ----up in call to WriteFileNative."); 2755Contract.Assert(asyncResult.IsCompleted, "How can we end up in the completion callback if the IAsyncResult is not completed?"); 2773Contract.Assert(cancellationToken.IsCancellationRequested, "How can the IO operation be aborted if cancellation was not requested?"); 2791Contract.Assert(asyncResult.IsCompleted, "How can we end up in the completion callback if the IAsyncResult is not completed?"); 2809Contract.Assert(cancellationToken.IsCancellationRequested, "How can the IO operation be aborted if cancellation was not requested?");
system\io\filesystemenumerable.cs (3)
265Contract.Assert(searchCriteria != null && searchData != null, "searchCriteria and searchData should be initialized"); 414Contract.Assert(searchData.searchOption != SearchOption.TopDirectoryOnly, "should not reach this code path if searchOption == TopDirectoryOnly"); 419Contract.Assert((searchData.fullPath != null), "fullpath can't be null!");
system\io\isolatedstorage\isolatedstorage.cs (2)
796Contract.Assert(m_ValidQuota == false, "Quota should be invalid here"); 966Contract.Assert(evidence != null, "evidence != null");
system\io\longpath.cs (2)
296Contract.Assert(path != null, "File.Exists: GetFullPathInternal returned null"); 925Contract.Assert(false, "Ignore this assert and file a bug to the BCL team. This assert was tracking purposes only.");
system\io\memorystream.cs (4)
274Contract.Assert(_position + n >= 0, "_position + n >= 0"); // len is less than 2^31 -1. 357Contract.Assert(_position + n >= 0, "_position + n >= 0"); // len is less than 2^31 -1. 395Contract.Assert(t == null || t.Status == TaskStatus.RanToCompletion, 513Contract.Assert(_position >= 0, "_position >= 0");
system\io\path.cs (4)
871Contract.Assert(lastSlash < newBuffer.Length, "path unexpectedly ended in a '\'"); 1079Contract.Assert(path != null, "path can't be null"); 1313Contract.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 1353Contract.Assert(((b2 & 0xF8) == 0), "Unexpected set bits");
system\io\pathhelper.cs (2)
173Contract.Assert(result < Path.MaxPath, "did we accidently remove a PathTooLongException check?"); 210Contract.Assert(result < m_maxPath, "did we accidentally remove a PathTooLongException check?");
system\io\pinnedbuffermemorystream.cs (1)
35Contract.Assert(array != null, "Array can't be null");
system\io\stream.cs (7)
344Contract.Assert(thisTask != null, "Inside ReadWriteTask, InternalCurrent should be the ReadWriteTask"); 401Contract.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here."); 490Contract.Assert(thisTask != null, "Inside ReadWriteTask, InternalCurrent should be the ReadWriteTask"); 518Contract.Assert(asyncWaiter.IsRanToCompletion, "The semaphore wait should always complete successfully."); 525Contract.Assert(t.IsRanToCompletion, "The semaphore wait should always complete successfully."); 538Contract.Assert(_activeReadWriteTask == null, "Expected no other readers or writers"); 589Contract.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here.");
system\io\streamreader.cs (19)
468Contract.Assert(byteLen >= n, "CompressBuffer was called with a number of bytes greater than the current buffer length. Are two threads using this StreamReader at the same time?"); 540Contract.Assert(bytePos <= _preamble.Length, "_compressPreamble was called with the current bytePos greater than the preamble buffer length. Are two threads using this StreamReader at the same time?"); 551Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 574Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 576Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 594Contract.Assert(bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 596Contract.Assert(byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 659Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 661Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 683Contract.Assert(bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 687Contract.Assert(byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 970Contract.Assert(BytePos_Prop <= Preamble_Prop.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 973Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1006Contract.Assert(BytePos_Prop == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1010Contract.Assert(ByteLen_Prop >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1196Contract.Assert(BytePos_Prop <= Preamble_Prop.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1199Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1217Contract.Assert(BytePos_Prop == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1219Contract.Assert(ByteLen_Prop >= 0, "Stream.Read returned a negative number! Bug in stream class.");
system\io\streamwriter.cs (5)
384Contract.Assert(n > 0, "StreamWriter::Write(char[]) isn't making progress! This is most likely a ---- in user code."); 412Contract.Assert(n > 0, "StreamWriter::Write(char[], int, int) isn't making progress! This is most likely a race condition in user code."); 436Contract.Assert(n > 0, "StreamWriter::Write(String) isn't making progress! This is most likely a race condition in user code."); 563Contract.Assert(n > 0, "StreamWriter::Write(String) isn't making progress! This is most likely a race condition in user code."); 651Contract.Assert(n > 0, "StreamWriter::Write(char[], int, int) isn't making progress! This is most likely a race condition in user code.");
system\io\unmanagedmemoryaccessor.cs (6)
1093Contract.Assert(CanRead, "UMA not readable"); 1094Contract.Assert(position >= 0, "position less than 0"); 1095Contract.Assert(position <= _capacity - sizeof(byte), "position is greater than capacity - sizeof(byte)"); 1116Contract.Assert(CanWrite, "UMA not writeable"); 1117Contract.Assert(position >= 0, "position less than 0"); 1118Contract.Assert(position <= _capacity - sizeof(byte), "position is greater than capacity - sizeof(byte)");
system\io\unmanagedmemorystream.cs (2)
419Contract.Assert(pos + nInt >= 0, "_position + n >= 0"); // len is less than 2^63 -1. 540Contract.Assert(finalPos >= 0, "_position >= 0");
system\Lazy.cs (1)
96Contract.Assert(false, "ALREADY_INVOKED_SENTINEL should never be invoked.");
system\marshalbyrefobject.cs (1)
136Contract.Assert(!RemotingServices.IsTransparentProxy(obj), "Use this method for server objects only");
system\multicastdelegate.cs (3)
147Contract.Assert((_invocationList as Object[]) != null, "empty invocation list on multicast delegate"); 179Contract.Assert(d != null && (_invocationList as Object[]) != null, "bogus delegate in multicast list comparison"); 254Contract.Assert(!IsUnmanagedFunctionPtr(), "dynamic method and unmanaged fntptr delegate combined");
system\number.cs (11)
413Contract.Assert(p != null, ""); 432Contract.Assert(*p >= 'a' && *p <= 'f', ""); 458Contract.Assert(p != null, ""); 477Contract.Assert(*p >= 'a' && *p <= 'f', ""); 507Contract.Assert(p != null, ""); 541Contract.Assert(p != null, ""); 575Contract.Assert(p != null, ""); 603Contract.Assert(p != null, ""); 631Contract.Assert(p != null && str != null, ""); 1027Contract.Assert(info != null, ""); 1209Contract.Assert(numfmt != null, "");
system\reflection\assembly.cs (2)
2810Contract.Assert( codeBase != null, "Must pass in a valid CodeBase" ); 2835Contract.Assert( false, "Unable to create WebPermission" );
system\reflection\Associates.cs (1)
68Contract.Assert(!associateMethodHandle.IsNullHandle(), "Failed to resolve associateRecord methodDef token");
system\reflection\customattribute.cs (3)
1963Contract.Assert(decoratedToken.IsModule || decoratedToken.IsAssembly, 2163Contract.Assert(pca.BaseType == (RuntimeType)typeof(Attribute), "Pseudo CA Error"); 2165Contract.Assert(usage.Inherited == false, "Pseudo CA Error");
system\reflection\emit\assemblybuilder.cs (1)
646Contract.Assert(m_assemblyData != null, "m_assemblyData is null in DefineDynamicModuleInternal");
system\reflection\emit\customattributebuilder.cs (3)
332Contract.Assert(false, "Invalid primitive type"); 416Contract.Assert(false, "Invalid enum base type"); 494Contract.Assert(false, "Invalid primitive type");
system\reflection\emit\dynamicilgenerator.cs (1)
370Contract.Assert(opcode.Equals(OpCodes.Calli),
system\reflection\emit\dynamicmethod.cs (4)
379Contract.Assert(owner == null && m == null, "owner and m cannot be set for transparent methods"); 392Contract.Assert(m != null || owner != null, "PerformSecurityCheck should ensure that either m or owner is set"); 393Contract.Assert(m == null || !m.Equals(s_anonymouslyHostedDynamicMethodsModule), "The user cannot explicitly use this assembly"); 394Contract.Assert(m == null || owner == null, "m and owner cannot both be set");
system\reflection\emit\ilgenerator.cs (13)
666Contract.Assert(opcode.Equals(OpCodes.Calli), 700Contract.Assert(opcode.Equals(OpCodes.Call) || 708Contract.Assert(opcode.Equals(OpCodes.Call) || 1481Contract.Assert(m_catchEndAddr[m_currentCatch-1] == -1,"m_catchEndAddr[m_currentCatch-1] == -1"); 1498Contract.Assert(m_catchEndAddr[m_currentCatch-1] == -1,"m_catchEndAddr[m_currentCatch-1] == -1"); 1540Contract.Assert(m_currentCatch > 0,"m_currentCatch > 0"); 1541Contract.Assert(m_catchAddr[m_currentCatch-1] > 0,"m_catchAddr[m_currentCatch-1] > 0"); 1542Contract.Assert(m_catchEndAddr[m_currentCatch-1] == -1,"m_catchEndAddr[m_currentCatch-1] == -1"); 1605Contract.Assert(m_currentCatch > 0,"m_currentCatch > 0"); 1606Contract.Assert(exc.m_currentCatch > 0,"exc.m_currentCatch > 0"); 1615Contract.Assert(exc.GetEndAddress() != GetEndAddress(), 1830Contract.Assert(i < m_DocumentCount, "Bad document look up!"); 1921Contract.Assert(document == m_document, "Bad document look up!");
system\reflection\emit\methodbuilder.cs (4)
372Contract.Assert(false, "We should never get here!"); 772Contract.Assert(currentMethod == this, "We should have found this method in m_containingType.m_listMethods"); 773Contract.Assert(currentToken.Token != 0, "The token should not be 0"); 781Contract.Assert(m_tkMethod.Token == 0, "m_tkMethod should not have been initialized");
system\reflection\emit\modulebuilder.cs (2)
496Contract.Assert(!type.IsByRef, "Must not be ByRef."); 497Contract.Assert(!type.IsGenericType || type.IsGenericTypeDefinition, "Must not have generic arguments.");
system\reflection\emit\modulebuilderdata.cs (1)
69Contract.Assert(m_strModuleName == AssemblyBuilder.MANIFEST_MODULE_NAME, "Changing names for non-manifest module");
system\reflection\emit\typebuilder.cs (1)
458Contract.Assert(destType is RuntimeType, "destType is not a runtime type, an EnumBuilder, or a TypeBuilder.");
system\reflection\methodbody.cs (1)
165public virtual Type LocalType { get { Contract.Assert(m_type != null, "type must be set!"); return m_type; } }
system\resources\__fastresourcecomparer.cs (5)
86Contract.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 87Contract.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 123Contract.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 124Contract.Assert(a != null && b != null, "Null args not allowed."); 125Contract.Assert(byteLen >= 0, "byteLen must be non-negative.");
system\resources\filebasedresourcegroveler.cs (5)
36Contract.Assert(mediator != null, "mediator shouldn't be null; check caller"); 46Contract.Assert(culture != null, "culture shouldn't be null; check caller"); 114Contract.Assert(culture != null, "culture shouldn't be null; check caller"); 115Contract.Assert(fileName != null, "fileName shouldn't be null; check caller"); 157Contract.Assert(file != null, "file shouldn't be null; check caller");
system\resources\manifestbasedresourcegroveler.cs (11)
64Contract.Assert(culture != null, "culture shouldn't be null; check caller"); 65Contract.Assert(localResourceSets != null, "localResourceSets shouldn't be null; check caller"); 236Contract.Assert(a != null, "assembly != null"); 269Contract.Assert(false, "mscorlib's NeutralResourcesLanguageAttribute is a malformed culture name! name: \"" + cultureName + "\" Exception: " + e); 286Contract.Assert(store != null, "I need a Stream!"); 366Contract.Assert(resSetTypeName != null, "We should have a ResourceSet type name from the custom resource file here."); 570Contract.Assert(false, "[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + " with error code 0x" + hr.ToString("X", CultureInfo.InvariantCulture) + Environment.NewLine + "Exception: " + fle); 577Contract.Assert(false, "[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + Environment.NewLine + "Exception: " + bife); 605Contract.Assert(readerTypeName != null, "readerTypeName shouldn't be null; check caller"); 606Contract.Assert(resSetTypeName != null, "resSetTypeName shouldn't be null; check caller"); 675Contract.Assert(false, "Couldn't get mscorlib" + ResourceManager.ResFileExtension + " from mscorlib's assembly" + Environment.NewLine + Environment.NewLine + "Are you building the runtime on your machine? Chances are the BCL directory didn't build correctly. Type 'build -c' in the BCL directory. If you get build errors, look at buildd.log. If you then can't figure out what's wrong (and you aren't changing the assembly-related metadata code), ask a BCL dev.\n\nIf you did NOT build the runtime, you shouldn't be seeing this and you've found a bug.");
system\resources\resourcemanager.cs (4)
749Contract.Assert(culture != null, "culture != null"); 893Contract.Assert(attrs.Length == 1, "Cannot have multiple instances of SatelliteContractVersionAttribute on an assembly!"); 906Contract.Assert(false, "mscorlib's SatelliteContractVersionAttribute is a malformed version string!"); 935Contract.Assert(asmTypeName1 != null, "asmTypeName1 was unexpectedly null");
system\resources\resourcereader.cs (21)
71Contract.Assert(value >= 0, "negative ResourceTypeCode. What?"); 274Contract.Assert(index >=0 && index < _numResources, "Bad index into hash array. index: "+index); 275Contract.Assert((_ums == null && _nameHashes != null && _nameHashesPtr == null) || 286Contract.Assert(index >=0 && index < _numResources, "Bad index into name position array. index: "+index); 287Contract.Assert((_ums == null && _namePositions != null && _namePositionsPtr == null) || 323Contract.Assert(_store != null, "ResourceReader is closed!"); 405Contract.Assert(_store != null, "ResourceReader is closed!"); 443Contract.Assert(_store != null, "ResourceReader is closed!"); 507Contract.Assert(_store != null, "ResourceReader is closed!"); 532Contract.Assert(_store != null, "ResourceReader is closed!"); 585Contract.Assert(_store != null, "ResourceReader is closed!"); 586Contract.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 661Contract.Assert(_store != null, "ResourceReader is closed!"); 662Contract.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 759Contract.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 859Contract.Assert(_store != null, "ResourceReader is closed!"); 1110Contract.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1222Contract.Assert(index >= 0 && index < _numResources, "Couldn't find data position within sorted data positions array!"); 1225Contract.Assert(len >= 0 && len <= (int) _store.BaseStream.Length - dataPos + _dataSectionOffset, "Length was negative or outside the bounds of the file!"); 1249Contract.Assert(!String.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1254Contract.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
system\resources\resourcewriter.cs (4)
466Contract.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 483Contract.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 512Contract.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!"); 719Contract.Assert(typeCode >= ResourceTypeCode.StartOfUserTypes, String.Format(CultureInfo.InvariantCulture, "ResourceReader: Unsupported ResourceTypeCode in .resources file! {0}", typeCode));
system\resources\runtimeresourceset.cs (2)
319Contract.Assert(dataPos >= 0, "data section offset cannot be negative!"); 380Contract.Assert(ignoreCase, "This should only happen for case-insensitive lookups");
system\rttype.cs (4)
5405Contract.Assert(!ace.m_hCtorMethodHandle.IsNullHandle(), "Expected the default ctor method handle for a reference type."); 5722Contract.Assert(false, "[RuntimeType.WrapArgsForInvokeCall]Invalid safe array wrapper type specified."); 5779Contract.Assert(false, "[RuntimeType.WrapArgsForInvokeCall]Invalid wrapper type specified."); 6017Contract.Assert(!hit.Equals(key), "Key was already in CerHashtable! Potential ---- (or bug) in the Reflection cache?");
system\runtime\compilerservices\AsyncMethodBuilder.cs (16)
117Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action."); 127Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference"); 163Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action."); 173Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference"); 234Contract.Assert(m_synchronizationContext != null, "Must only be used with a non-null context."); 504Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action."); 515Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference"); 544Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action."); 555Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference"); 594Contract.Assert(m_task != null, "GetTaskForResult should never return null"); 818Contract.Assert(EXCLUSIVE_INT32_MAX >= INCLUSIVE_INT32_MIN, "Expected max to be at least min"); 904Contract.Assert(m_defaultContextAction == null || m_stateMachine != null, 927Contract.Assert(m_stateMachine != null, "If the delegate was set, the state machine should have been as well."); 995Contract.Assert(runner.m_stateMachine == null, "The runner's state machine should not yet have been populated."); 996Contract.Assert(m_stateMachine != null, "The builder's state machine field should have been initialized."); 1059Contract.Assert(m_stateMachine != null, "The state machine must have been set before calling Run.");
system\runtime\compilerservices\decimalconstantattribute.cs (1)
61Contract.Assert(false, "Decimal cannot be represented directly in the metadata.");
system\runtime\compilerservices\TaskAwaiter.cs (4)
149Contract.Assert(taskCompleted, "With an infinite timeout, the task should have always completed."); 177Contract.Assert(false, "Throw() should have thrown"); 188Contract.Assert(false, "Throw() should have thrown"); 193Contract.Assert(false, "There should be exceptions if we're Faulted.");
system\runtime\interopservices\marshal.cs (2)
2362Contract.Assert(caConstructorArgs.Count == 1, "caConstructorArgs.Count == 1"); 2365Contract.Assert(progIdConstructorArg.ArgumentType == typeof(String), "progIdConstructorArg.ArgumentType == typeof(String)");
system\runtime\interopservices\registrationservices.cs (1)
303Contract.Assert(baseComImportType != null, "baseComImportType != null");
system\runtime\interopservices\safebuffer.cs (1)
390Contract.Assert(false, "Uninitialized SafeBuffer! Someone needs to call Initialize before using this instance!");
system\runtime\interopservices\tceadaptergen\eventproviderwriter.cs (33)
100Contract.Assert(DelegateField != null, "Unable to find the field m_" + SrcItfMethod.Name + "Delegate on the sink helper"); 104Contract.Assert(CookieField != null, "Unable to find the field m_dwCookie on the sink helper"); 108Contract.Assert(SinkHelperCons != null, "Unable to find the constructor for the sink helper"); 112Contract.Assert(CPAdviseMethod != null, "Unable to find the method ConnectionPoint.Advise"); 118Contract.Assert(ArrayListAddMethod != null, "Unable to find the method ArrayList.Add"); 122Contract.Assert(MonitorEnterMethod != null, "Unable to find the method Monitor.Enter()"); 127Contract.Assert(MonitorExitMethod != null, "Unable to find the method Monitor.Exit()"); 243Contract.Assert(DelegateField != null, "Unable to find the field m_" + SrcItfMethod.Name + "Delegate on the sink helper"); 247Contract.Assert(CookieField != null, "Unable to find the field m_dwCookie on the sink helper"); 253Contract.Assert(ArrayListRemoveMethod != null, "Unable to find the method ArrayList.RemoveAt()"); 257Contract.Assert(ArrayListItemProperty != null, "Unable to find the property ArrayList.Item"); 259Contract.Assert(ArrayListItemGetMethod != null, "Unable to find the get method for property ArrayList.Item"); 263Contract.Assert(ArrayListSizeProperty != null, "Unable to find the property ArrayList.Count"); 265Contract.Assert(ArrayListSizeGetMethod != null, "Unable to find the get method for property ArrayList.Count"); 270Contract.Assert(DelegateEqualsMethod != null, "Unable to find the method Delegate.Equlals()"); 274Contract.Assert(MonitorEnterMethod != null, "Unable to find the method Monitor.Enter()"); 279Contract.Assert(MonitorExitMethod != null, "Unable to find the method Monitor.Exit()"); 283Contract.Assert(CPUnadviseMethod != null, "Unable to find the method ConnectionPoint.Unadvise()"); 287Contract.Assert(ReleaseComObjectMethod != null, "Unable to find the method Marshal.ReleaseComObject()"); 467Contract.Assert(DefaultArrayListCons != null, "Unable to find the constructor for class ArrayList"); 476Contract.Assert(ByteArrayGUIDCons != null, "Unable to find the constructor for GUID that accepts a string as argument"); 480Contract.Assert(CPCFindCPMethod != null, "Unable to find the method ConnectionPointContainer.FindConnectionPoint()"); 557Contract.Assert(DefaultBaseClsCons != null, "Unable to find the object's public default constructor"); 588Contract.Assert(CookieField != null, "Unable to find the field m_dwCookie on the sink helper"); 592Contract.Assert(ArrayListItemProperty != null, "Unable to find the property ArrayList.Item"); 594Contract.Assert(ArrayListItemGetMethod != null, "Unable to find the get method for property ArrayList.Item"); 598Contract.Assert(ArrayListSizeProperty != null, "Unable to find the property ArrayList.Count"); 600Contract.Assert(ArrayListSizeGetMethod != null, "Unable to find the get method for property ArrayList.Count"); 604Contract.Assert(CPUnadviseMethod != null, "Unable to find the method ConnectionPoint.Unadvise()"); 608Contract.Assert(ReleaseComObjectMethod != null, "Unable to find the method Marshal.ReleaseComObject()"); 612Contract.Assert(MonitorEnterMethod != null, "Unable to find the method Monitor.Enter()"); 618Contract.Assert(MonitorExitMethod != null, "Unable to find the method Monitor.Exit()"); 747Contract.Assert(SuppressFinalizeMethod != null, "Unable to find the GC.SuppressFinalize");
system\runtime\interopservices\tceadaptergen\eventsinkhelperwriter.cs (4)
69Contract.Assert(aParams.Length == 1, "All event interface methods must take a single delegate derived type and have a void return type"); 123Contract.Assert(DelegateInvokeMethod != null, "Unable to find method Delegate.Invoke()"); 233Contract.Assert(false, "Unexpected type for Primitive type."); 258Contract.Assert(DefaultBaseClsCons != null, "Unable to find the constructor for class " + m_InputType.Name);
system\runtime\interopservices\typelibconverter.cs (1)
311Contract.Assert((asmFileName != null) && (asmFileName.Length > 0), "The assembly file name cannot be an empty string!");
system\runtime\interopservices\windowsruntime\bindablevectortocollectionadapter.cs (1)
33Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\bindablevectortolistadapter.cs (1)
33Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\clrireferenceimpl.cs (3)
88Contract.Assert(reference != null, "CLRIReferenceImpl::UnboxHelper - QI'ed for IReference<"+typeof(T)+">, but that failed."); 277Contract.Assert(reference != null, "CLRIReferenceArrayImpl::UnboxHelper - QI'ed for IReferenceArray<" + typeof(T) + ">, but that failed."); 363Contract.Assert(false, "We should not see non-WinRT type here");
system\runtime\interopservices\windowsruntime\dictionarytomapadapter.cs (1)
34Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\enumeratortoiteratoradapter.cs (2)
32Contract.Assert(false, "This class is never instantiated"); 48Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\IClosable.cs (2)
31Contract.Assert(false, "This class is never instantiated"); 48Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\imapviewtoireadonlydictionaryadapter.cs (1)
34Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\ireadonlydictionarytoimapviewadapter.cs (1)
34Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\ireadonlylisttoivectorviewadapter.cs (1)
34Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\iteratortoenumeratoradapter.cs (2)
34Contract.Assert(false, "This class is never instantiated"); 76Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\ivectorviewtoireadonlylistadapter.cs (1)
36Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\listtobindablevectoradapter.cs (1)
34Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\listtovectoradapter.cs (1)
34Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\maptocollectionadapter.cs (1)
35Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\maptodictionaryadapter.cs (1)
32Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\mapviewtoreadonlycollectionadapter.cs (1)
35Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\vectortocollectionadapter.cs (1)
32Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\vectortolistadapter.cs (1)
32Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\vectorviewtoreadonlycollectionadapter.cs (1)
32Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\windowsruntimemarshal.cs (9)
549Contract.Assert(target == null || Marshal.IsComObject(target), "Must be null or a RCW"); 728Contract.Assert((key != null && tokens != null) || (key == null && tokens == null), 915Contract.Assert(owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken"); 923Contract.Assert(owners == -1, "Calling ReleaseWriterLock when no write lock is held"); 935Contract.Assert(myLock != 0, "Lock must be held"); 936Contract.Assert(waitEvent == null, "Wait event must be null"); 955Contract.Assert(myLock != 0, "Lock must be held"); 983Contract.Assert(myLock != 0, "Lock must be held"); 1019Contract.Assert(myLock != 0, "Exiting spin lock that is not held");
system\runtime\memoryfailpoint.cs (1)
295Contract.Assert(false, "Fell through switch statement!");
system\runtime\remoting\activationservices.cs (28)
160Contract.Assert(!serverType.IsInterface,"!serverType.IsInterface"); 172Contract.Assert(null != pa, "null != pa"); 197Contract.Assert(null != retObj, "null != retObj"); 205Contract.Assert(!serverType.IsInterface,"!serverType.IsInterface"); 218Contract.Assert(null != pa, "null != pa"); 229Contract.Assert(null != retObj, "null != retObj"); 398Contract.Assert( 425Contract.Assert(pa!=null, "expect proxy attribute"); 539Contract.Assert( 544Contract.Assert(ctorMsg.ActivationType.IsContextful, 558Contract.Assert( 564Contract.Assert( 617Contract.Assert( 759Contract.Assert(reqMsg!=null, "NULL ctorReqMsg"); 771Contract.Assert(replyMsg!=null, "NULL ctorRetMsg"); 840Contract.Assert( 1103Contract.Assert(_attributeStack != null, "Pop w/o a prior Set()?"); 1214Contract.Assert(ctorMsg!=null, "ctorMsg null?"); 1224Contract.Assert( 1249Contract.Assert( 1393Contract.Assert(ctorMsg != null, "Null ctorMsg"); 1522Contract.Assert(remActivatorURL!=null,"Bad activator URL"); 1681Contract.Assert(cp != null && cp.Count > 0,"Bad _cp?"); 1740Contract.Assert(typ!=null, "typ != null"); 1741Contract.Assert(attr!=null, "attr != null"); 1748Contract.Assert(newAttr.Length == newTypes.Length,"These should be in sync!"); 1761Contract.Assert(typ!=null, "typ != null"); 1774Contract.Assert(typ!=null, "typ != null");
system\runtime\remoting\channelservices.cs (6)
252Contract.Assert((oldList != null) && (oldList.Length != 0), "channel list should not be empty"); 459Contract.Assert(null != idObj,"null != idObj"); 1311Contract.Assert(nextSink != null, 1320Contract.Assert(RemotingServices.CORProfilerTrackRemoting(), 1322Contract.Assert(RemotingServices.CORProfilerTrackRemotingAsync(), 1343Contract.Assert(false, "ServerAsyncReplyTerminatorSink.AsyncProcessMessage called!");
system\runtime\remoting\configuration.cs (7)
1498Contract.Assert(null != URI, "null != URI"); 1517Contract.Assert(null != URI, "null != URI"); 1602Contract.Assert(null != srvID, "null != srvID"); 1620Contract.Assert(null != srvID, "null != srvID"); 1642Contract.Assert(null != srvID, "null != srvID"); 1685Contract.Assert(null != srvID, "null != srvID"); 1771Contract.Assert(_channel != null, "channel shouldn't be null");
system\runtime\remoting\context.cs (5)
300Contract.Assert( 526Contract.Assert( (msg is IConstructionCallMessage) 529Contract.Assert( !((msg is IConstructionCallMessage) && 533Contract.Assert((_ctxFlags & CTX_FROZEN) == CTX_FROZEN, 669Contract.Assert(targetCtxID != IntPtr.Zero, "Bad transition context");
system\runtime\remoting\contextproperty.cs (1)
210Contract.Assert(ctorMsg.ActivationType.IsMarshalByRef, "Activation on a non MarshalByRef object");
system\runtime\remoting\identityholder.cs (16)
112Contract.Assert( 232Contract.Assert( 288Contract.Assert(null != serverCtx, "null != serverCtx"); 296Contract.Assert(srvID == MarshalByRefObject.GetIdentity(obj), "Bad ID state!" ); 302Contract.Assert(null != rp, "null != rp"); 389Contract.Assert(null != srvID,"null != srvID"); 404Contract.Assert(null != objURI,"null != objURI"); 473Contract.Assert(null != idObj,"null != idObj"); 491Contract.Assert(null != idObj,"null != idObj"); 494Contract.Assert( 506Contract.Assert(bServerIDSet,"idObj should be ServerIdentity"); 525Contract.Assert(null != idObj.URI,"null != idObj.URI"); 553Contract.Assert( 569Contract.Assert( 603Contract.Assert(false, "Invalid DuplicateIdentityOption"); 721Contract.Assert(uri!=null, "Null URI");
system\runtime\remoting\message.cs (15)
496Contract.Assert(mb != null, "null method base passed to CoerceArgs"); 1345Contract.Assert(_message == null, "Can't set frame twice on ConstructorCallMessage"); 2222Contract.Assert(_enumHash != null,"_enumHash != null"); 2249Contract.Assert(_enumHash != null,"_enumHash != null"); 3239Contract.Assert( 3973Contract.Assert(value==null, "Phoney type in CCM"); 4855Contract.Assert(_obj != null, "SerializationMonkey's _obj field should have been initialized elsewhere with a special hack."); 4962Contract.Assert(targetCtxID!=IntPtr.Zero, "bad target ctx for call back"); 4985Contract.Assert(targetCtxID != IntPtr.Zero, "bad target ctx for call back"); 4986Contract.Assert(targetDomainID !=0, "bad target ctx for call back"); 5015Contract.Assert(channelSink != null, "X-domain transition failure"); 5035Contract.Assert(_targetDomainID != 0, "target domain should be non-zero"); 5068Contract.Assert(Thread.CurrentContext.InternalContextID 5087Contract.Assert(ctx != null, "Null target context unexpected!"); 5153Contract.Assert(
system\runtime\remoting\realproxy.cs (8)
124Contract.Assert((IntPtr)0 != _defaultStub, "Default stub not set up"); 610Contract.Assert( 755Contract.Assert(rp!=null, "RemotingProxy expected here!"); 787Contract.Assert(false, "Unknown call type"); 802Contract.Assert(null != retMsg, "null != retMsg"); 806Contract.Assert(null != reqMsg, "null != reqMsg"); 918Contract.Assert(msgFlags != -1, "Unexpected msgFlags?"); 984Contract.Assert(null != serverID.ServerContext, "null != serverID.ServerContext");
system\runtime\remoting\remotingconfiguration.cs (1)
607Contract.Assert(appURI != null, "Bad remote app URI");
system\runtime\remoting\remotingservices.cs (19)
424Contract.Assert(!(obj is ContextBoundObject), "ContextBoundObject's shouldn't get here."); 432Contract.Assert(null != serverCtx, "null != serverCtx"); 438Contract.Assert(idObj == MarshalByRefObject.GetIdentity(obj), "Bad ID state!" ); 452Contract.Assert(obj is ContextBoundObject, "Object should have been a ContextBoundObject."); 529Contract.Assert(null != idObj.ObjURI,"null != idObj.ObjURI"); 534Contract.Assert(null != idObj,"null != idObj"); 545Contract.Assert(null != realProxy,"null != realProxy"); 688Contract.Assert(null != realProxy,"null != realProxy"); 707Contract.Assert(null != idObj, "null != idObj"); 719Contract.Assert(srvID != null && Obj is ContextBoundObject, 749Contract.Assert(srvID == idObj, "Bad ID Table state!"); 756Contract.Assert(idObj.ObjURI != null, "Client side id without URI!"); 774Contract.Assert(null != idObj.ObjURI,"null != idObj.ObjURI"); 1066Contract.Assert(obj.GetType().IsContextful,"objType.IsContextful"); 2218Contract.Assert(IsTransparentProxy(tp),"Must be called only for TPs"); 2298Contract.Assert( 2348Contract.Assert(IsTransparentProxy(tp), "IsTransparentProxy(tp)"); 2354Contract.Assert(!(id is ServerIdentity), "(!id is ServerIdentity)"); 2780Contract.Assert(condition, message);
system\runtime\remoting\remotingsurrogateselector.cs (1)
380Contract.Assert(
system\runtime\remoting\synchronizeddispatch.cs (23)
88Contract.Assert( 97Contract.Assert( 101Contract.Assert( 197Contract.Assert(ctx.GetProperty(PROPERTY_NAME) != this, 231Contract.Assert(_flavor == REQUIRED,"Use cli-ctx property only for the REQUIRED flavor"); 284Contract.Assert(_locked==true,"_locked==true"); 292Contract.Assert(work!=null,"work!=null"); 293Contract.Assert(work.IsSignaled() && !(work.IsDummy()),"work.IsSignaled() && !(work.IsDummy())"); 308Contract.Assert(_locked==true,"_locked==true"); 335Contract.Assert(_locked==true,"_locked==true"); 452Contract.Assert(_locked==true,"_locked==true"); 482Contract.Assert(_locked==true,"_locked==true"); 498Contract.Assert(_locked==true,"_locked==true"); 720Contract.Assert(!IsWaiting(),"!IsWaiting()"); 732Contract.Assert(!IsSignaled(),"!IsSignaled()"); 795Contract.Assert(IsSignaled(),"IsSignaled()"); 836Contract.Assert(_property.Locked == true,"_property.Locked == true"); 853Contract.Assert(_property.Locked == true,"_property.Locked == true"); 878Contract.Assert( 890Contract.Assert(lcid.Equals(_property.SyncCallOutLCID), "Bad synchronization domain state!"); 910Contract.Assert( 930Contract.Assert(_property.Locked == true,"_property.Locked == true"); 953Contract.Assert(
system\runtime\serialization\formatters\binary\binarycommonclasses.cs (4)
86Contract.Assert(objectInfo!=null, "[BinaryConverter.GetBinaryTypeInfo]objectInfo null for user object"); 154Contract.Assert(typeInformation!=null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null"); 163Contract.Assert(typeInformation!=null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null"); 167Contract.Assert(typeInformation!=null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null");
system\runtime\serialization\formatters\binary\binaryconverter.cs (1)
480Contract.Assert((code != InternalPrimitiveTypeE.Invalid), "[Converter.FromString]!InternalPrimitiveTypeE.Invalid ");
system\runtime\serialization\formatters\binary\binaryobjectreader.cs (2)
169Contract.Assert(!bFullDeserialization, "we just set bFullDeserialization to false"); 357Contract.Assert((index < crossAppDomainArray.Length),
system\runtime\serialization\formatters\binary\binaryparser.cs (1)
1022Contract.Assert((pr.PRnewObj != null),"[BinaryParser expected a Primitive Array]");
system\runtime\serialization\formatters\sertrace.cs (1)
101Contract.Assert(condition, message);
system\runtime\serialization\formatterservices.cs (2)
89Contract.Assert((object)type != null, "[GetAllSerializableMembers]type!=null"); 405Contract.Assert(mi is RuntimeFieldInfo || mi is SerializationFieldInfo,
system\runtime\serialization\objectmanager.cs (38)
126Contract.Assert(objectID>0,"objectID>0"); 170Contract.Assert(holder!=null,"holder!=null"); 172Contract.Assert(holder.m_id>=0,"holder.m_id>=0"); 254Contract.Assert(holder.RequiresSerInfoFixup,"[ObjectManager.FixupSpecialObject]holder.HasSurrogate||holder.HasISerializable"); 257Contract.Assert(surrogate!=null,"surrogate!=null"); 269Contract.Assert(holder.ObjectValue is ISerializable,"holder.m_object is ISerializable"); 296Contract.Assert(holder.IsIncompleteObjectReference,"holder.IsIncompleteObjectReference"); 362Contract.Assert(holder!=null, "[TypedReferenceBuilder.ctor]holder!=null"); 363Contract.Assert(holder.RequiresValueTypeFixup, "[TypedReferenceBuilder.ctor]holder.RequiresValueTypeFixup"); 404Contract.Assert(currFixup.ParentIndex!=null, "[ObjectManager.DoValueTypeFixup]currFixup.ParentIndex!=null"); 419Contract.Assert(fixupObj!=null, "[ObjectManager.DoValueTypeFixup]FixupObj!=null"); 445Contract.Assert(fixupObj!=null, "[ObjectManager.DoValueTypeFixup]fixupObj!=null"); 500Contract.Assert(holder!=null,"[ObjectManager.CompleteObject]holder.m_object!=null"); 524Contract.Assert(fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup,"fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup"); 578Contract.Assert(holder.ObjectValue is Array,"holder.ObjectValue is Array"); 586Contract.Assert(fixupInfo is MemberInfo,"fixupInfo is MemberInfo"); 672Contract.Assert(temp.DirectlyDependentObjects>0,"temp.m_missingElementsRemaining>0"); 731Contract.Assert(member == null || member is FieldInfo, "RegisterString - member is FieldInfo"); 732Contract.Assert((FindObjectHolder(objectID) == null), "RegisterString - FindObjectHolder(objectID) == null"); 948Contract.Assert(m_fixupCount>=0,"[ObjectManager.DoFixups]m_fixupCount>=0"); 1173Contract.Assert(objID>=0,"objID>=0"); 1207Contract.Assert(objID>=0,"objID>=0"); 1253Contract.Assert(m_dependentObjects!=null, "[ObjectHolder.RemoveDependency]m_dependentObjects!=null"); 1254Contract.Assert(id>=0, "[ObjectHolder.RemoveDependency]id>=0"); 1296Contract.Assert(holder!=null, "[ObjectHolder.UpdateTotalDependencyChain]holder!=null"); 1334Contract.Assert(obj!=null,"obj!=null"); 1335Contract.Assert(m_id>0,"m_id>0"); 1576Contract.Assert(id>0,"id>0"); 1577Contract.Assert(fixupInfo!=null,"fixupInfo!=null"); 1578Contract.Assert(fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup,"fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup"); 1685Contract.Assert(m_currentItem!=-1, "[LongList.Current]m_currentItem!=-1"); 1686Contract.Assert(m_values[m_currentItem]!=-1, "[LongList.Current]m_values[m_currentItem]!=-1"); 1731Contract.Assert(startingSize>0 && startingSize<0x1000,"startingSize>0 && startingSize<0x1000"); 1784Contract.Assert(list!=null, "[ObjectHolderListEnumerator.ctor]list!=null"); 1792Contract.Assert(m_startingVersion==m_list.Version, "[ObjectHolderListEnumerator.MoveNext]m_startingVersion==m_list.Version"); 1811Contract.Assert(m_currPos!=-1, "[ObjectHolderListEnumerator.Current]m_currPos!=-1"); 1812Contract.Assert(m_currPos<m_list.Count, "[ObjectHolderListEnumerator.Current]m_currPos<m_list.Count"); 1813Contract.Assert(m_startingVersion==m_list.Version, "[ObjectHolderListEnumerator.Current]m_startingVersion==m_list.Version");
system\runtime\serialization\serializationeventscache.cs (3)
96Contract.Assert(obj != null, "object should have been initialized"); 115Contract.Assert(obj != null, "object should have been initialized"); 134Contract.Assert(obj != null, "object should have been initialized");
system\runtime\serialization\serializationfieldinfo.cs (2)
43Contract.Assert(field!=null, "[SerializationFieldInfo.ctor]field!=null"); 44Contract.Assert(namePrefix!=null, "[SerializationFieldInfo.ctor]namePrefix!=null");
system\runtime\serialization\serializationinfo.cs (14)
255Contract.Assert(m_members.Length == m_currMember, "[SerializationInfo.ExpandArrays]m_members.Length == m_currMember"); 432Contract.Assert(null != name, "[SerializationInfo.UpdateValue]name!=null"); 433Contract.Assert(null != value, "[SerializationInfo.UpdateValue]value!=null"); 434Contract.Assert(null != (object)type, "[SerializationInfo.UpdateValue]type!=null"); 483Contract.Assert(index < m_data.Length, "[SerializationInfo.GetElement]index<m_data.Length"); 484Contract.Assert(index < m_types.Length, "[SerializationInfo.GetElement]index<m_types.Length"); 487Contract.Assert((object)foundType != null, "[SerializationInfo.GetElement]foundType!=null"); 502Contract.Assert(index < m_data.Length, "[SerializationInfo.GetElement]index<m_data.Length"); 503Contract.Assert(index < m_types.Length, "[SerializationInfo.GetElement]index<m_types.Length"); 506Contract.Assert((object)foundType != null, "[SerializationInfo.GetElement]foundType!=null"); 547Contract.Assert(m_converter != null, "[SerializationInfo.GetValue]m_converter!=null"); 560Contract.Assert((object)type != null, "[SerializationInfo.GetValue]type ==null"); 561Contract.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type"); 580Contract.Assert(m_converter != null, "[SerializationInfo.GetValue]m_converter!=null");
system\runtime\serialization\serializationinfoenumerator.cs (7)
71Contract.Assert(members!=null, "[SerializationInfoEnumerator.ctor]members!=null"); 72Contract.Assert(info!=null, "[SerializationInfoEnumerator.ctor]info!=null"); 73Contract.Assert(types!=null, "[SerializationInfoEnumerator.ctor]types!=null"); 74Contract.Assert(numItems>=0, "[SerializationInfoEnumerator.ctor]numItems>=0"); 75Contract.Assert(members.Length>=numItems, "[SerializationInfoEnumerator.ctor]members.Length>=numItems"); 76Contract.Assert(info.Length>=numItems, "[SerializationInfoEnumerator.ctor]info.Length>=numItems"); 77Contract.Assert(types.Length>=numItems, "[SerializationInfoEnumerator.ctor]types.Length>=numItems");
system\runtime\serialization\surrogateselector.cs (1)
52Contract.Assert(selector!=null, "[HasCycle]selector!=null");
system\runtime\versioning\binarycompatibility.cs (5)
256Contract.Assert(false, "Bad framework kind"); 259Contract.Assert(false, "Error: we introduced a new Target Framework but did not update our binary compatibility map"); 334Contract.Assert(false, "This is a phone app, but we can't tell what version this is!"); 340Contract.Assert(false, String.Format(CultureInfo.InvariantCulture, "Unrecognized Silverlight profile \"{0}\". What is this, an XBox app?", profile)); 347Contract.Assert(false, String.Format(CultureInfo.InvariantCulture, "Unrecognized Target Framework Moniker in our Binary Compatibility class. Framework name: \"{0}\"", targetFrameworkMoniker));
system\runtime\versioning\resourceattributes.cs (1)
235Contract.Assert(requires == SxSRequirements.None, "Computed a strange set of required resource scoping. It's probably wrong.");
system\security\accesscontrol\ace.cs (5)
143Contract.Assert( false, "Length > ushort.MaxValue" ); 891Contract.Assert( false, "OpaqueLength somehow managed to exceed MaxOpaqueLength" ); 1205Contract.Assert( false, "Invalid ACE type" ); 1644Contract.Assert( false, "OpaqueLength somehow managed to exceed MaxOpaqueLength" ); 2210Contract.Assert( false, "OpaqueLength somehow managed to exceed MaxOpaqueLength" );
system\security\accesscontrol\acl.cs (7)
380Contract.Assert( false, "aceLength % 4 != 0" ); 519Contract.Assert( false, "aceLength % 4 != 0" ); 555Contract.Assert( false, "aceLength % 4 != 0" ); 1365Contract.Assert(( ace.AccessMask & newAce.AccessMask) == newAce.AccessMask, "AceFlagsAreMergeable:: AccessMask of existing ace does not contain all access bits of new ace."); 1742Contract.Assert( false, "Audit and alarm ACEs must have been stripped by remove-meaningless logic" ); 1794Contract.Assert( ace != null, "How did a null ACE end up in a SACL?" ); 1826Contract.Assert( false, "Allow and deny ACEs must have been stripped by remove-meaningless logic" );
system\security\accesscontrol\commonobjectsecurity.cs (3)
267Contract.Assert( false, "Invalid operation" ); 308Contract.Assert( false, "Invalid operation" ); 326Contract.Assert( false, "rule.AccessControlType unrecognized" );
system\security\accesscontrol\directoryobjectsecurity.cs (4)
316Contract.Assert(false, "Invalid operation"); 357Contract.Assert(false, "Invalid operation"); 375Contract.Assert(false, "rule.AccessControlType unrecognized"); 447Contract.Assert(false, "Invalid operation");
system\security\accesscontrol\nativeobjectsecurity.cs (2)
166Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32GetSecurityInfo() failed with unexpected error code {0}", error )); 311Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Unexpected error code {0}", error ));
system\security\accesscontrol\objectsecurity.cs (1)
100Contract.Assert( newOne != null, "Must not supply a null parameter here" );
system\security\accesscontrol\privilege.cs (6)
139Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "LookupPrivilegeValue() failed with unrecognized error code {0}", error )); 250Contract.Assert( this.isImpersonating == false, "Incorrect isImpersonating state" ); 314Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "WindowsIdentity.GetCurrentThreadToken() failed with unrecognized error code {0}", error )); 424Contract.Assert( !this.needToRevert, "Must revert privileges that you alter!" ); 579Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "AdjustTokenPrivileges() failed with unrecognized error code {0}", error )); 669Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "AdjustTokenPrivileges() failed with unrecognized error code {0}", error ));
system\security\accesscontrol\securitydescriptor.cs (3)
245Contract.Assert( false, "binaryForm produced invalid output" ); 250Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.ConvertSdToSddl returned {0}", error )); 678Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Unexpected error out of Win32.ConvertStringSdToSd: {0}", error ));
system\security\accesscontrol\win32.cs (1)
338Contract.Assert( false, "Internal error: both name and handle are null" );
system\security\codeaccesspermission.cs (7)
92Contract.Assert(new StackFrame().GetMethod().Name.Equals("Demand"), "This method needs to be named Demand"); 120Contract.Assert(new StackFrame().GetMethod().Name.Equals("Assert"), "This method needs to be named Assert"); 173Contract.Assert( perm.GetType().FullName.Equals( permname ), "Incorrect class name passed in! Was: " + permname + " Should be " + perm.GetType().FullName); 263Contract.Assert( grant == null || grant.GetType().Equals( this.GetType() ), "CheckDemand not defined for permissions of different type" ); 269Contract.Assert( permitted == null || permitted.GetType().Equals( this.GetType() ), "CheckPermitOnly not defined for permissions of different type" ); 275Contract.Assert( denied == null || denied.GetType().Equals( this.GetType() ), "CheckDeny not defined for permissions of different type" ); 282Contract.Assert( asserted == null || asserted.GetType().Equals( this.GetType() ), "CheckPermitOnly not defined for permissions of different type" );
system\security\codeaccesssecurityengine.cs (9)
130Contract.Assert((assemblyOrString == null || assemblyOrString is RuntimeAssembly || assemblyOrString is String), "Must pass in an Assembly object or String object here"); 192Contract.Assert(demands != null, "Should not reach here with a null demand set"); 306Contract.Assert(demand != null, "Should not reach here with a null demand"); 347Contract.Assert(demand != null,"demand != null"); 429Contract.Assert(grantSet != null, "Missing grant set"); 499Contract.Assert(securityContext != null, "securityContext != null"); 555Contract.Assert( asm != null, "Must pass in a good assembly" ); 556Contract.Assert( demand != null, "Must pass in a good demand" ); 619Contract.Assert(AssertPermissionToken != null && AssertPermission != null, "Assert Permission not setup correctly");
system\security\cryptography\capinative.cs (20)
277Contract.Assert(keyContainer == null, "Key containers are not supported"); 305Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 306Contract.Assert(((AlgorithmClass)algorithm & AlgorithmClass.Hash) == AlgorithmClass.Hash, "Invalid hash algorithm"); 321Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 322Contract.Assert(buffer != null && buffer.Length > 0, "buffer != null && buffer.Length > 0"); 335Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 336Contract.Assert(buffer != null && buffer.Length > 0, "buffer != null && buffer.Length > 0"); 337Contract.Assert(offset >= 0 && count > 0, "offset >= 0 && count > 0"); 338Contract.Assert(buffer.Length >= offset + count, "buffer.Length >= offset + count"); 355Contract.Assert(rawProperty.Length == sizeof(int) || rawProperty.Length == 0, "Unexpected property size"); 364Contract.Assert(hashHandle != null && !hashHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid"); 392Contract.Assert(rawProperty.Length == sizeof(int) || rawProperty.Length == 0, "Unexpected property size"); 401Contract.Assert(keyHandle != null && !keyHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid"); 430Contract.Assert(hashHandle != null && !hashHandle.IsInvalid, "hashHandle != null && !hashHandle.IsInvalid"); 448Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 449Contract.Assert(keyHandle != null && !keyHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid"); 450Contract.Assert(((AlgorithmClass)signatureAlgorithm & AlgorithmClass.Signature) == AlgorithmClass.Signature, "Invalid signature algorithm"); 451Contract.Assert(((AlgorithmClass)hashAlgorithm & AlgorithmClass.Hash) == AlgorithmClass.Hash, "Invalid hash algorithm"); 452Contract.Assert(hashValue != null, "hashValue != null"); 453Contract.Assert(signature != null, "signature != null");
system\security\cryptography\cryptoapitransform.cs (1)
307Contract.Assert((CspProviderFlags.UseMachineKeyStore |
system\security\cryptography\cryptoconfig.cs (4)
834Contract.Assert(nameMappingNode != null, "No name mappings"); 835Contract.Assert(String.Compare(nameMappingNode.Name, "cryptoNameMapping", StringComparison.Ordinal) == 0, "Invalid name mapping root"); 884Contract.Assert(oidMappingNode != null, "No OID mappings"); 885Contract.Assert(String.Compare(oidMappingNode.Name, "oidMap", StringComparison.Ordinal) == 0, "Invalid OID mapping root");
system\security\cryptography\rfc2898derivebytes.cs (1)
175Contract.Assert(m_startIndex == 0 && m_endIndex == 0, "Invalid start or end index in the internal buffer." );
system\security\cryptography\rijndaelmanagedtransform.cs (3)
477Contract.Assert(m_blockSizeBytes <= m_Nb * sizeof(int), "m_blockSizeBytes <= m_Nb * sizeof(int)"); 482Contract.Assert(m_blockSizeBytes <= m_Nb * sizeof(int), "m_blockSizeBytes <= m_Nb * sizeof(int)"); 562Contract.Assert(m_blockSizeBytes <= m_lastBlockBuffer.Length * sizeof(int), "m_blockSizeBytes <= m_lastBlockBuffer.Length * sizeof(int)");
system\security\cryptography\utils.cs (3)
527Contract.Assert(Environment.OSVersion.Version.Major < 6, "CryptGetFIPSAlgorithmMode should be used on Vista+"); 663Contract.Assert(i < 8, "Got too big an int here!"); 689Contract.Assert(i < 4, "Got too big an int here!");
system\security\framesecuritydescriptor.cs (1)
303Contract.Assert(demand != null && !demand.CheckDemand(null), "Empty demands should have been filtered out by this point");
system\security\namedpermissionset.cs (1)
139Contract.Assert( this.GetType().FullName.Equals( "System.Security.NamedPermissionSet" ), "Class name changed!" );
system\security\permissionlistset.cs (4)
66Contract.Assert(m_permSetTriples == null, "m_permSetTriples != null"); 429Contract.Assert(m_permSetTriples == null && m_firstPermSetTriple != null, "More than one PermissionSetTriple encountered in AD PermissionListSet"); 445Contract.Assert(m_permSetTriples == null && m_firstPermSetTriple != null, "More than one PermissionSetTriple encountered in AD PermissionListSet"); 511Contract.Assert(flags != 0, "Invalid permission flag demand");
system\security\permissions\fileiopermission.cs (4)
1263Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" ); 1283Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" ); 1360Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" ); 1448Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" );
system\security\permissions\keycontainerpermission.cs (1)
606Contract.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly");
system\security\permissions\principalpermission.cs (1)
526Contract.Assert( this.GetType().FullName.Equals( "System.Security.Permissions.PrincipalPermission" ), "Class name changed!" );
system\security\permissionset.cs (39)
380Contract.Assert( PermissionToken.IsTokenProperlyAssigned( perm, PermissionToken.GetToken( perm ) ), 382Contract.Assert( PermissionToken.GetToken( perm ).m_index == index, 699Contract.Assert( demandedPerm != null, "Expected non-null value" ); 707Contract.Assert( tokenDemandedPerm != null, "Unable to find token for demanded permission" ); 722Contract.Assert(demandedSet != null, "Expected non-null value"); 746Contract.Assert( child is SecurityElement, "SecurityElement expected" ); 748Contract.Assert( elChild.InternalChildren != null, 754Contract.Assert( !current.GetTag().Equals( parent.Tag ), 823Contract.Assert( thisElem is SecurityElement, "SecurityElement expected" ); 868Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 877Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1029Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1039Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1055Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1065Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1087Contract.Assert( intersectPerm == null || PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1160Contract.Assert( thisElem is SecurityElement, "SecurityElement expected" ); 1301Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1311Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1330Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1351Contract.Assert( unionPerm == null || PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1795Contract.Assert( objectToInsert.GetType().Module.Assembly == System.Reflection.Assembly.GetExecutingAssembly(), 1798Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should always know the permission type when getting a token from an instance" ); 1817Contract.Assert( PermissionToken.IsTokenProperlyAssigned( ip, token ), 1902Contract.Assert( objectToInsert.GetType().Module.Assembly == System.Reflection.Assembly.GetExecutingAssembly(), 1905Contract.Assert((token != null), "PermissionToken.GetToken returned null "); 1906Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should always know the permission type when getting a token from an instance" ); 1925Contract.Assert( PermissionToken.IsTokenProperlyAssigned( ip, token ), 2040Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should know the permission type already" ); 2050Contract.Assert( tempPerm != null, "We should only come here if we have a real permission" ); 2071Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should know the permission type already" ); 2096Contract.Assert( false, "Unrecognized case found during permission creation" ); 2118Contract.Assert(perm == null || PermissionToken.IsTokenProperlyAssigned( perm, PermissionToken.GetToken( perm ) ), "PermissionToken was improperly assigned"); 2141Contract.Assert( false, "No Permission or IPermission tag found" ); 2221Contract.Assert( this.GetType().FullName.Equals( "System.Security.PermissionSet" ), "Class name changed! Was: System.Security.PermissionSet Should be:" + this.GetType().FullName); 2431Contract.Assert(i == 0 || ((SecurityAttribute)attrs[i]).m_action == ((SecurityAttribute)attrs[i - 1]).m_action, "Mixed SecurityActions"); 2460Contract.Assert(serialize || nonCasPset == null, "We shouldn't separate nonCAS permissions unless fSerialize is true"); 2521Contract.Assert((assertSet == null || !assertSet.IsUnrestricted()), "Cannot be unrestricted here"); 2577Contract.Assert(!assertSet.IsUnrestricted(), "Cannot call this function if assertSet is unrestricted");
system\security\permissionsettriple.cs (3)
97Contract.Assert((!in_a.IsUnrestricted() || RefusedSet == null), "Cannot be unrestricted or refused must be null"); 247Contract.Assert(AssertSet == null, "AssertSet not null"); 255Contract.Assert(AssertSet == null, "AssertSet not null");
system\security\permissiontoken.cs (11)
108Contract.Assert( c_mscorlibName == ((RuntimeAssembly)Assembly.GetExecutingAssembly()).GetSimpleName(), 163Contract.Assert( method != null, "IBuiltInPermission types should have a static method called 'GetTokenIndex'" ); 169Contract.Assert(getTokenIndex != null, "method is not a RuntimeMethodInfo"); 251Contract.Assert( method != null, "IBuiltInPermission types should have a static method called 'GetTokenIndex'" ); 257Contract.Assert(getTokenIndex != null, "method is not a RuntimeMethodInfo"); 293Contract.Assert( (m_type & PermissionTokenType.DontKnow) == 0, "Should have valid token type when ToXml is called" ); 309Contract.Assert( false, "Tried to deserialize non-PermissionToken element here" ); 320Contract.Assert((this.m_type & PermissionTokenType.DontKnow) == 0, "Should have valid token type when FromXml is called."); 403Contract.Assert( cls != null, "Must pass in valid type" ); 459Contract.Assert( !(perm is IBuiltInPermission), "This should not be called for built-ins" ); 467Contract.Assert( cls.GetInterface( "System.Security.Permissions.IBuiltInPermission" ) == null, "This shoudl not be called for built-ins" );
system\security\policy\allmembershipcondition.cs (1)
68Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.AllMembershipCondition" ), "Class name changed!" );
system\security\policy\appdomainevidencefactory.cs (1)
25Contract.Assert(target == AppDomain.CurrentDomain, "AppDomainEvidenceFactory should not be used across domains.");
system\security\policy\applicationdirectory.cs (1)
82Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.ApplicationDirectory" ), "Class name changed!" );
system\security\policy\assemblyevidencefactory.cs (1)
222Contract.Assert(peFileEvidence.Target is PEFileEvidenceFactory, "Expected upgrade path is from PEFile to Assembly");
system\security\policy\codegroup.cs (3)
45Contract.Assert( membershipCondition != null, "membershipCondition != null" ); 46Contract.Assert( permSet != null, "permSet != null" ); 336Contract.Assert( this.GetType().FullName.Equals( policyClassName ), "Incorrect class name passed in! Was: " + policyClassName + " Should be " + this.GetType().FullName);
system\security\policy\evidence.cs (1)
629Contract.Assert((m_target != null && m_target is PEFileEvidenceFactory && value != null && value is AssemblyEvidenceFactory) ||
system\security\policy\evidencebase.cs (5)
92Contract.Assert(legacyEvidence.GetType() != typeof(EvidenceBase), "Attempt to wrap an EvidenceBase in a LegacyEvidenceWrapper"); 93Contract.Assert(legacyEvidence.GetType().IsSerializable, "legacyEvidence.GetType().IsSerializable"); 158Contract.Assert(m_legacyEvidenceList.Count > 0, "No items in LegacyEvidenceList, cannot tell what type they are"); 168Contract.Assert(m_legacyEvidenceList.Count == 0 || EvidenceType == evidence.GetType() || (evidence is LegacyEvidenceWrapper && (evidence as LegacyEvidenceWrapper).EvidenceType == EvidenceType), 170Contract.Assert(evidence.GetType() != typeof(LegacyEvidenceList),
system\security\policy\evidencetypedescriptor.cs (2)
92Contract.Assert(value, "Attempt to clear the Generated flag"); 106Contract.Assert(value, "Attempt to clear HostCanGenerate flag");
system\security\policy\hash.cs (2)
309Contract.Assert(hashType != null && typeof(HashAlgorithm).IsAssignableFrom(hashType), "Expected a hash algorithm"); 333Contract.Assert(hashType != null && typeof(HashAlgorithm).IsAssignableFrom(hashType), "Expected a hash algorithm");
system\security\policy\hashmembershipcondition.cs (1)
173Contract.Assert(this.GetType().FullName.Equals("System.Security.Policy.HashMembershipCondition"), "Class name changed!");
system\security\policy\permissionrequestevidence.cs (1)
94Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.PermissionRequestEvidence" ), "Class name changed!" );
system\security\policy\policylevel.cs (2)
1339Contract.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 1376Contract.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly");
system\security\policy\publisher.cs (1)
117Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.Publisher" ), "Class name changed!" );
system\security\policy\publishermembershipcondition.cs (1)
169Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.PublisherMembershipCondition" ), "Class name changed!" );
system\security\policy\site.cs (1)
106Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.Site" ), "Class name changed!" );
system\security\policy\sitemembershipcondition.cs (1)
152Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.SiteMembershipCondition" ), "Class name changed!" );
system\security\policy\strongnamemembershipcondition.cs (1)
222Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.StrongNameMembershipCondition" ), "Class name changed!" );
system\security\policy\url.cs (1)
99Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.Url" ), "Class name changed!" );
system\security\policy\urlmembershipcondition.cs (1)
156Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.UrlMembershipCondition" ), "Class name changed!" );
system\security\policy\zone.cs (1)
130Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.Zone" ), "Class name changed!" );
system\security\policy\zonemembershipcondition.cs (1)
167Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.ZoneMembershipCondition" ), "Class name changed!" );
system\security\policymanager.cs (2)
278Contract.Assert(level != null, "No policy level to encode."); 459Contract.Assert(0 <= (int)zone && (int)zone < FullTrustMap.Length, "FullTrustMap does not contain a mapping for this zone.");
system\security\principal\ircollection.cs (3)
218Contract.Assert( false, "Source type is an IdentityReference type which has not been included in translation logic."); 281Contract.Assert( false, "Source type is an IdentityReference type which has not been included in translation logic."); 378Contract.Assert( false, "Source type is an IdentityReference type which has not been included in translation logic.");
system\security\principal\ntaccount.cs (2)
292Contract.Assert(false, "NTAccount::TranslateToSids - source account name is too long."); 348Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32Native.LsaLookupNames(2) returned unrecognized error {0}", win32ErrorCode ));
system\security\principal\sid.cs (5)
424Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.CreateSidFromString returned unrecognized error {0}", Error )); 526Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.GetWindowsAccountDomainSid returned unrecognized error {0}", ErrorCode) ); 549Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.CreateWellKnownSid returned unrecognized error {0}", Error )); 757Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.GetWindowsAccountDomainSid returned unrecognized error {0}", Error) ); 998Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32Native.LsaLookupSids returned {0}", win32ErrorCode));
system\security\principal\win32.cs (4)
60Contract.Assert( r, "OSVersion native call failed." ); 87Contract.Assert( r, "OSVersion native call failed"); 322Contract.Assert(referencedDomains != null, "referencedDomains != null"); 347Contract.Assert(bufferSize > 0, "bufferSize > 0");
system\security\principal\windowsidentity.cs (4)
886Contract.Assert(!m_safeTokenHandle.IsInvalid && !m_safeTokenHandle.IsClosed, "!m_safeTokenHandle.IsInvalid && !m_safeTokenHandle.IsClosed"); 889Contract.Assert(information.ByteLength >= (ulong)Marshal.SizeOf(typeof(T)), 910Contract.Assert(hr == 0, "[WindowsIdentity..QueryImpersonation] - hr == 0"); 1072Contract.Assert(Marshal.SizeOf(typeof(Win32Native.KERB_S4U_LOGON)) % IntPtr.Size == 0, "Potential allignment issue setting up S4U logon buffer");
system\security\securestring.cs (7)
316Contract.Assert(m_buffer != null, "Buffer is not initialized!"); 378Contract.Assert(size >= 0, "size must be non-negative"); 450Contract.Assert(!m_buffer.IsInvalid && m_buffer.Length != 0, "Invalid buffer!"); 451Contract.Assert(m_buffer.Length % BlockSize == 0, "buffer length must be multiple of blocksize!"); 651Contract.Assert(!m_buffer.IsInvalid && m_buffer.Length != 0, "Invalid buffer!"); 652Contract.Assert(m_buffer.Length % BlockSize == 0, "buffer length must be multiple of blocksize!"); 735Contract.Assert(Win32Native.SysStringLen((IntPtr)targetPtr) >= Win32Native.SysStringLen((IntPtr)sourcePtr), "Target buffer is not large enough!");
system\security\securitycontext.cs (2)
117Contract.Assert(currEC == Thread.CurrentThread.GetMutableExecutionContext(), "SecurityContextSwitcher used from another thread"); 118Contract.Assert(currSC == currEC.SecurityContext, "SecurityContextSwitcher context mismatch");
system\security\securitydocument.cs (1)
154Contract.Assert(bFoundEnd, "Malformed string in parse data");
system\security\securityelement.cs (9)
176Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 301Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 405Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 500Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 511Contract.Assert( false, "Unable to find escape sequence for this character" ); 562Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 684Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 788Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 845Contract.Assert((token.m_type & PermissionTokenType.DontKnow) == 0, "Token type not properly assigned");
system\security\securityruntime.cs (4)
140Contract.Assert(secObj != null,"Failure in SecurityRuntime.Assert() - secObj != null"); 161Contract.Assert(secObj != null, "Failure in SecurityRuntime.AssertAllPossible() - secObj != null"); 190Contract.Assert(secObj != null, "Failure in SecurityRuntime.Deny() - secObj != null"); 211Contract.Assert(secObj != null, "Failure in SecurityRuntime.PermitOnly() - secObj != null");
system\security\util\stringexpressionset.cs (1)
197Contract.Assert( m_throwOnRelative, "This should only be called when throw on relative is set" );
system\security\util\tokenbasedset.cs (1)
427Contract.Assert( (thisObj == null || otherObj == null), "Permission cannot be in both TokenBasedSets" );
system\security\util\tokenizer.cs (5)
211Contract.Assert( _inSavedCharacter == -1, "There was a lookahead character at the stream change point, that means the parser is changing encodings too late" ); 269Contract.Assert(false, "attempting to change encoding on a non-changable source, should have been prevented earlier" ); 277Contract.Assert(false, "A new input source type has been added to the Tokenizer but it doesn't support encoding changes"); 283Contract.Assert( reader._in.CurrentEncoding != null, "Tokenizer's StreamReader does not have an encoding" ); 290Contract.Assert(stream != null, "The XML stream with new encoding was not properly initialized for kind of input we had");
system\security\util\xmlutil.cs (2)
73Contract.Assert( type.FullName.Equals( typename ), "Incorrect class name passed! Was : " + typename + " Shoule be: " + type.FullName); 496Contract.Assert( groupClass.Module.Assembly != Assembly.GetExecutingAssembly(),
system\sharedstatics.cs (2)
66Contract.Assert(_sharedStatics._Remoting_Identity_IDGuid != null, 145Contract.Assert(Volatile.Read(ref _sharedStatics._memFailPointReservedMemory) >= 0, "Process-wide MemoryFailPoint reserved memory was negative!");
system\string.cs (20)
262Contract.Assert(*(pointerToJointString + charBuffer.Length) == '\0', "String must be null-terminated!"); 286Contract.Assert((charA | charB) <= 0x7F, "strings have to be ASCII"); 339Contract.Assert(c <= 0x7F, "string has to be ASCII"); 347Contract.Assert(outBuff[length]=='\0', "outBuff[length]=='\0'"); 436Contract.Assert((charA | charB) <= 0x7F, "strings have to be ASCII"); 515Contract.Assert( *(a+1) != *(b+1), "This byte must be different if we reach here!"); 538Contract.Assert( *(a+1) != *(b+1), "This byte must be different if we reach here!"); 844Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); 845Contract.Assert( ((int)src)%4 == 0, "Managed string should start at 4 bytes boundary"); 901Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); 902Contract.Assert( ((int)src)%4 == 0, "Managed string should start at 4 bytes boundary"); 1231Contract.Assert(separators != null && separators.Length > 0, "separators != null && separators.Length > 0"); 1303Contract.Assert( startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!"); 1304Contract.Assert( length >= 0 && startIndex <= this.Length - length, "length is out of range!"); 1410Contract.Assert(stringLength >= 0, "stringLength >= 0"); 1421Contract.Assert(stringLength == doubleCheck, 1441Contract.Assert(cbNativeBuffer >= (Length + 1) * Marshal.SystemMaxDBCSCharSize, "Insufficient buffer length passed to ConvertToAnsi"); 1708Contract.Assert(this == null, "this == null"); // this is the string constructor, we allocate it 1736Contract.Assert(this == null, "this == null"); // this is the string constructor, we allocate it 3297Contract.Assert((currPos <= totalLength - values[i].Length),
system\stubhelpers.cs (4)
486Contract.Assert(false, "NYI"); 492Contract.Assert(false, "NYI"); 498Contract.Assert(false, "NYI"); 1527Contract.Assert(e != null || hr == 0 || hr == 1, "Unexpected HRESULT - it is a success HRESULT (without the high bit set) other than S_OK & S_FALSE.");
system\text\asciiencoding.cs (30)
407Contract.Assert(charCount >= 0, "[ASCIIEncoding.GetByteCount]count is negative"); 408Contract.Assert(chars != null, "[ASCIIEncoding.GetByteCount]chars is null"); 411Contract.Assert(encoderFallback != null, "[ASCIIEncoding.GetByteCount]Attempting to use null fallback encoder"); 425Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 444Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 481Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ASCIIEncoding.GetByteCount]leftover character should be high surrogate"); 482Contract.Assert(encoder != null, "[ASCIIEncoding.GetByteCount]Expected encoder"); 532Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 543Contract.Assert(bytes != null, "[ASCIIEncoding.GetBytes]bytes is null"); 544Contract.Assert(byteCount >= 0, "[ASCIIEncoding.GetBytes]byteCount is negative"); 545Contract.Assert(chars != null, "[ASCIIEncoding.GetBytes]chars is null"); 546Contract.Assert(charCount >= 0, "[ASCIIEncoding.GetBytes]charCount is negative"); 549Contract.Assert(encoderFallback != null, "[ASCIIEncoding.GetBytes]Attempting to use null encoder fallback"); 581Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 585Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 664Contract.Assert(encoder != null, 718Contract.Assert(chars > charStart || bytes == byteStart, 747Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0 || 759Contract.Assert(bytes != null, "[ASCIIEncoding.GetCharCount]bytes is null"); 760Contract.Assert(count >= 0, "[ASCIIEncoding.GetCharCount]byteCount is negative"); 770Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 821Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 833Contract.Assert(bytes != null, "[ASCIIEncoding.GetChars]bytes is null"); 834Contract.Assert(byteCount >= 0, "[ASCIIEncoding.GetChars]byteCount is negative"); 835Contract.Assert(chars != null, "[ASCIIEncoding.GetChars]chars is null"); 836Contract.Assert(charCount >= 0, "[ASCIIEncoding.GetChars]charCount is negative"); 853Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 921Contract.Assert(bytes > byteStart || chars == charStart, 934Contract.Assert(bytes > byteStart || chars == charStart, 951Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
system\text\basecodepageencoding.cs (5)
189Contract.Assert(info!=null, "[BaseCodePageEncoding.GetObjectData] Expected null info to throw"); 256Contract.Assert(pCodePage->ByteCount == 1 || pCodePage->ByteCount == 2, 279Contract.Assert(pMemorySection != null, 320Contract.Assert(arrayUnicodeBestFit != null, 333Contract.Assert(arrayBytesBestFit != null,
system\text\codepageencoding.cs (2)
102Contract.Assert(false, "Didn't expect to make it to CodePageEncoding ISerializable.GetObjectData"); 138Contract.Assert(false, "Didn't expect to make it to CodePageEncoding.Decoder.GetObjectData");
system\text\dbcscodepageencoding.cs (38)
65Contract.Assert(false, "Didn't expect to make it to DBCSCodePageEncoding serialization constructor"); 101Contract.Assert(pCodePage->CodePage == this.dataTableCodePage, 124Contract.Assert(bytesUnknown == 0x3f, 138Contract.Assert(((*mapCodePageCached == this.dataTableCodePage && this.bFlagDataTable) || 192Contract.Assert(bytePosition < 0x100, "[DBCSCodePageEncoding.LoadManagedCodePage]expected lead byte to be < 0x100"); 411Contract.Assert((arrayTemp.Length / 2) < 20, 542Contract.Assert(count >= 0, "[DBCSCodePageEncoding.GetByteCount]count is negative"); 543Contract.Assert(chars != null, "[DBCSCodePageEncoding.GetByteCount]chars is null"); 546Contract.Assert(encoderFallback != null, "[DBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 572Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[DBCSCodePageEncoding.GetByteCount]leftover character should be high surrogate"); 573Contract.Assert(encoder != null, 634Contract.Assert(bytes != null, "[DBCSCodePageEncoding.GetBytes]bytes is null"); 635Contract.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetBytes]byteCount is negative"); 636Contract.Assert(chars != null, "[DBCSCodePageEncoding.GetBytes]chars is null"); 637Contract.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetBytes]charCount is negative"); 640Contract.Assert(encoderFallback != null, "[DBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 658Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 673Contract.Assert(encoder != null, 706Contract.Assert(encoder == null, 728Contract.Assert(chars > charStart, 747Contract.Assert(chars > charStart, 787Contract.Assert(bytes != null, "[DBCSCodePageEncoding.GetCharCount]bytes is null"); 788Contract.Assert(count >= 0, "[DBCSCodePageEncoding.GetCharCount]byteCount is negative"); 804Contract.Assert(decoder == null || 822Contract.Assert(fallbackBuffer == null, 846Contract.Assert(fallbackBuffer == null, 921Contract.Assert(decoder == null || !decoder.m_throwOnOverflow || 934Contract.Assert(bytes != null, "[DBCSCodePageEncoding.GetChars]bytes is null"); 935Contract.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetChars]byteCount is negative"); 936Contract.Assert(chars != null, "[DBCSCodePageEncoding.GetChars]chars is null"); 937Contract.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetChars]charCount is negative"); 955Contract.Assert(decoder == null || !decoder.m_throwOnOverflow || 974Contract.Assert(fallbackBuffer == null, 999Contract.Assert(fallbackBuffer == null, 1077Contract.Assert(bytes >= byteStart + byteBuffer.Length, 1091Contract.Assert(bytes > byteStart, 1096Contract.Assert(bytes > byteStart, 1122Contract.Assert(decoder == null || !decoder.m_throwOnOverflow ||
system\text\decoder.cs (1)
223Contract.Assert(result <= charCount, "Returned more chars than we have space for");
system\text\decoderbestfitfallback.cs (3)
106Contract.Assert(iCount < 1, "[DecoderReplacementFallbackBuffer.Fallback] Calling fallback without a previously empty buffer"); 217Contract.Assert(index + 1 < oFallback.arrayBestFit.Length, 238Contract.Assert(index + 1 < oFallback.arrayBestFit.Length,
system\text\decoderfallback.cs (2)
157Contract.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 218Contract.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize");
system\text\decoderreplacementfallback.cs (1)
162Contract.Assert(fallbackIndex < strDefault.Length && fallbackIndex >= 0,
system\text\encoder.cs (1)
216Contract.Assert(result <= byteCount, "Returned more bytes than we have space for");
system\text\encoderbestfitfallback.cs (4)
108Contract.Assert(iCount < 1, "[InternalEncoderBestFitFallbackBuffer.Fallback(non surrogate)] Fallback char " + ((int)cBestFit).ToString("X4", CultureInfo.InvariantCulture) + " caused recursive fallback"); 135Contract.Assert(iCount < 1, "[InternalEncoderBestFitFallbackBuffer.Fallback(surrogate)] Fallback char " + ((int)cBestFit).ToString("X4", CultureInfo.InvariantCulture) + " caused recursive fallback"); 217Contract.Assert(index + 1 < oFallback.arrayBestFit.Length, 238Contract.Assert(index + 1 < oFallback.arrayBestFit.Length,
system\text\encoderfallback.cs (1)
171Contract.Assert(charStart != null,
system\text\encoderreplacementfallback.cs (1)
195Contract.Assert(fallbackIndex < strDefault.Length && fallbackIndex >= 0,
system\text\encoding.cs (7)
579Contract.Assert(codepage != 0 && codepage != 1200 && codepage != 1201 && codepage != 65001, 1140Contract.Assert(result <= byteCount, "[Encoding.GetBytes]Returned more bytes than we have space for"); 1300Contract.Assert(result <= charCount, "[Encoding.GetChars]Returned more chars than we have space for"); 1945Contract.Assert(fallbackBuffer.Remaining == 0, 2017Contract.Assert(bytes < byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date"); 2147Contract.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 2211Contract.Assert(chars > charStart ||
system\text\gb18030encoding.cs (15)
138Contract.Assert(info!=null, "[GB18030Encoding(Serialization...)] Expected null info to throw"); 150Contract.Assert(info!=null, "[GB18030.GetObjectData] Expected null info to throw"); 209Contract.Assert(count4Byte <= GBLast4ByteCode, 227Contract.Assert(unicodeCount == 0, 231Contract.Assert(count4Byte == GBLast4ByteCode + 1, 271Contract.Assert(byteCount >= 0, "[GB18030Encoding.GetBytes]byteCount is negative"); 272Contract.Assert(chars != null, "[GB18030Encoding.GetBytes]chars is null"); 273Contract.Assert(charCount >= 0, "[GB18030Encoding.GetBytes]charCount is negative"); 276Contract.Assert(encoderFallback != null, "[GB18030Encoding.GetBytes]Attempting to use null encoder fallback"); 299Contract.Assert(Char.IsHighSurrogate(charLeftOver), 329Contract.Assert(offset < 0x6f, 379Contract.Assert(iBytes < 0x7e, 459Contract.Assert(bytes != null, "[GB18030Encoding.GetChars]bytes is null"); 460Contract.Assert(byteCount >= 0, "[GB18030Encoding.GetChars]byteCount is negative"); 462Contract.Assert(charCount >= 0, "[GB18030Encoding.GetChars]charCount is negative");
system\text\isciiencoding.cs (34)
77Contract.Assert(defaultCodePage >= CodeDevanagari && defaultCodePage <= CodePunjabi, 91Contract.Assert(false, "Didn't expect to make it to ISCIIEncoding serialization constructor"); 102Contract.Assert(info!=null, "[ISCIIEncoding.GetObjectData] Expected null info to throw"); 175Contract.Assert(chars != null, "[ISCIIEncoding.GetBytes]chars!=null"); 177Contract.Assert(charCount >=0, "[ISCIIEncoding.GetBytes]charCount >=0"); 178Contract.Assert(byteCount >=0, "[ISCIIEncoding.GetBytes]byteCount >=0"); 275Contract.Assert(indicScript!=0, "[ISCIIEncoding.GetBytes]expected an indic script value"); 286Contract.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi, 301Contract.Assert((indicTwoBytes >> 12) > 0 && (indicTwoBytes >> 12) <= 3, 367Contract.Assert(bytes != null, "[ISCIIEncoding.GetChars]bytes is null"); 368Contract.Assert(byteCount >= 0, "[ISCIIEncoding.GetChars]byteCount is negative"); 370Contract.Assert(charCount >= 0, "[ISCIIEncoding.GetChars]charCount is negative"); 402Contract.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi, 422Contract.Assert(((bLastVirama ? 1 : 0) + (bLastATR ? 1 : 0) + 483Contract.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastATR mode"); 484Contract.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastATR mode"); 485Contract.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastATR mode"); 486Contract.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastATR mode"); 515Contract.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastVirama mode"); 516Contract.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastVirama mode"); 517Contract.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastVirama mode"); 518Contract.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastVirama mode"); 551Contract.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastDevenagariStressAbbr mode"); 552Contract.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastDevenagariStressAbbr mode"); 553Contract.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastDevenagariStressAbbr mode"); 554Contract.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastDevenagariStressAbbr mode"); 559Contract.Assert(cLastCharForNextNukta > 0 && cLastCharForNoNextNukta > 0, 581Contract.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in cLastCharForNextNukta mode"); 582Contract.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in cLastCharForNextNukta mode"); 583Contract.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in cLastCharForNextNukta mode"); 588Contract.Assert (!bLastSpecial && !bLastDevenagariStressAbbr && !bLastVirama && !bLastATR && 607Contract.Assert (currentCodePageIndex != -1, "[ISCIIEncoding.GetChars]Expected valid currentCodePageIndex != -1"); 653Contract.Assert(currentCodePage == CodeDevanagari && b == DevenagariExt, 708Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
system\text\iso2022encoding.cs (26)
77Contract.Assert(false, "Didn't expect to make it to DBCSCodePageEncoding serialization constructor"); 135Contract.Assert(false, "[ISO2022Encoding.GetMemorySectionName] Don't expect to get here for code page " + this.CodePage); 279Contract.Assert(count >= 0, "[ISO2022Encoding.GetByteCount]count is negative"); 280Contract.Assert(chars != null, "[ISO2022Encoding.GetByteCount]chars is null"); 291Contract.Assert(chars != null, "[ISO2022Encoding.GetBytes]chars is null"); 292Contract.Assert(byteCount >= 0, "[ISO2022Encoding.GetBytes]byteCount is negative"); 293Contract.Assert(charCount >= 0, "[ISO2022Encoding.GetBytes]charCount is negative"); 296Contract.Assert(encoderFallback != null, "[ISO2022Encoding.GetBytes]Attempting to use null encoder fallback"); 332Contract.Assert(bytes != null, "[ISO2022Encoding.GetCharCount]bytes is null"); 333Contract.Assert(count >= 0, "[ISO2022Encoding.GetCharCount]byteCount is negative"); 344Contract.Assert(bytes != null, "[ISO2022Encoding.GetChars]bytes is null"); 345Contract.Assert(byteCount >= 0, "[ISO2022Encoding.GetChars]byteCount is negative"); 346Contract.Assert(charCount >= 0, "[ISO2022Encoding.GetChars]charCount is negative"); 370Contract.Assert(false, "[ISO2022Encoding.GetChars] had unexpected code page"); 434Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP5022xJP]leftover character should be high surrogate"); 495Contract.Assert(CodePage == 50221, "[ISO2022Encoding.GetBytesCP5022xJP]Expected Code Page 50221"); 677Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP50225KR]leftover character should be high surrogate"); 777Contract.Assert(!encoder.MustFlush || !encoder.m_throwOnOverflow, 825Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP52936]leftover character should be high surrogate"); 1151Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1245Contract.Assert(count > 0, "[ISO2022Encoding.DecrementEscapeBytes]count > 0"); 1453Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1512Contract.Assert(byteCount >=0, "[ISO2022Encoding.GetCharsCP52936]count >=0"); 1513Contract.Assert(bytes!=null, "[ISO2022Encoding.GetCharsCP52936]bytes!=null"); 1624Contract.Assert(currentMode == ISO2022Modes.ModeHZ, "[ISO2022Encoding.GetCharsCP52936]Expected ModeHZ"); 1749Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
system\text\latin1encoding.cs (26)
50Contract.Assert(info!=null, "[Latin1Encoding.GetObjectData] Expected null info to throw"); 68Contract.Assert(charCount >= 0, "[Latin1Encoding.GetByteCount]count is negative"); 69Contract.Assert(chars != null, "[Latin1Encoding.GetByteCount]chars is null"); 72Contract.Assert(encoderFallback != null, "[Latin1Encoding.GetByteCount]Attempting to use null fallback encoder"); 82Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 88Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 125Contract.Assert(encoder != null, 174Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 185Contract.Assert(bytes != null, "[Latin1Encoding.GetBytes]bytes is null"); 186Contract.Assert(byteCount >= 0, "[Latin1Encoding.GetBytes]byteCount is negative"); 187Contract.Assert(chars != null, "[Latin1Encoding.GetBytes]chars is null"); 188Contract.Assert(charCount >= 0, "[Latin1Encoding.GetBytes]charCount is negative"); 191Contract.Assert(encoderFallback != null, "[Latin1Encoding.GetBytes]Attempting to use null encoder fallback"); 200Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 204Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 287Contract.Assert(encoder != null, 341Contract.Assert(chars > charStart, 359Contract.Assert(fallbackBuffer == null || fallbackBuffer.bFallingBack == false, 363Contract.Assert(chars > charStart, 388Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 399Contract.Assert(bytes != null, "[Latin1Encoding.GetCharCount]bytes is null"); 400Contract.Assert(count >= 0, "[Latin1Encoding.GetCharCount]byteCount is negative"); 412Contract.Assert(bytes != null, "[Latin1Encoding.GetChars]bytes is null"); 413Contract.Assert(byteCount >= 0, "[Latin1Encoding.GetChars]byteCount is negative"); 414Contract.Assert(chars != null, "[Latin1Encoding.GetChars]chars is null"); 415Contract.Assert(charCount >= 0, "[Latin1Encoding.GetChars]charCount is negative");
system\text\mlangcodepageencoding.cs (3)
104Contract.Assert(false, "Didn't expect to make it to MLangCodePageEncoding ISerializable.GetObjectData"); 140Contract.Assert(false, "Didn't expect to make it to MLangCodePageEncoding.MLangEncoder.GetObjectData"); 178Contract.Assert(false, "Didn't expect to make it to MLangCodePageEncoding.MLangDecoder.GetObjectData");
system\text\normalization.cs (1)
282Contract.Assert(iLength > cBuffer.Length, "Buffer overflow should have iLength > cBuffer.Length");
system\text\sbcscodepageencoding.cs (36)
57Contract.Assert(false, "Didn't expect to make it to SBCSCodePageEncoding serialization constructor"); 77Contract.Assert(pCodePage->CodePage == this.dataTableCodePage, 100Contract.Assert(*mapCodePageCached == this.dataTableCodePage, 184Contract.Assert(arrayTemp[byteTemp] == UNKNOWN_CHAR, String.Format(CultureInfo.InvariantCulture, 285Contract.Assert(arrayTemp[iBestFitCount-1] != (char)0, 307Contract.Assert(count >= 0, "[SBCSCodePageEncoding.GetByteCount]count is negative"); 308Contract.Assert(chars != null, "[SBCSCodePageEncoding.GetByteCount]chars is null"); 311Contract.Assert(encoderFallback != null, "[SBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 323Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 328Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 367Contract.Assert(encoder != null, "[SBCSCodePageEncoding.GetByteCount]Expect to have encoder if we have a charLeftOver"); 418Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 429Contract.Assert(bytes != null, "[SBCSCodePageEncoding.GetBytes]bytes is null"); 430Contract.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetBytes]byteCount is negative"); 431Contract.Assert(chars != null, "[SBCSCodePageEncoding.GetBytes]chars is null"); 432Contract.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetBytes]charCount is negative"); 435Contract.Assert(encoderFallback != null, "[SBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 447Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 452Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 549Contract.Assert(encoder != null, "[SBCSCodePageEncoding.GetBytes]Expect to have encoder if we have a charLeftOver"); 602Contract.Assert(chars > charStart, 619Contract.Assert(fallbackBuffer == null || fallbackBuffer.bFallingBack == false, 623Contract.Assert(chars > charStart, 649Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 660Contract.Assert(bytes != null, "[SBCSCodePageEncoding.GetCharCount]bytes is null"); 661Contract.Assert(count >= 0, "[SBCSCodePageEncoding.GetCharCount]byteCount is negative"); 680Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 733Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 745Contract.Assert(bytes != null, "[SBCSCodePageEncoding.GetChars]bytes is null"); 746Contract.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetChars]byteCount is negative"); 747Contract.Assert(chars != null, "[SBCSCodePageEncoding.GetChars]chars is null"); 748Contract.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetChars]charCount is negative"); 772Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 852Contract.Assert(bytes > byteStart, 870Contract.Assert(bytes > byteStart, 887Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
system\text\stringbuilder.cs (29)
267Contract.Assert(currentBlock.m_MaxCapacity == maxCapacity, "Bad maxCapacity"); 268Contract.Assert(currentBlock.m_ChunkChars != null, "Empty Buffer"); 270Contract.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length, "Out of range length"); 271Contract.Assert(currentBlock.m_ChunkLength >= 0, "Negative length"); 272Contract.Assert(currentBlock.m_ChunkOffset >= 0, "Negative offset"); 277Contract.Assert(currentBlock.m_ChunkOffset == 0, "First chunk's offset is not 0"); 281Contract.Assert(currentBlock.m_ChunkOffset == prevBlock.m_ChunkOffset + prevBlock.m_ChunkLength, "There is a gap between chunks!"); 478Contract.Assert(Capacity >= originalCapacity, "setting the Length should never decrease the Capacity"); 500Contract.Assert(newLen > chunk.m_ChunkChars.Length, "the new chunk should be larger than the one it is replacing"); 510Contract.Assert(Capacity >= originalCapacity, "setting the Length should never decrease the Capacity"); 576Contract.Assert(m_ChunkLength == 0, "Expand should create a new block"); 1608Contract.Assert(chunk != null || count == 0, "Chunks ended prematurely"); 1692Contract.Assert(m_ChunkLength == 0, "Expand did not make a new block"); 1758Contract.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen"); 1759Contract.Assert(gapStart <= gapEnd, "negative gap size"); 1760Contract.Assert(gapEnd <= sourceChunk.m_ChunkLength, "gap too big"); 1770Contract.Assert(targetIndexInChunk <= targetChunk.m_ChunkLength, "gap not in chunk"); 1823Contract.Assert(lengthInChunk >= 0, "index not in chunk"); 1917Contract.Assert(0 <= index && index <= Length, "index not in string"); 1923Contract.Assert(ret != null, "index not in string"); 1934Contract.Assert(0 <= byteIndex && byteIndex <= Length*sizeof(char), "Byte Index not in string"); 1940Contract.Assert(ret != null, "Byte Index not in string"); 2027Contract.Assert(count > 0, "Count must be strictly positive"); 2028Contract.Assert(index >= 0, "Index can't be negative"); 2094Contract.Assert(size > 0, "size not positive"); 2095Contract.Assert(maxCapacity > 0, "maxCapacity not positive"); 2112Contract.Assert(startIndex >= 0 && startIndex < Length, "startIndex not in string"); 2141Contract.Assert(chunk != null, "fell off beginning of string!"); 2171Contract.Assert(chunk != null, "fell off beginning of string!");
system\text\surrogateencoder.cs (1)
55Contract.Assert(false, "Didn't expect to make it to SurrogateEncoder.GetObjectData");
system\text\unicodeencoding.cs (32)
440Contract.Assert(chars!=null, "[UnicodeEncoding.GetByteCount]chars!=null"); 441Contract.Assert(count >= 0, "[UnicodeEncoding.GetByteCount]count >=0"); 590Contract.Assert(chars > charStart, 657Contract.Assert(chars > charStart, 723Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 734Contract.Assert(chars!=null, "[UnicodeEncoding.GetBytes]chars!=null"); 735Contract.Assert(byteCount >=0, "[UnicodeEncoding.GetBytes]byteCount >=0"); 736Contract.Assert(charCount >=0, "[UnicodeEncoding.GetBytes]charCount >=0"); 737Contract.Assert(bytes!=null, "[UnicodeEncoding.GetBytes]bytes!=null"); 941Contract.Assert(chars > charStart, 1007Contract.Assert(chars > charStart + 1 || bytes == byteStart, 1036Contract.Assert(chars > charStart, 1070Contract.Assert(chars > charStart, 1138Contract.Assert((encoder != null && !encoder.MustFlush) || charLeftOver == (char)0, 1141Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0 || 1154Contract.Assert(bytes!=null, "[UnicodeEncoding.GetCharCount]bytes!=null"); 1155Contract.Assert(count >= 0, "[UnicodeEncoding.GetCharCount]count >=0"); 1194Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1484Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 1494Contract.Assert(chars!=null, "[UnicodeEncoding.GetChars]chars!=null"); 1495Contract.Assert(byteCount >=0, "[UnicodeEncoding.GetChars]byteCount >=0"); 1496Contract.Assert(charCount >=0, "[UnicodeEncoding.GetChars]charCount >=0"); 1497Contract.Assert(bytes!=null, "[UnicodeEncoding.GetChars]bytes!=null"); 1513Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1671Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1720Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1737Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1779Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1796Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1841Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1894Contract.Assert((decoder.MustFlush == false) || ((lastChar == (char)0) && (lastByte == -1)), 1909Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
system\text\utf32encoding.cs (25)
439Contract.Assert(chars!=null, "[UTF32Encoding.GetByteCount]chars!=null"); 440Contract.Assert(count >=0, "[UTF32Encoding.GetByteCount]count >=0"); 502Contract.Assert(chars > charStart, 555Contract.Assert(fallbackBuffer.Remaining == 0, 566Contract.Assert(chars!=null, "[UTF32Encoding.GetBytes]chars!=null"); 567Contract.Assert(bytes!=null, "[UTF32Encoding.GetBytes]bytes!=null"); 568Contract.Assert(byteCount >=0, "[UTF32Encoding.GetBytes]byteCount >=0"); 569Contract.Assert(charCount >=0, "[UTF32Encoding.GetBytes]charCount >=0"); 638Contract.Assert(chars > charStart + 1 || bytes == byteStart, 666Contract.Assert(chars > charStart, 707Contract.Assert(chars > charStart, 741Contract.Assert(highSurrogate == 0 || (encoder != null && !encoder.MustFlush), 760Contract.Assert(bytes!=null, "[UTF32Encoding.GetCharCount]bytes!=null"); 761Contract.Assert(count >=0, "[UTF32Encoding.GetCharCount]count >=0"); 786Contract.Assert(fallbackBuffer.Remaining == 0, 893Contract.Assert(fallbackBuffer.Remaining == 0, 904Contract.Assert(chars!=null, "[UTF32Encoding.GetChars]chars!=null"); 905Contract.Assert(bytes!=null, "[UTF32Encoding.GetChars]bytes!=null"); 906Contract.Assert(byteCount >=0, "[UTF32Encoding.GetChars]byteCount >=0"); 907Contract.Assert(charCount >=0, "[UTF32Encoding.GetChars]charCount >=0"); 934Contract.Assert(fallbackBuffer.Remaining == 0, 995Contract.Assert(bytes >= byteStart + 4 || chars == charStart, 1019Contract.Assert(bytes >= byteStart + 4 || chars == charStart, 1036Contract.Assert(bytes >= byteStart + 4 || chars == charStart, 1100Contract.Assert(fallbackBuffer.Remaining == 0,
system\text\utf7encoding.cs (14)
510Contract.Assert(chars!=null, "[UTF7Encoding.GetByteCount]chars!=null"); 511Contract.Assert(count >=0, "[UTF7Encoding.GetByteCount]count >=0"); 521Contract.Assert(byteCount >=0, "[UTF7Encoding.GetBytes]byteCount >=0"); 522Contract.Assert(chars!=null, "[UTF7Encoding.GetBytes]chars!=null"); 523Contract.Assert(charCount >=0, "[UTF7Encoding.GetBytes]charCount >=0"); 661Contract.Assert(count >=0, "[UTF7Encoding.GetCharCount]count >=0"); 662Contract.Assert(bytes!=null, "[UTF7Encoding.GetCharCount]bytes!=null"); 672Contract.Assert(byteCount >=0, "[UTF7Encoding.GetChars]byteCount >=0"); 673Contract.Assert(bytes!=null, "[UTF7Encoding.GetChars]bytes!=null"); 674Contract.Assert(charCount >=0, "[UTF7Encoding.GetChars]charCount >=0"); 693Contract.Assert(firstByte == false || decoder.bitCount <= 0, 1080Contract.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.Fallback] Can't have recursive fallbacks"); 1081Contract.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte"); 1141Contract.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.InternalFallback] Can't have recursive fallbacks");
system\text\utf8encoding.cs (32)
516Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF, 548Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF, 819Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 852Contract.Assert(chars!=null, "[UTF8Encoding.GetBytes]chars!=null"); 853Contract.Assert(byteCount >=0, "[UTF8Encoding.GetBytes]byteCount >=0"); 854Contract.Assert(charCount >=0, "[UTF8Encoding.GetBytes]charCount >=0"); 855Contract.Assert(bytes!=null, "[UTF8Encoding.GetBytes]bytes!=null"); 904Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF, 932Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF, 1029Contract.Assert(pSrc >= chars || pTarget == bytes, 1251Contract.Assert(pTarget <= pAllocatedBufferEnd, "[UTF8Encoding.GetBytes]pTarget <= pAllocatedBufferEnd"); 1262Contract.Assert(!encoder.MustFlush || ch == 0, 1269Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0 || 1294Contract.Assert(count >=0, "[UTF8Encoding.GetCharCount]count >=0"); 1295Contract.Assert(bytes!=null, "[UTF8Encoding.GetCharCount]bytes!=null"); 1314Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1349Contract.Assert( (ch & (SupplimentarySeq | ThreeByteSeq)) != 0, 1670Contract.Assert(fallback == null || fallback.Remaining == 0, 1690Contract.Assert(chars!=null, "[UTF8Encoding.GetChars]chars!=null"); 1691Contract.Assert(byteCount >=0, "[UTF8Encoding.GetChars]count >=0"); 1692Contract.Assert(charCount >=0, "[UTF8Encoding.GetChars]charCount >=0"); 1693Contract.Assert(bytes!=null, "[UTF8Encoding.GetChars]bytes!=null"); 1710Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1745Contract.Assert( (ch & (SupplimentarySeq | ThreeByteSeq)) != 0, 1808Contract.Assert(pSrc >= bytes || pTarget == chars, 1815Contract.Assert(pSrc >= bytes, 1901Contract.Assert(pSrc >= bytes || pTarget == chars, 2155Contract.Assert(pTarget <= pAllocatedBufferEnd, "[UTF8Encoding.GetChars]pTarget <= pAllocatedBufferEnd"); 2182Contract.Assert(pSrc >= bytes || pTarget == chars, 2190Contract.Assert(pSrc >= bytes, 2201Contract.Assert(!baseDecoder.MustFlush || ch == 0 || !baseDecoder.m_throwOnOverflow, 2212Contract.Assert(fallback == null || fallback.Remaining == 0,
system\threading\CancellationToken.cs (1)
172Contract.Assert(action != null, "Expected an Action here");
system\threading\CancellationTokenSource.cs (7)
643Contract.Assert(CanBeCanceled, "Cannot register for uncancelable token src"); 741Contract.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 753Contract.Assert(IsCancellationRequested, "ExecuteCallbackHandlers should only be called after setting IsCancellationRequested->true"); 754Contract.Assert(ThreadIDExecutingCallbacks != -1, "ThreadIDExecutingCallbacks should have been set."); 838Contract.Assert(exceptionList.Count > 0, "Expected exception count > 0"); 1113Contract.Assert(start >= 0 && start < c, "start is outside of bounds"); 1120Contract.Assert(tryIndex >= 0 && tryIndex < curr.m_elements.Length, "tryIndex is outside of bounds");
system\threading\CountdownEvent.cs (1)
273Contract.Assert(m_currentCount >= 0, "latch was decremented below zero");
system\threading\hostexecutioncontextmanager.cs (1)
331Contract.Assert(_hostExecutionContextManager == null, "HostExecutionContextManager should be null");
system\threading\ManualResetEventSlim.cs (8)
149Contract.Assert(value >= 0, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 150Contract.Assert(value <= SpinCountState_MaxValue, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 169Contract.Assert(value >= 0, "NumWaiters should never be less than zero. This indicates an internal error."); 247Contract.Assert(DEFAULT_SPIN_SP >= 0, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 248Contract.Assert(DEFAULT_SPIN_SP <= SpinCountState_MaxValue, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 300Contract.Assert(currentIsSet, 751Contract.Assert(mre != null, "Expected a ManualResetEventSlim"); 772Contract.Assert((newBits | updateBitsMask) == updateBitsMask, "newBits do not fall within the updateBitsMask.");
system\threading\overlapped.cs (3)
97Contract.Assert(helper != null,"_IOCompletionCallback cannot be null"); 183Contract.Assert(m_pinSelf.IsNull(), "OverlappedData has not been freed: m_pinSelf"); 186Contract.Assert(m_AppDomainId == 0 || m_AppDomainId == AppDomain.CurrentDomain.Id, "OverlappedData is not in the current domain");
system\threading\SemaphoreSlim.cs (13)
96Contract.Assert(setSuccessfully, "Should have been able to complete task"); 368Contract.Assert(m_asyncTail != null, "tail should not be null if head isn't"); 400Contract.Assert(!waitSuccessful || m_currentCount > 0, 629Contract.Assert(m_currentCount == 0, "m_currentCount should never be negative"); 642Contract.Assert(Monitor.IsEntered(m_lockObj), "Requires the lock be held"); 650Contract.Assert(m_asyncTail == null, "If head is null, so too should be tail"); 656Contract.Assert(m_asyncTail != null, "If head is not null, neither should be tail"); 672Contract.Assert(Monitor.IsEntered(m_lockObj), "Requires the lock be held"); 682Contract.Assert((m_asyncHead == null) == (m_asyncTail == null), "Head is null iff tail is null"); 697Contract.Assert(asyncWaiter != null, "Waiter should have been constructed"); 698Contract.Assert(Monitor.IsEntered(m_lockObj), "Requires the lock be held"); 805Contract.Assert(m_asyncTail != null, "tail should not be null if head isn't null"); 889Contract.Assert(semaphore != null, "Expected a SemaphoreSlim");
system\threading\SpinLock.cs (1)
129Contract.Assert(!IsThreadOwnerTrackingEnabled, "property should be false by now");
system\threading\SpinWait.cs (1)
314Contract.Assert(procCount > 0 && procCount <= 64,
system\threading\Tasks\AsyncCausalityTracer.cs (1)
156Contract.Assert(token != default(EventRegistrationToken), "EventRegistrationToken is null");
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (14)
219Contract.Assert(!localCs.Task.IsCompleted, "Completion should only happen once."); 225Contract.Assert(success, "Expected to complete completion task."); 342else Contract.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing count must be the sentinel if it's not >= 0."); 357Contract.Assert(!m_threadProcessingMapping.ContainsKey(Thread.CurrentThread.ManagedThreadId), 378Contract.Assert(currentMode == ProcessingMode.ProcessingExclusiveTask, 388Contract.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing mode should not have deviated from exclusive."); 406Contract.Assert(!m_threadProcessingMapping.ContainsKey(Thread.CurrentThread.ManagedThreadId), 438Contract.Assert(currentMode == ProcessingMode.ProcessingConcurrentTasks, 448Contract.Assert(m_processingCount > 0, "The procesing mode should not have deviated from concurrent."); 533Contract.Assert(task != null, "Infrastructure should have provided a non-null task."); 550Contract.Assert(task != null, "Infrastructure should have provided a non-null task."); 561Contract.Assert(task != null, "Infrastructure should have provided a non-null task."); 634Contract.Assert(t.IsFaulted, "Task should be faulted due to the scheduler faulting it and throwing the exception."); 758Contract.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
system\threading\Tasks\Future.cs (9)
464Contract.Assert(m_action == null, "Task<T>.TrySetResult(): non-null m_action"); 504Contract.Assert(!IsCompleted, "The promise must not yet be completed."); 546Contract.Assert(!IsWaitNotificationEnabledOrNotRanToCompletion, 565Contract.Assert(IsRanToCompletion, "Task<T>.Result getter: Expected result to have been set."); 579Contract.Assert(m_action == null, "Task<T>.TrySetException(): non-null m_action"); 582Contract.Assert(exceptionObject != null, "Expected non-null exceptionObject argument"); 585Contract.Assert( 627Contract.Assert(m_action == null, "Task<T>.TrySetCanceled(): non-null m_action"); 689Contract.Assert(false, "Invalid m_action in Task<TResult>");
system\threading\Tasks\FutureFactory.cs (10)
853Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 989Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1134Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1286Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1336Contract.Assert(thisRef != null, "Expected a non-null thisRef"); 1337Contract.Assert(beginMethod != null, "Expected a non-null beginMethod"); 1338Contract.Assert(endMethod != null, "Expected a non-null endMethod"); 1351Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1431Contract.Assert(!IsCompleted, "The task should not have been completed yet."); 1460Contract.Assert(successfullySet, "Expected the task to not yet be completed");
system\threading\Tasks\Parallel.cs (13)
1042Contract.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1, 1044Contract.Assert(bodyWithLocal != null || (localInit == null && localFinally == null), 1357Contract.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1, 1359Contract.Assert(bodyWithLocal != null || (localInit == null && localFinally == null), 2225Contract.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 2228Contract.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 2290Contract.Assert(parallelOptions != null, "ForEachWorker(array): parallelOptions is null"); 2349Contract.Assert(parallelOptions != null, "ForEachWorker(list): parallelOptions is null"); 3202Contract.Assert(((simpleBody == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 3205Contract.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 3209Contract.Assert((orderedSource != null) || (bodyWithStateAndIndex == null && bodyWithEverything == null), 3412Contract.Assert(false, "PartitionerForEach: illegal body type in Partitioner handler"); 3587Contract.Assert(m_timeLimit != 0, "Probably the default initializer for LoopTimer was used somewhere");
system\threading\Tasks\ProducerConsumerQueues.cs (6)
147Contract.Assert(INIT_SEGMENT_SIZE > 0, "Initial segment size must be > 0."); 148Contract.Assert((INIT_SEGMENT_SIZE & (INIT_SEGMENT_SIZE - 1)) == 0, "Initial segment size must be a power of 2"); 149Contract.Assert(INIT_SEGMENT_SIZE <= MAX_SEGMENT_SIZE, "Initial segment size should be <= maximum."); 150Contract.Assert(MAX_SEGMENT_SIZE < Int32.MaxValue / 2, "Max segment size * 2 must be < Int32.MaxValue, or else overflow could occur."); 190Contract.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 463Contract.Assert(syncObj != null, "The syncObj parameter is null.");
system\threading\Tasks\Task.cs (58)
353Contract.Assert(promiseStyle, "Promise CTOR: promiseStyle was false"); 630Contract.Assert(m_stateFlags == 0, "TaskConstructorCore: non-zero m_stateFlags"); 631Contract.Assert((((int)creationOptions) | OptionsMask) == OptionsMask, "TaskConstructorCore: options take too many bits"); 658Contract.Assert((internalOptions & 751Contract.Assert(targetTask != null, 775Contract.Assert(m_contingentProperties == null || m_contingentProperties.m_capturedContext == null, 803Contract.Assert((OptionsMask & 1) == 1, "OptionsMask needs a shift in Options.get"); 853Contract.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, 861Contract.Assert(success, "Tried to set enabled on completed Task"); 898Contract.Assert(tasks != null, "Expected non-null array of tasks"); 938Contract.Assert(isWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 958Contract.Assert(IsWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 1003Contract.Assert(Task.InternalCurrent == this || this.IsSelfReplicatingRoot, "Task.AddNewChild(): Called from an external context"); 1026Contract.Assert(Task.InternalCurrent == this, "Task.DisregardChild(): Called from an external context"); 1029Contract.Assert(props.m_completionCountdown >= 2, "Task.DisregardChild(): Expected parent count to be >= 2"); 1247Contract.Assert( 1264Contract.Assert((m_stateFlags & TASK_STATE_CANCELED) != 0, "Task.RunSynchronously: expected TASK_STATE_CANCELED to be set"); 1415Contract.Assert((e == null) || IsFaulted, "Task.Exception_get(): returning non-null value when not Faulted"); 1509Contract.Assert(m_contingentProperties == null, "Expected props to be null after checking and with needsProtection == false"); 1914Contract.Assert(m_taskScheduler != null, "expected a task scheduler to have been selected"); 1915Contract.Assert((m_stateFlags & TASK_STATE_STARTED) == 0, "task has already started"); 1969Contract.Assert( 2124Contract.Assert(exceptionsAvailable, "Must only be used when the task has faulted with exceptions."); 2134Contract.Assert(IsCanceled, "Must only be used when the task has canceled."); 2373Contract.Assert(childTask.m_parent == this, "ProcessChildCompletion should only be called for a child of this task"); 2433Contract.Assert(task.IsCompleted, "Expected all tasks in list to be completed"); 2464Contract.Assert(!bTAEAddedToExceptionHolder || (m_contingentProperties != null && m_contingentProperties.m_exceptionsHolder != null), 2859Contract.Assert(task != null, "expected a task object"); 2870Contract.Assert(m_action != null, "Null action in InnerInvoke()"); 2883Contract.Assert(false, "Invalid m_action in Task"); 3019Contract.Assert(!flowExecutionContext, "We already determined we're not required to flow context."); 3187Contract.Assert((m_stateFlags & TASK_STATE_FAULTED) == 0, "Task.Wait() completing when in Faulted state."); 3458Contract.Assert(!mustCleanup, "Possibly an invalid state transition call was made in InternalCancel()"); 3500Contract.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, "Task.RecordInternalCancellationRequest(CancellationToken) only valid for promise-style task"); 3541Contract.Assert((m_stateFlags & (TASK_STATE_CANCELED | TASK_STATE_COMPLETION_RESERVED)) != 0, "Task.CancellationCleanupLogic(): Task not canceled or reserved."); 3575Contract.Assert(this == Task.InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task"); 3576Contract.Assert(IsCancellationRequested, "SetCancellationAcknowledged() should not be called if the task's CT wasn't signaled"); 3707Contract.Assert(currentContinuation is ITaskCompletionAction, "Expected continuation element to be Action, TaskContinuation, or ITaskContinuationAction"); 4753Contract.Assert((list != null) || (m_continuationObject == s_taskCompletionSentinel), 5157Contract.Assert(exceptions != null, "Should have seen at least one exception"); 5182Contract.Assert(tasks != null, "Expected a non-null list of tasks"); 5183Contract.Assert(tasks.Count > 0, "Expected at least one task"); 5229Contract.Assert(count > 0, "Expected count > 0"); 5236Contract.Assert(_count >= 0, "Count should never go below 0"); 5325Contract.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5542Contract.Assert(succeeded, "This should always succeed on a new task."); 5597Contract.Assert(succeeded, "This should always succeed on a new task."); 6142Contract.Assert(task != null, "Constituent task in WhenAll should never be null"); 6162Contract.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6184Contract.Assert(m_count >= 0, "Count should never go below 0"); 6387Contract.Assert(task != null, "Constituent task in WhenAll should never be null"); 6412Contract.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6434Contract.Assert(m_count >= 0, "Count should never go below 0"); 7051Contract.Assert(m_inliningDepth >= 0, "Inlining depth count should never go negative."); 7210Contract.Assert(result, "Expected TrySetFromTask from inner task to succeed"); 7213Contract.Assert(false, "UnwrapPromise in illegal state"); 7239Contract.Assert(_state == STATE_WAITING_ON_OUTER_TASK, "We're in the wrong state!"); 7251Contract.Assert(result, "Expected TrySetFromTask from outer task to succeed");
system\threading\Tasks\TaskContinuation.cs (9)
51Contract.Assert(antecedent != null, 72Contract.Assert(false, "Invalid m_action in ContinuationTaskFromTask"); 99Contract.Assert(antecedent != null, 120Contract.Assert(false, "Invalid m_action in ContinuationResultTaskFromTask"); 147Contract.Assert(antecedent != null, 168Contract.Assert(false, "Invalid m_action in ContinuationTaskFromResultTask"); 195Contract.Assert(antecedent != null, 216Contract.Assert(false, "Invalid m_action in ContinuationResultTaskFromResultTask"); 325Contract.Assert(completedTask.IsCompleted, "ContinuationTask.Run(): completedTask not completed");
system\threading\Tasks\TaskExceptionHolder.cs (9)
208Contract.Assert(m_cancellationException == null, 213Contract.Assert(m_faultExceptions == null, 227Contract.Assert(edi != null && edi.SourceException is OperationCanceledException, 248else Contract.Assert(exceptions.Count > 0, "Expected existing exceptions list to have > 0 exceptions."); 376Contract.Assert(exceptions != null, "Expected an initialized list."); 377Contract.Assert(exceptions.Count > 0, "Expected at least one exception."); 406Contract.Assert(exceptions != null, "Expected an initialized list."); 407Contract.Assert(exceptions.Count > 0, "Expected at least one exception."); 422Contract.Assert(edi == null || edi.SourceException is OperationCanceledException,
system\threading\Tasks\TaskFactory.cs (3)
1672Contract.Assert(_count >= 0, "Count should never go below 0"); 1750Contract.Assert(_count >= 0, "Count should never go below 0"); 2450Contract.Assert(success, "Only one task should have gotten to this point, and thus this must be successful.");
system\threading\Tasks\TaskScheduler.cs (1)
595Contract.Assert(scheduler != null, "Table returned an incorrect Count or CopyTo failed");
system\threading\Tasks\TaskToApm.cs (2)
82Contract.Assert(task != null, "TaskWrapperAsyncResult should never wrap a null Task."); 107Contract.Assert(twar.Task != null, "TaskWrapperAsyncResult should never wrap a null Task.");
system\threading\Tasks\ThreadPoolTaskScheduler.cs (1)
47Contract.Assert(t != null, "TaskScheduler.LongRunningThreadWork: t is null");
system\threading\thread.cs (1)
1479Contract.Assert(CurrentThread.m_Context == null || CurrentThread.m_Context.AppDomain == ad, "AppDomains on the managed & unmanaged threads should match");
system\threading\ThreadLocal.cs (1)
199Contract.Assert(id >= 0 || !m_initialized, "expected id >= 0 if initialized");
system\threading\threadpool.cs (1)
1328Contract.Assert(helper != null, "Null state passed to PerformWaitOrTimerCallback!");
system\throwhelper.cs (2)
233Contract.Assert(false, "The enum value is not defined, please checked ExceptionArgumentName Enum."); 434Contract.Assert( false, "The enum value is not defined, please checked ExceptionArgumentName Enum.");
system\tuple.cs (1)
1071Contract.Assert(false, "Missed all cases for computing Tuple hash code");
system\unsafecharbuffer.cs (3)
28Contract.Assert( buffer != null, "buffer pointer can't be null." ); 29Contract.Assert( bufferSize >= 0, "buffer size can't be negative." ); 50Contract.Assert(m_length <= m_totalSize, "Buffer has been overflowed!");
system\variant.cs (2)
327Contract.Assert(obj != null, "obj != null"); 333Contract.Assert(obj != null, "obj != null");
system\version.cs (3)
341Contract.Assert(num >= 0, "AppendPositiveNumber expect positive numbers"); 520Contract.Assert(false, "Int32.Parse() did not throw exception but TryParse failed: " + m_exceptionArgument); 523Contract.Assert(false, "Unmatched case in Version.GetVersionParseException() for value: " + m_failure);
System (229)
compmod\system\collections\specialized\marshalinghelpers.cs (6)
160Contract.Assert(false, "This class is never instantiated"); 202Contract.Assert(false, "This class is never instantiated"); 246Contract.Assert(false, "This class is never instantiated"); 288Contract.Assert(false, "This class is never instantiated"); 337Contract.Assert(false, "This class is never instantiated"); 399Contract.Assert(false, "This class is never instantiated");
compmod\system\collections\specialized\notifycollectionchangedeventargs.cs (1)
315Contract.Assert(false, String.Format("Unsupported action: {0}", action.ToString()));
net\System\Net\_ChunkParser.cs (12)
170Contract.Assert(userAsyncResult == null, "Overlapped read operations are not allowed."); 171Contract.Assert((readState == ReadState.ChunkLength) || (readState == ReadState.PayloadEnd) || 192Contract.Assert(userAsyncResult == null, 210Contract.Assert(readState < ReadState.Done, "We're already done. No need to process state."); 239Contract.Assert(false, "Unknown state"); 271Contract.Assert(false, "Unknown state"); 462Contract.Assert(currentOperationBytesRead == 0, 487Contract.Assert(bufferCurrentPos == bufferFillLength, 519Contract.Assert(readState == ReadState.Payload, 530Contract.Assert(currentChunkBytesRead <= currentChunkLength, 680Contract.Assert(result != DataParseStatus.ContinueParsing, 787Contract.Assert(currentPos < bufferFillLength,
net\System\Net\WebSockets\ClientWebSocket.cs (3)
112Contract.Assert(false, "NotImplemented: " + state); 163Contract.Assert(response != null, "Not an HttpWebResponse"); 608Contract.Assert(!isReadOnly, "Already set");
net\System\Net\WebSockets\HttpListenerWebSocketContext.cs (5)
46Contract.Assert(requestUri != null, "requestUri shouldn't be null"); 47Contract.Assert(headers != null, "headers shouldn't be null"); 48Contract.Assert(cookieCollection != null, "cookieCollection shouldn't be null"); 49Contract.Assert(secWebSocketProtocols != null, "secWebSocketProtocols shouldn't be null"); 50Contract.Assert(webSocket != null, "webSocket shouldn't be null");
net\System\Net\WebSockets\InternalClientWebSocket.cs (3)
45Contract.Assert(m_SessionHandle != null, "'m_SessionHandle MUST NOT be NULL."); 54Contract.Assert(m_Properties != null, "'m_Properties' MUST NOT be NULL."); 57Contract.Assert(sessionHandle != null, "'sessionHandle MUST NOT be NULL.");
net\System\Net\WebSockets\ServerWebSocket.cs (3)
48Contract.Assert(m_SessionHandle != null, "'m_SessionHandle MUST NOT be NULL."); 57Contract.Assert(m_Properties != null, "'m_Properties' MUST NOT be NULL."); 62Contract.Assert(sessionHandle != null, "'sessionHandle MUST NOT be NULL.");
net\System\Net\WebSockets\WebSocketBase.cs (40)
75Contract.Assert(internalBuffer != null, "'internalBuffer' MUST NOT be NULL."); 146Contract.Assert(m_State != WebSocketState.None, "'m_State' MUST NOT be 'WebSocketState.None'."); 179Contract.Assert(m_InternalBuffer != null, "'m_InternalBuffer' MUST NOT be NULL."); 306Contract.Assert(messageType == WebSocketMessageType.Binary || messageType == WebSocketMessageType.Text, 691Contract.Assert(thisLockTakenSnapshot, "'thisLockTakenSnapshot' MUST be 'true' at this point."); 819Contract.Assert(m_CloseReceivedTaskCompletionSource != null, 964Contract.Assert(ownsSendCancellationSource, "'ownsSendCancellationSource' MUST be 'true' at this point."); 1060Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL."); 1074Contract.Assert(m_ThisLock != null, "'m_ThisLock' MUST NOT be NULL."); 1075Contract.Assert(SessionHandle != null, "'SessionHandle' MUST NOT be NULL."); 1083Contract.Assert(m_ThisLock != null, "'m_ThisLock' MUST NOT be NULL."); 1084Contract.Assert(SessionHandle != null, "'SessionHandle' MUST NOT be NULL."); 1169Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL."); 1187Contract.Assert(messageType == WebSocketMessageType.Binary || messageType == WebSocketMessageType.Text, 1230Contract.Assert(false, 1280Contract.Assert(error != null, "'error' MUST NOT be NULL."); 1302Contract.Assert(exception != null, "'exception' MUST NOT be NULL."); 1472Contract.Assert(false, 1533Contract.Assert(sender != null, "'sender' MUST NOT be NULL."); 1534Contract.Assert((sender as WebSocketBase) != null, "'sender as WebSocketBase' MUST NOT be NULL."); 1616Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 1648Contract.Assert(BufferCount >= 1 && BufferCount <= 2, "'bufferCount' MUST ONLY BE '1' or '2'."); 1689Contract.Assert(ReceiveResult.Count == 0, "'receiveResult.Count' MUST be 0."); 1690Contract.Assert(ReceiveResult.CloseStatus != null, "'receiveResult.CloseStatus' MUST NOT be NULL for message type 'Close'."); 1852Contract.Assert(false, assertMessage); 1908Contract.Assert(buffer != null, "'buffer' MUST NOT be NULL."); 1922Contract.Assert(false, "'originalReceiveState' MUST NEVER be ReceiveState.Application at this point."); 1934Contract.Assert(false, 1969Contract.Assert(ReceiveResult != null, 1989Contract.Assert(buffer != null, "'buffer MUST NOT be NULL."); 2116Contract.Assert(!m_BufferHasBeenPinned, "'m_BufferHasBeenPinned' MUST NOT be pinned at this point."); 2133Contract.Assert(ReceiveResult == null, "'ReceiveResult' MUST be NULL."); 2157Contract.Assert(buffer == null, "'buffer' MUST BE NULL."); 2170Contract.Assert(blob.Length <= WebSocketHelpers.MaxControlFramePayloadLength, 2265Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 2266Contract.Assert(webSocket.m_KeepAliveTracker != null, 2269Contract.Assert(keepAliveIntervalMilliseconds > 0, "'keepAliveIntervalMilliseconds' MUST be POSITIVE."); 2363Contract.Assert(operationsOutstanding >= 1, "'operationsOutstanding' must never be smaller than 1."); 2381Contract.Assert(m_OperationsOutstanding >= 0, "'m_OperationsOutstanding' must never be smaller than 0."); 2411Contract.Assert(m_CancellationTokenSource == null, "'m_CancellationTokenSource' MUST be NULL.");
net\System\Net\WebSockets\WebSocketBuffer.cs (46)
60Contract.Assert(internalBuffer != null, "'internalBuffer' MUST NOT be NULL."); 61Contract.Assert(receiveBufferSize >= MinReceiveBufferSize, 63Contract.Assert(sendBufferSize >= MinSendBufferSize, 65Contract.Assert(receiveBufferSize <= MaxBufferSize, 67Contract.Assert(sendBufferSize <= MaxBufferSize, 105Contract.Assert(internalBuffer.Count >= GetInternalBufferSize(receiveBufferSize, sendBufferSize, false), 114Contract.Assert(internalBuffer.Count >= GetInternalBufferSize(receiveBufferSize, sendBufferSize, true), 203Contract.Assert(false, "'m_SendBufferState' MUST BE 'None' at this point."); 232Contract.Assert(Marshal.UnsafeAddrOfPinnedArrayElement(m_PinnedSendBuffer.Array, 250Contract.Assert(Marshal.UnsafeAddrOfPinnedArrayElement(m_PinnedSendBuffer.Array, 326Contract.Assert(m_PayloadOffset == 0, 328Contract.Assert(m_BufferedPayloadReceiveResult == null || m_BufferedPayloadReceiveResult.Count == 0, 397Contract.Assert(false, "'buffer' MUST reference a memory segment within the pinned InternalBuffer."); 430Contract.Assert(false, "'buffer' MUST reference a memory segment within the pinned InternalBuffer."); 448Contract.Assert(dataBufferCount <= (uint)int.MaxValue, 450Contract.Assert(dataBuffers != null, "'dataBuffers' MUST NOT be NULL."); 455Contract.Assert(false, "'dataBufferCount' MUST NOT be bigger than 'dataBuffers.Length'."); 492Contract.Assert(false, 502Contract.Assert(false, 515Contract.Assert(false, "At least one 'dataBuffer.Buffer' MUST NOT be NULL."); 549Contract.Assert(false, 575Contract.Assert(m_BufferedPayloadReceiveResult != null, 577Contract.Assert(m_BufferedPayloadReceiveResult.Count >= 0, 579Contract.Assert(m_PayloadOffset >= 0, "'m_PayloadOffset' MUST NOT be smaller than 0."); 580Contract.Assert(m_PayloadOffset <= m_PayloadBuffer.Count, 582Contract.Assert(m_PayloadOffset + m_BufferedPayloadReceiveResult.Count <= m_PayloadBuffer.Count, 588Contract.Assert(pBuffer != IntPtr.Zero, "'pBuffer' MUST NOT be IntPtr.Zero."); 591Contract.Assert(offset >= 0, "'offset' MUST NOT be negative."); 605Contract.Assert(buffer != null, "'buffer' MUST NOT be NULL."); 606Contract.Assert(m_NativeBuffer.Array != null, "'m_NativeBuffer.Array' MUST NOT be NULL."); 607Contract.Assert(offset >= 0, "'offset' MUST NOT be negative."); 608Contract.Assert(count >= 0, "'count' MUST NOT be negative."); 609Contract.Assert(offset + count <= buffer.Length, "'offset + count' MUST NOT exceed 'buffer.Length'."); 618Contract.Assert(offset >= 0, "'offset' MUST NOT be negative."); 619Contract.Assert(m_StartAddress + offset - m_InternalBuffer.Offset <= m_EndAddress, "'offset' is TOO BIG."); 626Contract.Assert(pBuffer != IntPtr.Zero, "'pBuffer' MUST NOT be NULL."); 627Contract.Assert(bufferSize <= GetMaxBufferSize(), 633Contract.Assert(Marshal.UnsafeAddrOfPinnedArrayElement(m_InternalBuffer.Array, m_InternalBuffer.Offset).ToInt64() == m_StartAddress, 659Contract.Assert(receiveBufferSize >= MinReceiveBufferSize, 661Contract.Assert(sendBufferSize >= MinSendBufferSize, 670Contract.Assert(receiveBufferSize >= MinReceiveBufferSize, 672Contract.Assert(sendBufferSize >= MinSendBufferSize, 685Contract.Assert(receiveBufferSize >= MinReceiveBufferSize, 687Contract.Assert(sendBufferSize >= MinSendBufferSize, 690Contract.Assert(receiveBufferSize <= MaxBufferSize, 692Contract.Assert(sendBufferSize <= MaxBufferSize,
net\System\Net\WebSockets\WebSocketConnectionStream.cs (31)
35Contract.Assert(connectStream != null, 37Contract.Assert(connectStream.Connection != null, 39Contract.Assert(connectStream.Connection.NetworkStream != null, 41Contract.Assert(!string.IsNullOrEmpty(connectionGroupName), 129Contract.Assert(false, "'bytesRead' MUST be '0' at this point. Instead more payload was received ('" + buffer[0].ToString() + "')"); 183Contract.Assert(this.m_ConnectStream.Connection.ServicePoint != null, "connection.ServicePoint should not be null."); 291Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 292Contract.Assert(!m_InOpaqueMode, "SwitchToOpaqueMode MUST NOT be called multiple times."); 315Contract.Assert(this.SupportsMultipleWrite, "This method MUST NOT be used for custom NetworkStream implementations."); 371Contract.Assert(state != null, "'state' MUST NOT be NULL."); 373Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 487Contract.Assert(connection != null, "'connection' MUST NOT be NULL."); 488Contract.Assert(connection.NetworkStream != null, "'connection.NetworkStream' MUST NOT be NULL."); 585Contract.Assert(m_InnerStream.NetworkStream != null, "'m_InnerStream.NetworkStream' MUST NOT be NULL."); 599Contract.Assert(sendBuffers != null, "'sendBuffers' MUST NOT be NULL."); 600Contract.Assert(asyncState != null, "'asyncState' MUST NOT be NULL."); 602Contract.Assert(connection != null, "'connection' MUST NOT be NULL."); 618Contract.Assert(asyncResult != null, "'asyncResult' MUST NOT be NULL."); 619Contract.Assert(asyncResult.AsyncState != null, "'asyncResult.AsyncState' MUST NOT be NULL."); 621Contract.Assert(connection != null, "'connection' MUST NOT be NULL."); 630Contract.Assert(this.SupportsMultipleWrite, "This method MUST NOT be used for custom NetworkStream implementations."); 768Contract.Assert(m_ReadEventArgs != null, "'m_ReadEventArgs' MUST NOT be NULL."); 832Contract.Assert(state != null, "'state' MUST NOT be NULL."); 834Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 868Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 869Contract.Assert(!m_InOpaqueMode, "SwitchToOpaqueMode MUST NOT be called multiple times."); 882Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 891Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 893Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 923Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 925Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL.");
net\System\Net\WebSockets\WebSocketHelpers.cs (1)
145Contract.Assert(responseStream != null, "'responseStream' MUST be castable to System.Net.HttpResponseStream.");
net\System\Net\WebSockets\WebSocketHttpListenerDuplexStream.cs (37)
55Contract.Assert(inputStream != null, "'inputStream' MUST NOT be NULL."); 56Contract.Assert(outputStream != null, "'outputStream' MUST NOT be NULL."); 57Contract.Assert(context != null, "'context' MUST NOT be NULL."); 58Contract.Assert(inputStream.CanRead, "'inputStream' MUST support read operations."); 59Contract.Assert(outputStream.CanWrite, "'outputStream' MUST support write operations."); 223Contract.Assert(eventArgs.Buffer != null, "'BufferList' is not supported for read operations."); 244Contract.Assert(!m_InputStream.BufferedDataChunksAvailable, "'m_InputStream.BufferedDataChunksAvailable' MUST BE 'FALSE' at this point."); 245Contract.Assert(dataRead <= eventArgs.Count, "'dataRead' MUST NOT be bigger than 'eventArgs.Count'."); 345Contract.Assert(m_InOpaqueMode, "The stream MUST be in opaque mode at this point."); 346Contract.Assert(sendBuffers != null, "'sendBuffers' MUST NOT be NULL."); 347Contract.Assert(sendBuffers.Count == 1 || sendBuffers.Count == 2, 361Contract.Assert(sendBuffers != null, "'sendBuffers' MUST NOT be NULL."); 362Contract.Assert(sendBuffers.Count == 2, "'sendBuffers.Count' MUST be '2' at this point."); 715Contract.Assert(state != null, "'state' MUST NOT be NULL."); 717Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 753Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 754Contract.Assert(m_OutputStream != null, "'m_OutputStream' MUST NOT be NULL."); 755Contract.Assert(m_OutputStream.InternalHttpContext != null, 757Contract.Assert(m_OutputStream.InternalHttpContext.Response != null, 759Contract.Assert(m_OutputStream.InternalHttpContext.Response.SentHeaders, 761Contract.Assert(!m_InOpaqueMode, "SwitchToOpaqueMode MUST NOT be called multiple times."); 783Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 785Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 813Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 815Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 902Contract.Assert(!m_ShouldCloseOutput, "'m_ShouldCloseOutput' MUST be 'false' at this point."); 903Contract.Assert(value == null || m_Buffer == null, 905Contract.Assert(m_Operating == Free, 907Contract.Assert(value == null || value.Count == 2, 1071Contract.Assert(false, "Only one outstanding async operation is allowed per HttpListenerAsyncEventArgs instance."); 1110Contract.Assert(!m_ShouldCloseOutput, "'m_ShouldCloseOutput' MUST be 'false' at this point."); 1111Contract.Assert(buffer == null || m_BufferList == null, "Either 'm_Buffer' or 'm_BufferList' MUST be NULL."); 1129Contract.Assert(m_Buffer == null || m_BufferList == null, "Either 'm_Buffer' or 'm_BufferList' MUST be NULL."); 1130Contract.Assert(m_ShouldCloseOutput || m_Buffer != null || m_BufferList != null, "Either 'm_Buffer' or 'm_BufferList' MUST NOT be NULL."); 1141Contract.Assert(m_BufferList != null && m_BufferList.Count == 2, 1149Contract.Assert(m_ShouldCloseOutput, "'m_ShouldCloseOutput' MUST be 'true' at this point."); 1237Contract.Assert(m_CompletedOperation == HttpListenerAsyncOperation.Send,
net\System\Net\WebSockets\WebSocketProtocolComponent.cs (31)
404Contract.Assert(version != null, "'version' MUST NOT be NULL."); 474Contract.Assert(key != null, "'key' MUST NOT be NULL."); 511Contract.Assert(webSocketHandle != null, "'webSocketHandle' MUST NOT be NULL at this point."); 519Contract.Assert(propertyCount >= 0, "'propertyCount' MUST NOT be negative."); 520Contract.Assert((properties == null && propertyCount == 0) || 566Contract.Assert(webSocketHandle != null, "'webSocketHandle' MUST NOT be NULL at this point."); 572Contract.Assert(webSocketHandle != null && !webSocketHandle.IsInvalid, 585Contract.Assert(webSocketPtr != IntPtr.Zero, "'webSocketPtr' MUST NOT be IntPtr.Zero."); 594Contract.Assert(webSocket != null, 596Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 618Contract.Assert(webSocket != null, 620Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 641Contract.Assert(webSocket != null, 643Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 670Contract.Assert(webSocket != null, 672Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 674Contract.Assert(dataBufferCount >= 0, "'dataBufferCount' MUST NOT be negative."); 675Contract.Assert((dataBuffers == null && dataBufferCount == 0) || 716Contract.Assert(webSocket != null, 718Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 720Contract.Assert(actionContext != IntPtr.Zero, "'actionContext' MUST NOT be IntPtr.Zero."); 721Contract.Assert(bytesTransferred >= 0, "'bytesTransferred' MUST NOT be negative."); 745Contract.Assert(errorCode == 0, "errorCode: " + errorCode); 753Contract.Assert(webSocketHandle != null && !webSocketHandle.IsInvalid, 776Contract.Assert(errorCode == 0, "'errorCode' MUST be 0."); 792Contract.Assert(httpHeaderPtr != IntPtr.Zero, "'currentHttpHeaderPtr' MUST NOT be IntPtr.Zero."); 797Contract.Assert(length >= 0, "'length' MUST NOT be negative."); 807Contract.Assert(false, "The length of 'httpHeader.Name' MUST MATCH 'length'."); 830Contract.Assert(false, "The length of 'httpHeader.Value' MUST MATCH 'length'."); 838Contract.Assert(nativeHeaderCount >= 0, "'nativeHeaderCount' MUST NOT be negative."); 839Contract.Assert(nativeHeadersPtr != IntPtr.Zero || nativeHeaderCount == 0,
net\System\Net\WebSockets\WebSocketReceiveResult.cs (2)
43Contract.Assert(count >= 0, "'count' MUST NOT be negative."); 44Contract.Assert(count <= this.Count, "'count' MUST NOT be bigger than 'this.Count'.");
parent\parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (2)
645Contract.Assert(addRefSuccess, "zlibLibraryHandle.DangerousAddRef in DeflateInit2_ should always succeed, but it did not."); 702Contract.Assert(addRefSuccess, "zlibLibraryHandle.DangerousAddRef in InflateInit2_ should always succeed, but it did not.");
sys\System\IO\compression\DeflaterZLib.cs (5)
136Contract.Assert(NeedsInput(), "We have something left in previous input!"); 159Contract.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 160Contract.Assert(!NeedsInput(), "GetDeflateOutput should only be called after providing input"); 194Contract.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 195Contract.Assert(NeedsInput(), "We have something left in previous input!");
sys\system\io\ports\SerialStream.cs (1)
821Contract.Assert(false, String.Format("Unexpected error code from EscapeCommFunction in SerialPort.Dispose(bool) Error code: 0x{0:x}", (uint)hr));
System.AddIn (14)
System\Addin\Hosting\ActivationWorker.cs (2)
132System.Diagnostics.Contracts.Contract.Assert(addIn != null, "CreateInstance didn't create the add-in"); 188System.Diagnostics.Contracts.Contract.Assert(addInAdapter != null, "CreateInstance didn't create the add-in adapter");
System\Addin\Hosting\AddInActivator.cs (2)
330System.Diagnostics.Contracts.Contract.Assert(addIn != null, "Bypass couldn't create the add-in"); 629System.Diagnostics.Contracts.Contract.Assert(false, "Did the AddIn Model upgrade the contract to the default loader context using an assembly resolve event? Either that, or your HAV's constructor threw an ArgumentException");
System\Addin\Hosting\AddInStore.cs (1)
1182System.Diagnostics.Contracts.Contract.Assert(false, "Fell through switch in Discover!");
System\Addin\Hosting\InspectionWorker.cs (2)
124System.Diagnostics.Contracts.Contract.Assert(false, "Fell through switch in the inspection assembly resolve event!"); 298System.Diagnostics.Contracts.Contract.Assert(false, "Fell through switch - unrecognized componentType in InspectionWorker.Inspect");
System\Addin\Hosting\Store\AddInAdapter.cs (1)
52System.Diagnostics.Contracts.Contract.Assert(type.Assembly.ReflectionOnly && IContractInReflectionLoaderContext.Assembly.ReflectionOnly,
System\Addin\Hosting\Store\PipelineComponent.cs (1)
192System.Diagnostics.Contracts.Contract.Assert(_haveSetRootDirectory, "You must set this component's root directory before getting an absolute path. Either call SetRootDirectory or use RelativeLocation instead.");
System\Addin\MiniReflection\MiniParameterInfo.cs (1)
116System.Diagnostics.Contracts.Contract.Assert(false, "Unrecognized CorElementType.");
System\Addin\MiniReflection\TypeInfo.cs (4)
465System.Diagnostics.Contracts.Contract.Assert(HasToken/* || HasReflectionType*/, "GetConstructors needs a token (or you should uncomment the support for Reflection types)"); 661System.Diagnostics.Contracts.Contract.Assert(false, "Unrecognized CorElementType"); 817System.Diagnostics.Contracts.Contract.Assert(false, "Checking whether a type implements a TypeSpec is NYI (generic interface?)"); 821System.Diagnostics.Contracts.Contract.Assert(false, "Support for this interface type is NYI");
System.Core (168)
System\Collections\Generic\HashSet.cs (2)
1011Contract.Assert(HashHelpers.IsPrime(newSize), "New size is not prime!"); 1013Contract.Assert(m_buckets != null, "SetCapacity called on a set with no elements");
System\IO\Pipes\IOCancellationHelper.cs (4)
32Contract.Assert(handle != null, "Handle cannot be null"); 33Contract.Assert(!handle.IsInvalid, "Handle cannot be invalid"); 34Contract.Assert(overlapped != null, "Overlapped cannot be null"); 35Contract.Assert(this._handle == null && this._overlapped == null, "Cancellation is already allowed.");
System\Linq\Parallel\Channels\AsynchronousChannel.cs (10)
118Contract.Assert(chunkSize > 0, "chunk size must be greater than 0"); 119Contract.Assert(capacity > 1, "this impl doesn't support capacity of 1 or 0"); 292Contract.Assert(!m_done, "can't continue producing after the production is over"); 296Contract.Assert(!IsFull, "expected a non-full buffer"); 421Contract.Assert(m_consumerChunk != null, "consumer chunk is null"); 422Contract.Assert(0 <= m_consumerChunkIndex && m_consumerChunkIndex < m_consumerChunk.Length, "chunk index out of bounds"); 499Contract.Assert(m_consumerChunk != null, "consumer chunk is null"); 500Contract.Assert(0 <= m_consumerChunkIndex && m_consumerChunkIndex < m_consumerChunk.Length, "chunk index out of bounds"); 592Contract.Assert(!IsChunkBufferEmpty, "single-consumer should never witness an empty queue here"); 669Contract.Assert(m_done, "Expected channel to be done before disposing");
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (2)
105Contract.Assert(default(T) != null || element.Second != null, "nulls unexpected in final reduce"); 122Contract.Assert(accumulator.First || default(T) == null,
System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs (1)
75Contract.Assert(wrappedEnumerable != null, "wrappedEnumerable must not be null.");
System\Linq\Parallel\Enumerables\ParallelQuery.cs (4)
54Contract.Assert(false, "The derived class must override this method."); 66Contract.Assert(false, "The derived class must override this method."); 78Contract.Assert(false, "The derived class must override this method."); 127Contract.Assert(false, "The derived class must override this method.");
System\Linq\Parallel\Enumerables\RepeatEnumerable.cs (1)
37Contract.Assert(count >= 0, "count not within range (must be >= 0)");
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (3)
156Contract.Assert(dequeueResult, "channel isn't empty, yet the dequeue failed, hmm"); 168Contract.Assert(m_channels[currChannelIndex].IsDone, "thought this channel was done"); 169Contract.Assert(m_channels[currChannelIndex].IsChunkBufferEmpty, "thought this channel was empty");
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (1)
91Contract.Assert(m_channelEnumerator != null, "enumerator can't be null if we're not ignoring output");
System\Linq\Parallel\Merging\MergeExecutor.cs (1)
60Contract.Assert(!ignoreOutput || options == ParallelMergeOptions.FullyBuffered, "@BUGBUG: pipelining w/ no output not supported -- need it?");
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (3)
174Contract.Assert(false, "An ordered pipelining merge is not intended to be used this way."); 372Contract.Assert(false, "QueryEnd() should have thrown an exception."); 415Contract.Assert(buffer.Count > 0, "Producer's buffer should not be empty here.");
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (3)
77Contract.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 78Contract.Assert(valueExchangeMatrix.GetLength(1) == partitionCount, "expected square matrix of buffers (NxN)"); 229Contract.Assert(0 <= destinationIndex && destinationIndex < m_partitionCount,
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (4)
79Contract.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 80Contract.Assert(valueExchangeMatrix.GetLength(1) == partitionCount, "expected square matrix of buffers (NxN)"); 154Contract.Assert(mutables.m_currentKeyBuffer != null, "expected same # of buffers/key-buffers"); 239Contract.Assert(0 <= destinationIndex && destinationIndex < m_partitionCount,
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (20)
245Contract.Assert(data != null, "data musn't be null"); 246Contract.Assert(partitionCount > 0, "partitionCount must be positive"); 247Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 248Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 249Contract.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 351Contract.Assert(data != null, "data musn't be null"); 352Contract.Assert(partitionCount > 0, "partitionCount must be positive"); 353Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 354Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 371Contract.Assert(m_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread"); 423Contract.Assert(data != null, "data musn't be null"); 424Contract.Assert(partitionCount > 0, "partitionCount must be positive"); 425Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 426Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 427Contract.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 529Contract.Assert(data != null, "data musn't be null"); 530Contract.Assert(partitionCount > 0, "partitionCount must be positive"); 531Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 532Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 549Contract.Assert(m_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread");
System\Linq\Parallel\Partitioning\PartitionedStream.cs (2)
62Contract.Assert(0 <= index && index < m_partitions.Length, "index out of bounds"); 69Contract.Assert(0 <= index && index < m_partitions.Length, "index out of bounds");
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (9)
85Contract.Assert(child != null, "child data source cannot be null"); 86Contract.Assert(intermediateReduce != null, "need an intermediate reduce function"); 87Contract.Assert(finalReduce != null, "need a final reduce function"); 88Contract.Assert(resultSelector != null, "need a result selector function"); 89Contract.Assert(Enum.IsDefined(typeof(QueryAggregationOptions), options), "enum out of valid range"); 90Contract.Assert((options & QueryAggregationOptions.Associative) == QueryAggregationOptions.Associative, "expected an associative operator"); 91Contract.Assert(typeof(TIntermediate) == typeof(TInput) || seedIsSpecified, "seed must be specified if TIntermediate differs from TInput"); 220Contract.Assert(false, "This method should never be called. Associative aggregation can always be parallelized."); 278Contract.Assert(m_reduceOperator.m_intermediateReduce != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (1)
38Contract.Assert(left != null && right != null, "child data sources cannot be null");
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (4)
49Contract.Assert(left != null && right != null, "child data sources cannot be null"); 50Contract.Assert(leftKeySelector != null, "left key selector must not be null"); 51Contract.Assert(rightKeySelector != null, "right key selector must not be null"); 52Contract.Assert(resultSelector != null, "need a result selector function");
System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs (2)
98Contract.Assert(m_singleResultSelector != null || m_groupResultSelector != null, "expected a compiled result selector"); 207Contract.Assert(mutables.m_currentRightMatches == null || mutables.m_currentRightMatches.Count > 0,
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (1)
37Contract.Assert(left != null && right != null, "child data sources cannot be null");
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (4)
65Contract.Assert(left != null && right != null, "child data sources cannot be null"); 66Contract.Assert(leftKeySelector != null, "left key selector must not be null"); 67Contract.Assert(rightKeySelector != null, "right key selector must not be null"); 68Contract.Assert(resultSelector != null, "need a result selector function");
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (1)
37Contract.Assert(left != null && right != null, "child data sources cannot be null");
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (1)
65Contract.Assert(resultSelector != null, "operator cannot be null");
System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs (1)
36Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs (1)
41Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs (1)
40Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs (2)
41Contract.Assert(child != null, "child data source cannot be null"); 150Contract.Assert(false, "This method should never be called. Associative aggregation can always be parallelized.");
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (1)
36Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs (1)
36Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs (1)
33Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs (1)
39Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs (1)
39Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs (1)
33Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs (1)
33Contract.Assert(sign == -1 || sign == 1, "invalid sign");
System\Linq\Parallel\QueryOperators\QueryResults.cs (2)
67Contract.Assert(false, "GetElement property is not supported by non-indexible query results"); 82Contract.Assert(false, "ElementsCount property is not supported by non-indexible query results");
System\Linq\Parallel\QueryOperators\QuerySettings.cs (1)
156Contract.Assert(topLevelCancellationTokenSource != null, "There should always be a top-level cancellation signal specified.");
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (3)
58Contract.Assert(child != null, "child data source cannot be null"); 59Contract.Assert(predicate != null, "need a predicate function"); 132Contract.Assert(false, "This method should never be called as it is an ending operator with LimitsParallelism=false.");
System\Linq\Parallel\QueryOperators\Unary\ConcatQueryOperator.cs (2)
46Contract.Assert(firstChild != null, "first child data source cannot be null"); 47Contract.Assert(secondChild != null, "second child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (2)
44Contract.Assert(child != null, "child data source cannot be null"); 119Contract.Assert(false, "This method should never be called as it is an ending operator with LimitsParallelism=false.");
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (1)
44Contract.Assert(child != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (1)
38Contract.Assert(source != null, "child data source cannot be null");
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (4)
44Contract.Assert(child != null, "child data source cannot be null"); 45Contract.Assert(index >= 0, "index can't be less than 0"); 106Contract.Assert(false, "This method should never be called as fallback to sequential is handled in Aggregate()."); 155Contract.Assert(!e.MoveNext(), "expected enumerator to be empty");
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (2)
43Contract.Assert(child != null, "child data source cannot be null"); 104Contract.Assert(false, "This method should never be called as fallback to sequential is handled in ParallelEnumerable.First().");
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (4)
39Contract.Assert(child != null, "child data source cannot be null"); 40Contract.Assert(elementAction != null, "need a function"); 108Contract.Assert(false, "AsSequentialQuery is not supported on ForAllOperator"); 154Contract.Assert(m_elementAction != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (3)
60Contract.Assert(child != null, "child data source cannot be null"); 61Contract.Assert(keySelector != null, "need a selector function"); 62Contract.Assert(elementSelector != null ||
System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs (3)
51Contract.Assert(child != null, "child data source cannot be null"); 52Contract.Assert(selector != null, "need a selector function"); 166Contract.Assert(m_selector != null, "expected a compiled selection function");
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (3)
50Contract.Assert(child != null, "child data source cannot be null"); 51Contract.Assert(predicate != null, "need a filter function"); 170Contract.Assert(m_predicate != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs (2)
44Contract.Assert(child != null, "child data source cannot be null"); 100Contract.Assert(false, "This method should never be called as fallback to sequential is handled in ParallelEnumerable.First().");
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (2)
45Contract.Assert(child != null, "child data source cannot be null"); 61Contract.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexible, "Don't take this code path if the child is indexible.");
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (6)
62Contract.Assert(leftChild != null, "left child data source cannot be null"); 63Contract.Assert(rightChildSelector != null || indexedRightChildSelector != null, 65Contract.Assert(rightChildSelector == null || indexedRightChildSelector == null, 67Contract.Assert(typeof(TRightInput) == typeof(TOutput) || resultSelector != null, 316Contract.Assert(m_currentRightSourceAsOutput == m_currentRightSource, 446Contract.Assert(m_currentRightSourceAsOutput == m_currentRightSource,
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (3)
46Contract.Assert(child != null, "child data source cannot be null"); 47Contract.Assert(selector != null, "need a selector function"); 125Contract.Assert(m_selector != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (2)
43Contract.Assert(child != null, "child data source cannot be null"); 81Contract.Assert(false, "This method should never be called as it is an ending operator with LimitsParallelism=false.");
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (3)
39Contract.Assert(keySelector != null, "key selector must not be null"); 213Contract.Assert(keySelector != null, "need a key comparer"); 214Contract.Assert(keyComparer != null, "expected a compiled operator");
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (3)
55Contract.Assert(child != null, "child data source cannot be null"); 93Contract.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexible, "Don't take this code path if the child is indexible."); 297Contract.Assert(m_count <= 0 || m_keyComparer.Compare(currentKey, minKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (3)
75Contract.Assert(child != null, "child data source cannot be null"); 76Contract.Assert(predicate != null || indexedPredicate != null, "need a predicate function"); 390Contract.Assert(m_keyComparer.Compare(currentKey, m_operatorState.m_currentLowKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (3)
45Contract.Assert(child != null, "child data source cannot be null"); 46Contract.Assert(predicate != null, "need a filter function"); 135Contract.Assert(m_predicate != null, "expected a compiled operator");
System\Linq\Parallel\Scheduling\QueryTask.cs (2)
66Contract.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 84Contract.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler.");
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
80Contract.Assert(rootTask != null, "Expected a non-null task"); 81Contract.Assert(m_rootTask == null, "Cannot begin a query more than once");
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
102Contract.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System\Linq\Parallel\Utils\Lookup.cs (1)
119Contract.Assert(m_defaultKeyGrouping == null, "Cannot insert two groupings with the default key into a lookup.");
System\Linq\Parallel\Utils\Sorting.cs (4)
200Contract.Assert(sourceValues != null, "values weren't populated"); 201Contract.Assert(sourceKeys != null, "keys weren't populated"); 581Contract.Assert(keys != null, "need a non-null keyset"); 605Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) sort failed - bogus IComparer?");
System\Linq\Parallel\Utils\TraceHelpers.cs (1)
149Contract.Assert(assertCondition, "NYI: " + message);
System\Linq\ParallelEnumerable.cs (3)
1583Contract.Assert(Enum.IsDefined(typeof(QueryAggregationOptions), options), "enum is out of range"); 5381Contract.Assert(queryOp != null, "expected query operator"); 5400Contract.Assert(!e.MoveNext(), "expected only a single element");
System.Numerics (1)
System\Numerics\BigIntegerBuilder.cs (1)
1059Contract.Assert(false, "Invalid call to ApplyBorrow");
System.ServiceModel (2)
System\ServiceModel\Configuration\ServiceModelConfigurationElement.cs (2)
24Contract.Assert(configurationProperty != null, "Parameter 'propertyName' should be the name of a configuration property of type T"); 25Contract.Assert(configurationProperty.Type.IsAssignableFrom(typeof(T)), "Parameter 'propertyName' should be the name of a configuration property of type T");
WindowsBase (2)
parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (2)
645Contract.Assert(addRefSuccess, "zlibLibraryHandle.DangerousAddRef in DeflateInit2_ should always succeed, but it did not."); 702Contract.Assert(addRefSuccess, "zlibLibraryHandle.DangerousAddRef in InflateInit2_ should always succeed, but it did not.");