Added filtering for vector generation to only produce valid vectors.
authorJarl Gullberg <jarl.gullberg@gmail.com>
Fri, 2 Jun 2017 18:32:16 +0000 (20:32 +0200)
committerJarl Gullberg <jarl.gullberg@gmail.com>
Fri, 2 Jun 2017 18:32:16 +0000 (20:32 +0200)
tests/OpenTK.Tests/Generators.fs

index cbcdd92..39200f5 100644 (file)
@@ -22,18 +22,21 @@ module private Generators =
         singleArb
         |> Gen.two
         |> Gen.map Vector2
+        |> Gen.filter (fun v -> not <| (Single.IsNaN v.Length || Single.IsInfinity v.Length ))
         |> Arb.fromGen
 
     let vec3 =
         singleArb
         |> Gen.three
         |> Gen.map Vector3
+        |> Gen.filter (fun v -> not <| (Single.IsNaN v.Length || Single.IsInfinity v.Length ))
         |> Arb.fromGen
 
     let vec4 =
         singleArb
         |> Gen.four
         |> Gen.map Vector4
+        |> Gen.filter (fun v -> not <| (Single.IsNaN v.Length || Single.IsInfinity v.Length ))
         |> Arb.fromGen
 
     let quat =