Browse Source

Buildfix: disable Fibonacci tests where not available (pcl, 3.5).

pull/297/head
Christoph Ruegg 12 years ago
parent
commit
14ec5a392b
  1. 6
      build.fsx
  2. 18
      src/UnitTests/GenerateTests.cs

6
build.fsx

@ -380,7 +380,7 @@ let test target =
NUnit (fun p ->
{ p with
DisableShadowCopy = true
TimeOut = TimeSpan.FromMinutes 30.
TimeOut = TimeSpan.FromMinutes 60.
OutputFile = "TestResults.xml" } |> quick) target
Target "Test" (fun _ -> test !! "out/test/**/*UnitTests*.dll")
@ -392,7 +392,7 @@ Target "MklWin32Test" (fun _ ->
{ p with
ToolName = "nunit-console-x86.exe"
DisableShadowCopy = true
TimeOut = TimeSpan.FromMinutes 30.
TimeOut = TimeSpan.FromMinutes 60.
OutputFile = "TestResults.xml" }))
Target "MklWin64Test" (fun _ ->
ActivateFinalTarget "CloseTestRunner"
@ -401,7 +401,7 @@ Target "MklWin64Test" (fun _ ->
{ p with
ToolName = "nunit-console.exe"
DisableShadowCopy = true
TimeOut = TimeSpan.FromMinutes 30.
TimeOut = TimeSpan.FromMinutes 60.
OutputFile = "TestResults.xml" }))
Target "MklWinTest" DoNothing

18
src/UnitTests/GenerateTests.cs

@ -30,11 +30,14 @@
using System;
using System.Linq;
using System.Numerics;
using NUnit.Framework;
namespace MathNet.Numerics.UnitTests
{
#if !NOSYSNUMERICS
using System.Numerics;
#endif
[TestFixture]
public class GenerateTests
{
@ -223,10 +226,12 @@ namespace MathNet.Numerics.UnitTests
public void UnfoldConsistentWithSequence()
{
Assert.That(
Generate.UnfoldSequence((s => Tuple.Create(s + 1, s + 1)), 0).Take(250).ToArray(),
Is.EqualTo(Generate.Unfold(250, (s => Tuple.Create(s + 1, s + 1)), 0)).AsCollection);
Generate.UnfoldSequence((s => new Tuple<int, int>(s + 1, s + 1)), 0).Take(250).ToArray(),
Is.EqualTo(Generate.Unfold(250, (s => new Tuple<int, int>(s + 1, s + 1)), 0)).AsCollection);
}
#if !NOSYSNUMERICS
[Test]
public void FibonacciConsistentWithSequence()
{
@ -243,8 +248,11 @@ namespace MathNet.Numerics.UnitTests
Is.EqualTo(new[] { BigInteger.Zero, BigInteger.One }.Concat(Generate.Unfold(248, (s =>
{
var z = s.Item1 + s.Item2;
return Tuple.Create(z, Tuple.Create(s.Item2, z));
}), Tuple.Create(BigInteger.Zero, BigInteger.One)))).AsCollection);
return new Tuple<BigInteger, Tuple<BigInteger, BigInteger>>(z, new Tuple<BigInteger, BigInteger>(s.Item2, z));
}), new Tuple<BigInteger, BigInteger>(BigInteger.Zero, BigInteger.One)))).AsCollection);
}
#endif
}
}

Loading…
Cancel
Save