Browse Source

CodeCoverage: Remove Debug assertions

By ccrewrite inserted alien SequencePoints
GetText() receives lots of invalid calls
pull/335/head
Dragan 12 years ago
parent
commit
fc96ea3adf
  1. 22
      src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageStringTextSource.cs

22
src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageStringTextSource.cs

@ -104,9 +104,10 @@ namespace ICSharpCode.CodeCoverage
#region One-Line request #region One-Line request
line = GetLine(Line); line = GetLine(Line);
Debug.Assert(!(Column < 1), "Column < 1"); //Debug.Assert(!(Column < 1), "Column < 1");
Debug.Assert(!(Column > EndColumn), "Column > EndColumn"); //Debug.Assert(!(Column > EndColumn), "Column > EndColumn");
Debug.Assert(!(EndColumn > line.Length), "EndColumn > line.Length"); //Debug.Assert(!(EndColumn > line.Length + 1), string.Format ("Single Line EndColumn({0}) > line.Length({1})",EndColumn, line.Length ));
//Debug.Assert(!(EndColumn > line.Length + 1), line);
argOutOfRange = Column < 1 argOutOfRange = Column < 1
|| Column > EndColumn || Column > EndColumn
@ -123,12 +124,11 @@ namespace ICSharpCode.CodeCoverage
#region First line #region First line
line = GetLine(Line); line = GetLine(Line);
Debug.Assert(!(Column < 1), "Column < 1"); //Debug.Assert(!(Column < 1), "Column < 1");
Debug.Assert(!(Column > line.Length), "Column > line.Length"); //Debug.Assert(!(Column > line.Length), string.Format ("First MultiLine EndColumn({0}) > line.Length({1})",EndColumn, line.Length ));
argOutOfRange = Column < 1 argOutOfRange = Column < 1
|| Column > line.Length; || Column > line.Length;
if (!argOutOfRange) { if (!argOutOfRange) {
text.Append(line.Substring(Column-1)); text.Append(line.Substring(Column-1));
} }
@ -143,8 +143,8 @@ namespace ICSharpCode.CodeCoverage
#region Last line #region Last line
line = GetLine(EndLine); line = GetLine(EndLine);
Debug.Assert(!(EndColumn < 1), "EndColumn < 1"); //Debug.Assert(!(EndColumn < 1), "EndColumn < 1");
Debug.Assert(!(EndColumn > line.Length), "EndColumn > line.Length"); //Debug.Assert(!(EndColumn > line.Length), string.Format ("Last MultiLine EndColumn({0}) > line.Length({1})",EndColumn, line.Length ));
argOutOfRange = EndColumn < 1 argOutOfRange = EndColumn < 1
|| EndColumn > line.Length; || EndColumn > line.Length;
@ -156,7 +156,7 @@ namespace ICSharpCode.CodeCoverage
#endregion #endregion
} else { } else {
Debug.Fail("Line > EndLine"); //Debug.Fail("Line > EndLine");
} }
return text.ToString(); return text.ToString();
} }
@ -169,7 +169,7 @@ namespace ICSharpCode.CodeCoverage
/// <summary>Return SequencePoint enumerated line /// <summary>Return SequencePoint enumerated line
/// </summary> /// </summary>
/// <param name="lineNr"></param> /// <param name="LineNo"></param>
/// <returns></returns> /// <returns></returns>
public string GetLine ( int LineNo ) { public string GetLine ( int LineNo ) {
@ -179,7 +179,7 @@ namespace ICSharpCode.CodeCoverage
lineInfo lineInfo = lines[LineNo-1]; lineInfo lineInfo = lines[LineNo-1];
retString = textSource.Substring(lineInfo.Offset, lineInfo.Length); retString = textSource.Substring(lineInfo.Offset, lineInfo.Length);
} else { } else {
Debug.Fail( "Line number out of range" ); //Debug.Fail( "Line number out of range" );
} }
return retString; return retString;

Loading…
Cancel
Save