Browse Source

Update tests (remove unnecessary casts)

pull/847/head
Siegfried Pammer 8 years ago
parent
commit
5c1d39e56f
  1. 21
      ICSharpCode.Decompiler.Tests/TestCases/Correctness/OverloadResolution.cs
  2. 3
      ICSharpCode.Decompiler.Tests/TestCases/Correctness/UndocumentedExpressions.cs
  3. 2
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.cs
  4. 10
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.il
  5. 10
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.opt.il
  6. 10
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/InlineAssignmentTest.cs

21
ICSharpCode.Decompiler.Tests/TestCases/Correctness/OverloadResolution.cs

@ -32,8 +32,29 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness @@ -32,8 +32,29 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
TestBoxing();
TestIssue180();
TestExtensionMethod();
TestParamsMethod();
}
#region params with nulls
static void TestParamsMethod()
{
TestCall(1, null, (TypeAccessException)null);
TestCall(2, null, (AccessViolationException)null);
TestCall(3, null);
TestCall(3, null, null, null);
}
static void TestCall(int v, Type p1, TypeAccessException p2)
{
Console.WriteLine("TestCall without params");
}
static void TestCall(int v, params AccessViolationException[] p2)
{
Console.WriteLine("TestCall with params: " + (p2 == null ? "null" : p2.Length.ToString()));
}
#endregion
#region Simple Overloaded Method
static void CallOverloadedMethod()
{

3
ICSharpCode.Decompiler.Tests/TestCases/Correctness/UndocumentedExpressions.cs

@ -28,6 +28,9 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness @@ -28,6 +28,9 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
VarArgs(1, __arglist());
VarArgs(__arglist(1));
VarArgs(1, __arglist("abc", 2, true));
VarArgs(1, __arglist((object)"abc", 2, true));
VarArgs(1, __arglist((short)1));
VarArgs(1, __arglist(ConsoleColor.Red));
}
public static void VarArgs(int normalArg, __arglist)

2
ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.cs

@ -34,7 +34,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -34,7 +34,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Y = 10
};
Console.WriteLine((object)value);
Console.WriteLine(value);
Console.WriteLine(anon.X);
Console.WriteLine(anon2.Y + anon2.X);
}

10
ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.il

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0
}
.assembly tnrrn5wg
.assembly d3qdmgj3
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
@ -20,15 +20,15 @@ @@ -20,15 +20,15 @@
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module tnrrn5wg.dll
// MVID: {4CFFCB16-C703-47F9-8F30-8478576835EE}
.module d3qdmgj3.dll
// MVID: {580C0EC8-1048-4E5F-8BCB-8AF6994DA5B8}
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 )
.imagebase 0x10000000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x00C20000
// Image base: 0x017F0000
// =============== CLASS MEMBERS DECLARATION ===================
@ -839,4 +839,4 @@ @@ -839,4 +839,4 @@
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file ../../Tests/TestCases/Pretty\AnonymousTypes.res
// WARNING: Created Win32 resource file ../../../../ICSharpCode.Decompiler.Tests/TestCases/Pretty\AnonymousTypes.res

10
ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.opt.il

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0
}
.assembly v2lmiatb
.assembly p4ukdvbx
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
@ -20,15 +20,15 @@ @@ -20,15 +20,15 @@
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module v2lmiatb.dll
// MVID: {9A262681-84DA-450E-9AED-ABEF96981900}
.module p4ukdvbx.dll
// MVID: {C064CB4C-9883-4210-817E-890107A546DE}
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 )
.imagebase 0x10000000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x030F0000
// Image base: 0x026B0000
// =============== CLASS MEMBERS DECLARATION ===================
@ -735,4 +735,4 @@ @@ -735,4 +735,4 @@
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file ../../Tests/TestCases/Pretty\AnonymousTypes.opt.res
// WARNING: Created Win32 resource file ../../../../ICSharpCode.Decompiler.Tests/TestCases/Pretty\AnonymousTypes.opt.res

10
ICSharpCode.Decompiler.Tests/TestCases/Pretty/InlineAssignmentTest.cs

@ -32,22 +32,22 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -32,22 +32,22 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Console.WriteLine(value = 5);
Console.WriteLine(value);
InlineAssignmentTest value2;
Console.WriteLine((object)(value2 = new InlineAssignmentTest()));
Console.WriteLine((object)value2);
Console.WriteLine(value2 = new InlineAssignmentTest());
Console.WriteLine(value2);
}
public void SimpleInlineWithFields()
{
Console.WriteLine(this.field1 = 5);
Console.WriteLine((object)(InlineAssignmentTest.field2 = new InlineAssignmentTest()));
Console.WriteLine(InlineAssignmentTest.field2 = new InlineAssignmentTest());
}
public void SimpleInlineWithFields2()
{
Console.WriteLine(this.field1 = 5);
Console.WriteLine(this.field1);
Console.WriteLine((object)(InlineAssignmentTest.field2 = new InlineAssignmentTest()));
Console.WriteLine((object)InlineAssignmentTest.field2);
Console.WriteLine(InlineAssignmentTest.field2 = new InlineAssignmentTest());
Console.WriteLine(InlineAssignmentTest.field2);
}
// public void ReadLoop1(TextReader r)

Loading…
Cancel
Save