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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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");