Browse Source

Include UndocumentedExpressions.cs in unit tests.

pull/150/head
Daniel Grunwald 15 years ago
parent
commit
6501104f6d
  1. 12
      ICSharpCode.Decompiler/Tests/CheckedUnchecked.cs
  2. 28
      ICSharpCode.Decompiler/Tests/TestRunner.cs
  3. 2
      ICSharpCode.Decompiler/Tests/UndocumentedExpressions.cs

12
ICSharpCode.Decompiler/Tests/CheckedUnchecked.cs

@ -28,8 +28,10 @@ public class CheckedUnchecked @@ -28,8 +28,10 @@ public class CheckedUnchecked
public void ForWithCheckedIteratorAndUncheckedBody(int n)
{
checked {
for (int i = n + 1; i < n + 1; i++) {
checked
{
for (int i = n + 1; i < n + 1; i++)
{
n = unchecked(i * i);
}
}
@ -37,9 +39,11 @@ public class CheckedUnchecked @@ -37,9 +39,11 @@ public class CheckedUnchecked
public void ForWithCheckedInitializerAndUncheckedIterator(int n)
{
checked {
checked
{
int i = n;
for (i -= 10; i < n; i = unchecked(i + 1)) {
for (i -= 10; i < n; i = unchecked(i + 1))
{
n--;
}
}

28
ICSharpCode.Decompiler/Tests/TestRunner.cs

@ -19,6 +19,12 @@ namespace ICSharpCode.Decompiler.Tests @@ -19,6 +19,12 @@ namespace ICSharpCode.Decompiler.Tests
[TestFixture]
public class TestRunner
{
[Test, Ignore("disambiguating overloads is not yet implemented")]
public void CallOverloadedMethod()
{
TestFile(@"..\..\Tests\CallOverloadedMethod.cs");
}
[Test, Ignore("unncessary primitive casts")]
public void CheckedUnchecked()
{
@ -31,7 +37,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -31,7 +37,7 @@ namespace ICSharpCode.Decompiler.Tests
TestFile(@"..\..\Tests\DelegateConstruction.cs");
}
[Test, Ignore("bug with variable-less catch")]
[Test, Ignore("arg-Variables in catch clauses")]
public void ExceptionHandling()
{
TestFile(@"..\..\Tests\ExceptionHandling.cs");
@ -73,12 +79,24 @@ namespace ICSharpCode.Decompiler.Tests @@ -73,12 +79,24 @@ namespace ICSharpCode.Decompiler.Tests
TestFile(@"..\..\Tests\PropertiesAndEvents.cs");
}
[Test, Ignore]
[Test, Ignore("Formatting differences in anonymous method create expressions")]
public void QueryExpressions()
{
TestFile(@"..\..\Tests\QueryExpressions.cs");
}
[Test, Ignore("switch transform is currently broken")]
public void Switch()
{
TestFile(@"..\..\Tests\Switch.cs");
}
[Test]
public void UndocumentedExpressions()
{
TestFile(@"..\..\Tests\UndocumentedExpressions.cs");
}
[Test, Ignore("has incorrect casts to IntPtr")]
public void UnsafeCode()
{
@ -97,12 +115,6 @@ namespace ICSharpCode.Decompiler.Tests @@ -97,12 +115,6 @@ namespace ICSharpCode.Decompiler.Tests
TestFile(@"..\..\Tests\YieldReturn.cs");
}
[Test, Ignore("Formatting differences")]
public void QueryExpressions()
{
TestFile(@"..\..\Tests\QueryExpressions.cs");
}
static void TestFile(string fileName)
{
string code = File.ReadAllText(fileName);

2
ICSharpCode.Decompiler/Tests/UndocumentedExpressions.cs

@ -17,7 +17,7 @@ public class UndocumentedExpressions @@ -17,7 +17,7 @@ public class UndocumentedExpressions
UndocumentedExpressions.AcceptTypedRef(tr);
}
static void AcceptTypedRef(TypedReference tr)
private static void AcceptTypedRef(TypedReference tr)
{
Console.WriteLine("Value is: " + __refvalue(tr, object).ToString());
Console.WriteLine("Type is: " + __reftype(tr).Name);

Loading…
Cancel
Save