Browse Source

Add more tests

pull/1165/head
Siegfried Pammer 7 years ago
parent
commit
51e0aab6c8
  1. 47
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs
  2. 2641
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.il
  3. 2596
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.il
  4. 2391
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.roslyn.il
  5. 2444
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.roslyn.il

47
ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs

@ -6,6 +6,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
internal class DynamicTests internal class DynamicTests
{ {
private static dynamic field; private static dynamic field;
private static object objectField;
public dynamic Property { public dynamic Property {
get; get;
set; set;
@ -33,6 +34,52 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
a.Setter2 = 5; a.Setter2 = 5;
} }
private static void RequiredCasts()
{
((dynamic)objectField).A = 5;
((dynamic)objectField).B += 5;
((dynamic)objectField).Call();
((object)field).ToString();
field.Call("Hello World");
field.Call((object)"Hello World");
field.Call((dynamic)"Hello World");
}
private static void DynamicCallWithString()
{
field.Call("Hello World");
}
private static void DynamicCallWithNamedArgs()
{
field.Call(a: "Hello World");
}
private static void DynamicCallWithRefOutArg(int a, out int b)
{
field.Call(ref a, out b);
}
private static void DynamicCallWithStringCastToObj()
{
field.Call((object)"Hello World");
}
private static void DynamicCallWithStringCastToDynamic()
{
field.Call((dynamic)"Hello World");
}
private static void DynamicCallWithStringCastToDynamic2()
{
field.Call((dynamic)"Hello World", (int)5, null);
}
private static void DynamicCallWithStringCastToDynamic3()
{
field.Call((dynamic)"Hello World", 5u, (dynamic)null);
}
private static void Invocation(dynamic a, dynamic b) private static void Invocation(dynamic a, dynamic b)
{ {
a(null, b.Test()); a(null, b.Test());

2641
ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.il

File diff suppressed because it is too large Load Diff

2596
ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.il

File diff suppressed because it is too large Load Diff

2391
ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.roslyn.il

File diff suppressed because it is too large Load Diff

2444
ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.roslyn.il

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save