Browse Source

Fix warnings in test cases

pull/2126/head
Siegfried Pammer 5 years ago
parent
commit
1a3e70b60a
  1. 2
      ICSharpCode.Decompiler.Tests/TestCases/Correctness/Switch.cs
  2. 4
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs
  3. 2
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/VariableNaming.cs

2
ICSharpCode.Decompiler.Tests/TestCases/Correctness/Switch.cs

@ -169,7 +169,9 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness @@ -169,7 +169,9 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
case false:
return bool.FalseString;
default:
#pragma warning disable CS0162
return null;
#pragma warning restore CS0162
}
}

4
ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs

@ -33,6 +33,7 @@ namespace LocalFunctions @@ -33,6 +33,7 @@ namespace LocalFunctions
{
public int MixedLocalFunction<T2>() where T2 : ICloneable, IConvertible
{
#pragma warning disable CS0219
T2 t2 = default(T2);
object z = this;
for (int j = 0; j < 10; j++) {
@ -107,6 +108,7 @@ namespace LocalFunctions @@ -107,6 +108,7 @@ namespace LocalFunctions
return k;
}
}
#pragma warning restore CS0219
}
public int MixedLocalFunction2Delegate<T2>() where T2 : ICloneable, IConvertible
@ -199,6 +201,7 @@ namespace LocalFunctions @@ -199,6 +201,7 @@ namespace LocalFunctions
public static void Test_CaptureT<T2>()
{
#pragma warning disable CS0219
T2 t2 = default(T2);
Method1<int>();
void Method1<T3>()
@ -214,6 +217,7 @@ namespace LocalFunctions @@ -214,6 +217,7 @@ namespace LocalFunctions
t3 = default(T3);
}
}
#pragma warning restore CS0219
}
public void TestGenericArgs<T2>() where T2 : List<T2>

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

@ -47,6 +47,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -47,6 +47,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
private void Issue1881()
{
#pragma warning disable CS0219
MyEnum enumLocal1 = MyEnum.VALUE1;
MyEnum enumLocal2 = (MyEnum)0;
enumLocal2 = MyEnum.VALUE1;
@ -56,6 +57,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -56,6 +57,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
ValueType enumLocal5 = MyEnum.VALUE1;
ValueType enumLocal6 = (MyEnum)0;
enumLocal6 = MyEnum.VALUE2;
#pragma warning restore CS0219
}
#endif
}

Loading…
Cancel
Save