From 8dffec24b9b496487141a41d664c8bdc34ae67c4 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 15 Feb 2019 21:09:47 +0100 Subject: [PATCH] Add SequenceOfNestedIfs test. --- .../ICSharpCode.Decompiler.Tests.csproj | 2 ++ .../ILPrettyTestRunner.cs | 6 ++++ .../ILPretty/SequenceOfNestedIfs.cs} | 32 +++++++------------ .../ILPretty}/SequenceOfNestedIfs.il | 0 4 files changed, 19 insertions(+), 21 deletions(-) rename ICSharpCode.Decompiler.Tests/{IL/SequenceOfNestedIfs.Output.cs => TestCases/ILPretty/SequenceOfNestedIfs.cs} (51%) rename ICSharpCode.Decompiler.Tests/{IL => TestCases/ILPretty}/SequenceOfNestedIfs.il (100%) diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index 3a09d8404..76c263b9b 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -75,7 +75,9 @@ + + diff --git a/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs index bc7af305e..9ffe2223e 100644 --- a/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs @@ -136,6 +136,12 @@ namespace ICSharpCode.Decompiler.Tests Run(); } + [Test] + public void SequenceOfNestedIfs() + { + Run(); + } + [Test] public void FSharpLoops_Debug() { diff --git a/ICSharpCode.Decompiler.Tests/IL/SequenceOfNestedIfs.Output.cs b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/SequenceOfNestedIfs.cs similarity index 51% rename from ICSharpCode.Decompiler.Tests/IL/SequenceOfNestedIfs.Output.cs rename to ICSharpCode.Decompiler.Tests/TestCases/ILPretty/SequenceOfNestedIfs.cs index 754d7dafd..4b404b118 100644 --- a/ICSharpCode.Decompiler.Tests/IL/SequenceOfNestedIfs.Output.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/SequenceOfNestedIfs.cs @@ -18,36 +18,26 @@ public class SequenceOfNestedIfs } public override void CreateMaterials() { - if (!this._clear) - { - if (!this.CheckShader()) - { + if (!_clear) { + if (!CheckShader()) { return; } - this._material = new Material(); + _material = new Material(); } - if (!this._material) - { - if (!this.CheckShader()) - { + if (!_material) { + if (!CheckShader()) { return; } - this._material = new Material(); + _material = new Material(); } - if (!this._material) - { - if (!this.CheckShader()) - { + if (!_material) { + if (!CheckShader()) { return; } - this._material = new Material(); + _material = new Material(); } - if (!this._material) - { - if (this.CheckShader()) - { - this._material = new Material(); - } + if (!_material && CheckShader()) { + _material = new Material(); } } } diff --git a/ICSharpCode.Decompiler.Tests/IL/SequenceOfNestedIfs.il b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/SequenceOfNestedIfs.il similarity index 100% rename from ICSharpCode.Decompiler.Tests/IL/SequenceOfNestedIfs.il rename to ICSharpCode.Decompiler.Tests/TestCases/ILPretty/SequenceOfNestedIfs.il