Browse Source

Commit first test case.

pull/1000/head
Siegfried Pammer 8 years ago
parent
commit
d412de58b9
  1. 6
      ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs
  2. 1
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  3. 24
      ICSharpCode.Decompiler.Tests/TestCases/Correctness/FloatingPointArithmetic.cs

6
ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs

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

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

@ -61,6 +61,7 @@ @@ -61,6 +61,7 @@
<Compile Include="TestCases\Correctness\ExpressionTrees.cs" />
<Compile Include="TestCases\Correctness\LINQRaytracer.cs" />
<Compile Include="TestCases\Correctness\MiniJSON.cs" />
<Compile Include="TestCases\Correctness\FloatingPointArithmetic.cs" />
<Compile Include="TestCases\ILPretty\Issue982.cs" />
<Compile Include="TestCases\Pretty\ExpressionTrees.cs" />
<Compile Include="TestCases\Pretty\VariableNaming.cs" />

24
ICSharpCode.Decompiler.Tests/TestCases/Correctness/FloatingPointArithmetic.cs

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
using System;
namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
class FloatingPointArithmetic
{
public static int Main(string[] args)
{
Issue999();
return 0;
}
static void Issue999()
{
for (float i = -10f; i <= 10f; i += 0.01f)
Console.WriteLine("{1:R}: {0:R}", M(i), i);
}
static float M(float v)
{
return 0.99f * v + 0.01f;
}
}
}
Loading…
Cancel
Save