From db16a0cda4dad609ec650bdc72da10eb3faff6c2 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 22 Nov 2024 23:06:32 +0900 Subject: [PATCH] Use AssertExtensions for new test only --- .../tests/Matrix4x4Tests.cs | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/libraries/System.Numerics.Vectors/tests/Matrix4x4Tests.cs b/src/libraries/System.Numerics.Vectors/tests/Matrix4x4Tests.cs index 148c326c7634b..2107bcf184f8d 100644 --- a/src/libraries/System.Numerics.Vectors/tests/Matrix4x4Tests.cs +++ b/src/libraries/System.Numerics.Vectors/tests/Matrix4x4Tests.cs @@ -819,7 +819,6 @@ public void Matrix4x4CreateReflectionTest01() Vector3 v = point - pp; float d = Vector3.Dot(v, plane.Normal); Vector3 vp = point - 2.0f * d * plane.Normal; - Assert.True(MathHelper.Equal(rp, vp), "Matrix4x4.CreateReflection did not provide expected value."); } } @@ -831,28 +830,25 @@ public void Matrix4x4CreateReflectionTest02() Plane plane = new Plane(0, 1, 0, 60); Matrix4x4 actual = Matrix4x4.CreateReflection(plane); - Matrix4x4 expected = new Matrix4x4(); - expected.M11 = 1.0f; - expected.M12 = 0.0f; - expected.M13 = 0.0f; - expected.M14 = 0.0f; - - expected.M21 = 0.0f; - expected.M22 = -1.0f; - expected.M23 = 0.0f; - expected.M24 = 0.0f; - - expected.M31 = 0.0f; - expected.M32 = 0.0f; - expected.M33 = 1.0f; - expected.M34 = 0.0f; - - expected.M41 = 0.0f; - expected.M42 = -120.0f; - expected.M43 = 0.0f; - expected.M44 = 1.0f; - - Assert.True(MathHelper.Equal(expected, actual), "Matrix4x4.CreateReflection did not return the expected value."); + AssertExtensions.Equal(1.0f, actual.M11, 0.0f); + AssertExtensions.Equal(0.0f, actual.M12, 0.0f); + AssertExtensions.Equal(0.0f, actual.M13, 0.0f); + AssertExtensions.Equal(0.0f, actual.M14, 0.0f); + + AssertExtensions.Equal(0.0f, actual.M21, 0.0f); + AssertExtensions.Equal(-1.0f, actual.M22, 0.0f); + AssertExtensions.Equal(0.0f, actual.M23, 0.0f); + AssertExtensions.Equal(0.0f, actual.M24, 0.0f); + + AssertExtensions.Equal(0.0f, actual.M31, 0.0f); + AssertExtensions.Equal(0.0f, actual.M32, 0.0f); + AssertExtensions.Equal(1.0f, actual.M33, 0.0f); + AssertExtensions.Equal(0.0f, actual.M34, 0.0f); + + AssertExtensions.Equal(0.0f, actual.M41, 0.0f); + AssertExtensions.Equal(-120.0f, actual.M42, 0.0f); + AssertExtensions.Equal(0.0f, actual.M43, 0.0f); + AssertExtensions.Equal(1.0f, actual.M44, 0.0f); } // A test for CreateRotationZ (float)