Browse Source

Add test case for constant 2147483648. Closes #609.

pull/863/head
Daniel Grunwald 8 years ago
parent
commit
eb4ab74b8e
  1. 6
      ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs
  2. 1
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  3. 50
      ICSharpCode.Decompiler.Tests/TestCases/Correctness/TrickyTypes.cs

6
ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs

@ -156,6 +156,12 @@ namespace ICSharpCode.Decompiler.Tests @@ -156,6 +156,12 @@ namespace ICSharpCode.Decompiler.Tests
RunCS(options: options);
}
[Test]
public void TrickyTypes([ValueSource("defaultOptions")] CompilerOptions options)
{
RunCS(options: options);
}
[Test]
public void Capturing([ValueSource("defaultOptions")] CompilerOptions options)
{

1
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

@ -56,6 +56,7 @@ @@ -56,6 +56,7 @@
<Compile Include="Helpers\TypeSystemHelper.cs" />
<Compile Include="ILPrettyTestRunner.cs" />
<Compile Include="Stub.cs" />
<Compile Include="TestCases\Correctness\TrickyTypes.cs" />
<Compile Include="TestCases\ILPretty\Issue379.cs" />
<Compile Include="TestCases\Pretty\LiftedOperators.cs" />
<Compile Include="PrettyTestRunner.cs" />

50
ICSharpCode.Decompiler.Tests/TestCases/Correctness/TrickyTypes.cs

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
// Copyright (c) 2017 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
class TrickyTypes
{
static void Main()
{
InterestingConstants();
}
static void Print<T>(T val)
{
Console.Write(typeof(T).Name + ": ");
if (val == null)
Console.WriteLine("null");
else
Console.WriteLine(val);
}
static void InterestingConstants()
{
long val1 = 2147483648L;
uint val2 = 2147483648u;
Console.WriteLine("InterestingConstants:");
Print(val1);
Print(2147483648L);
Print(val2);
Print(2147483648u);
}
}
}
Loading…
Cancel
Save