From: Jarl Gullberg Date: Thu, 1 Jun 2017 20:09:04 +0000 (+0200) Subject: Removed fake casts. X-Git-Tag: v3.0.0~107^2~1^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c4ef39c92c340de8147d7bd91676fbf9e890351;p=platform%2Fcore%2Fcsapi%2Fopentk.git Removed fake casts. --- diff --git a/tests/OpenTK.Tests/Matrix4Tests.fs b/tests/OpenTK.Tests/Matrix4Tests.fs index 52b5d6b..a025d7e 100644 --- a/tests/OpenTK.Tests/Matrix4Tests.fs +++ b/tests/OpenTK.Tests/Matrix4Tests.fs @@ -42,22 +42,22 @@ module Matrix4 = Assert.Equal(a, A.M11) Assert.Equal(b, A.M12) Assert.Equal(c, A.M13) - Assert.Equal((float32)0, A.M14) + Assert.Equal(0.0f, A.M14) Assert.Equal(d, A.M21) Assert.Equal(e, A.M22) Assert.Equal(f, A.M23) - Assert.Equal((float32)0, A.M24) + Assert.Equal(0.0f, A.M24) Assert.Equal(g, A.M31) Assert.Equal(h, A.M32) Assert.Equal(i, A.M33) - Assert.Equal((float32)0, A.M34) + Assert.Equal(0.0f, A.M34) - Assert.Equal((float32)0, A.M41) - Assert.Equal((float32)0, A.M42) - Assert.Equal((float32)0, A.M43) - Assert.Equal((float32)1, A.M44) + Assert.Equal(0.0f, A.M41) + Assert.Equal(0.0f, A.M42) + Assert.Equal(0.0f, A.M43) + Assert.Equal(1.0f, A.M44) [] let ``Four-vector4 constructor sets all components to the correct values`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = diff --git a/tests/OpenTK.Tests/Vector2Tests.fs b/tests/OpenTK.Tests/Vector2Tests.fs index adb4ab7..0bf0b30 100644 --- a/tests/OpenTK.Tests/Vector2Tests.fs +++ b/tests/OpenTK.Tests/Vector2Tests.fs @@ -318,7 +318,7 @@ module Vector2 = [] let ``Vector inequality operator is by component`` (x, y) = let v1 = Vector2(x, y) - let v2 = Vector2(x + (float32)1 , y + (float32)1) + let v2 = Vector2(x + 1.0f , y + 1.0f) let inequality = v1 <> v2 Assert.True(inequality) @@ -556,7 +556,7 @@ module Vector2 = // [] let ``Transformation by quaternion is the same as multiplication by quaternion and its conjugate`` (v : Vector2, q : Quaternion) = - let vectorQuat = Quaternion(v.X, v.Y, (float32)0, (float32)0) + let vectorQuat = Quaternion(v.X, v.Y, 0.0f, 0.0f) let inverse = Quaternion.Invert(q) let transformedQuat = q * vectorQuat * inverse @@ -566,7 +566,7 @@ module Vector2 = [] let ``Transformation by quaternion by reference is the same as multiplication by quaternion and its conjugate`` (v : Vector2, q : Quaternion) = - let vectorQuat = Quaternion(v.X, v.Y, (float32)0, (float32)0) + let vectorQuat = Quaternion(v.X, v.Y, 0.0f, 0.0f) let inverse = Quaternion.Invert(q) let transformedQuat = q * vectorQuat * inverse diff --git a/tests/OpenTK.Tests/Vector3Tests.fs b/tests/OpenTK.Tests/Vector3Tests.fs index 2d5b3ca..14cf042 100644 --- a/tests/OpenTK.Tests/Vector3Tests.fs +++ b/tests/OpenTK.Tests/Vector3Tests.fs @@ -37,7 +37,7 @@ module Vector3 = Assert.Equal(a, v2.X) Assert.Equal(b, v2.Y) - Assert.Equal((float32)0, v2.Z) + Assert.Equal(0.0f, v2.Z) [] let ``Vector3 value constructor sets all components to the correct values`` (a, b, c) = @@ -413,7 +413,7 @@ module Vector3 = [] let ``Vector inequality operator is by component`` (x, y, z) = let v1 = Vector3(x, y, z) - let v2 = Vector3(x + (float32)1 , y + (float32)1, z + (float32)1) + let v2 = Vector3(x + 1.0f , y + 1.0f, z + 1.0f) let inequality = v1 <> v2 Assert.True(inequality) @@ -660,25 +660,25 @@ module Vector3 = // [] let ``Unit X is correct`` = - let unitX = Vector3((float32)1, (float32)0, (float32)0) + let unitX = Vector3(1.0f, 0.0f, 0.0f) Assert.Equal(Vector3.UnitX, unitX) [] let ``Unit Y is correct`` = - let unitY = Vector3((float32)0, (float32)1, (float32)0) + let unitY = Vector3(0.0f, 1.0f, 0.0f) Assert.Equal(Vector3.UnitY, unitY) [] let ``Unit Z is correct`` = - let unitZ = Vector3((float32)0, (float32)0, (float32)1) + let unitZ = Vector3(0.0f, 0.0f, 1.0f) Assert.Equal(Vector3.UnitZ, unitZ) [] let ``Unit zero is correct`` = - let unitZero = Vector3((float32)0, (float32)0, (float32)0) + let unitZero = Vector3(0.0f, 0.0f, 0.0f) Assert.Equal(Vector3.Zero, unitZero) @@ -707,7 +707,7 @@ module Vector3 = let inverse = Quaternion.Invert(q) let transformedQuat = q * vectorQuat * inverse - let transformedVector = Vector3(transformedQuat.X, transformedQuat.Y, transformedQuat.Z) + let transformedVector = transformedQuat.Xyz Assert.Equal(transformedVector, Vector3.Transform(v, q)) @@ -717,6 +717,6 @@ module Vector3 = let inverse = Quaternion.Invert(q) let transformedQuat = q * vectorQuat * inverse - let transformedVector = Vector3(transformedQuat.X, transformedQuat.Y,transformedQuat.Z) + let transformedVector = transformedQuat.Xyz Assert.Equal(transformedVector, Vector3.Transform(ref v, ref q)) \ No newline at end of file diff --git a/tests/OpenTK.Tests/Vector4Tests.fs b/tests/OpenTK.Tests/Vector4Tests.fs index 2abb7bb..ea6e072 100644 --- a/tests/OpenTK.Tests/Vector4Tests.fs +++ b/tests/OpenTK.Tests/Vector4Tests.fs @@ -39,8 +39,8 @@ module Vector4 = Assert.Equal(x, v2.X) Assert.Equal(y, v2.Y) - Assert.Equal((float32)0, v2.Z) - Assert.Equal((float32)0, v2.W) + Assert.Equal(0.0f, v2.Z) + Assert.Equal(0.0f, v2.W) [] let ``Vector3 value constructor sets all components to the correct values`` (x, y, z) = @@ -54,7 +54,7 @@ module Vector4 = Assert.Equal(x, v2.X) Assert.Equal(y, v2.Y) Assert.Equal(z, v2.Z) - Assert.Equal((float32)0, v2.W) + Assert.Equal(0.0f, v2.W) [] let ``Vector3 value and scalar constructor sets all components to the correct values`` (x, y, z, w) = @@ -445,7 +445,7 @@ module Vector4 = [] let ``Vector inequality operator is by component`` (x, y, z, w) = let v1 = Vector4(x, y, z, w) - let v2 = Vector4(x + (float32)1 , y + (float32)1, z + (float32)1, w + (float32)1) + let v2 = Vector4(x + 1.0f , y + 1.0f, z + 1.0f, w + 1.0f) let inequality = v1 <> v2 Assert.True(inequality) @@ -764,37 +764,37 @@ module Vector4 = // [] let ``Unit X is correct`` = - let unitX = Vector4((float32)1, (float32)0, (float32)0, (float32)0) + let unitX = Vector4(1.0f, 0.0f, 0.0f, 0.0f) Assert.Equal(Vector4.UnitX, unitX) [] let ``Unit Y is correct`` = - let unitY = Vector4((float32)0, (float32)1, (float32)0, (float32)0) + let unitY = Vector4(0.0f, 1.0f, 0.0f, 0.0f) Assert.Equal(Vector4.UnitY, unitY) [] let ``Unit Z is correct`` = - let unitZ = Vector4((float32)0, (float32)0, (float32)1, (float32)0) + let unitZ = Vector4(0.0f, 0.0f, 1.0f, 0.0f) Assert.Equal(Vector4.UnitZ, unitZ) [] let ``Unit W is correct`` = - let unitW = Vector4((float32)0, (float32)0, (float32)0, (float32)1) + let unitW = Vector4(0.0f, 0.0f, 0.0f, 1.0f) Assert.Equal(Vector4.UnitW, unitW) [] let ``Unit zero is correct`` = - let unitZero = Vector4((float32)0, (float32)0, (float32)0, (float32)0) + let unitZero = Vector4(0.0f, 0.0f, 0.0f, 0.0f) Assert.Equal(Vector4.Zero, unitZero) [] let ``Unit one is correct`` = - let unitOne = Vector4((float32)1, (float32)1, (float32)1, (float32)1) + let unitOne = Vector4(1.0f, 1.0f, 1.0f, 1.0f) Assert.Equal(Vector4.One, unitOne)