Browse Source

Add test case for #1304.

pull/1295/head
Daniel Grunwald 7 years ago
parent
commit
4e9121bd28
  1. 13
      ICSharpCode.Decompiler.Tests/TestCases/Correctness/Loops.cs
  2. 2
      ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue959.cs

13
ICSharpCode.Decompiler.Tests/TestCases/Correctness/Loops.cs

@ -79,6 +79,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
Console.WriteLine(NoForeachDueToMultipleCurrentAccess(new List<int> { 1, 2, 3, 4, 5 })); Console.WriteLine(NoForeachDueToMultipleCurrentAccess(new List<int> { 1, 2, 3, 4, 5 }));
Console.WriteLine(NoForeachCallWithSideEffect(new CustomClassEnumeratorWithIDisposable<int>())); Console.WriteLine(NoForeachCallWithSideEffect(new CustomClassEnumeratorWithIDisposable<int>()));
LoopWithGotoRepeat(); LoopWithGotoRepeat();
Console.WriteLine("LoopFollowedByIf: {0}", LoopFollowedByIf());
} }
public static void ForWithMultipleVariables() public static void ForWithMultipleVariables()
@ -246,5 +247,17 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
} }
Console.WriteLine("after finally"); Console.WriteLine("after finally");
} }
private static int LoopFollowedByIf()
{
int num = 0;
while (num == 0) {
num++;
}
if (num == 0) {
return -1;
}
return num;
}
} }
} }

2
ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue959.cs

@ -4,7 +4,7 @@
{ {
public void Test(bool arg) public void Test(bool arg)
{ {
switch (arg) { if (!arg && arg) {
} }
} }

Loading…
Cancel
Save