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
case false: case false:
return bool.FalseString; return bool.FalseString;
default: default:
#pragma warning disable CS0162
return null; return null;
#pragma warning restore CS0162
} }
} }

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

@ -33,6 +33,7 @@ namespace LocalFunctions
{ {
public int MixedLocalFunction<T2>() where T2 : ICloneable, IConvertible public int MixedLocalFunction<T2>() where T2 : ICloneable, IConvertible
{ {
#pragma warning disable CS0219
T2 t2 = default(T2); T2 t2 = default(T2);
object z = this; object z = this;
for (int j = 0; j < 10; j++) { for (int j = 0; j < 10; j++) {
@ -107,6 +108,7 @@ namespace LocalFunctions
return k; return k;
} }
} }
#pragma warning restore CS0219
} }
public int MixedLocalFunction2Delegate<T2>() where T2 : ICloneable, IConvertible public int MixedLocalFunction2Delegate<T2>() where T2 : ICloneable, IConvertible
@ -199,6 +201,7 @@ namespace LocalFunctions
public static void Test_CaptureT<T2>() public static void Test_CaptureT<T2>()
{ {
#pragma warning disable CS0219
T2 t2 = default(T2); T2 t2 = default(T2);
Method1<int>(); Method1<int>();
void Method1<T3>() void Method1<T3>()
@ -214,6 +217,7 @@ namespace LocalFunctions
t3 = default(T3); t3 = default(T3);
} }
} }
#pragma warning restore CS0219
} }
public void TestGenericArgs<T2>() where T2 : List<T2> 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
private void Issue1881() private void Issue1881()
{ {
#pragma warning disable CS0219
MyEnum enumLocal1 = MyEnum.VALUE1; MyEnum enumLocal1 = MyEnum.VALUE1;
MyEnum enumLocal2 = (MyEnum)0; MyEnum enumLocal2 = (MyEnum)0;
enumLocal2 = MyEnum.VALUE1; enumLocal2 = MyEnum.VALUE1;
@ -56,6 +57,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
ValueType enumLocal5 = MyEnum.VALUE1; ValueType enumLocal5 = MyEnum.VALUE1;
ValueType enumLocal6 = (MyEnum)0; ValueType enumLocal6 = (MyEnum)0;
enumLocal6 = MyEnum.VALUE2; enumLocal6 = MyEnum.VALUE2;
#pragma warning restore CS0219
} }
#endif #endif
} }

Loading…
Cancel
Save