mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-22 05:41:07 +00:00
Added additional check against nonmatrix objects.
This commit is contained in:
parent
108906dfe4
commit
b83174af94
|
@ -92,13 +92,17 @@ module Matrix4 =
|
|||
module Equality =
|
||||
//
|
||||
[<Property>]
|
||||
let ``Sixteen value constructor sets all components to the correct values`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) =
|
||||
let ``Two matrices with identical values are equal`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) =
|
||||
let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
|
||||
let B = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
|
||||
let equality = A = B
|
||||
|
||||
Assert.True(equality)
|
||||
|
||||
[<Property>]
|
||||
let ``A matrix is not equal to an object which is not a matrix`` (a : Matrix4, b : Vector3) =
|
||||
Assert.False(a.Equals(b))
|
||||
|
||||
[<Properties(Arbitrary = [| typeof<OpenTKGen> |])>]
|
||||
module Multiplication =
|
||||
//
|
||||
|
|
|
@ -113,13 +113,13 @@ module Vector3 =
|
|||
let ``Normalization of instance, creating a new vector, works`` (a, b, c) =
|
||||
let v = Vector3(a, b, c)
|
||||
let l = v.Length
|
||||
|
||||
|
||||
let norm = v.Normalized()
|
||||
|
||||
Assert.ApproximatelyEqual(v.X / l, norm.X)
|
||||
Assert.ApproximatelyEqual(v.Y / l, norm.Y)
|
||||
Assert.ApproximatelyEqual(v.Z / l, norm.Z)
|
||||
|
||||
|
||||
[<Property>]
|
||||
let ``Normalization of instance works`` (a, b, c) =
|
||||
let v = Vector3(a, b, c)
|
||||
|
|
Loading…
Reference in a new issue