Skip to content

Commit

Permalink
Use AssertExtensions for new test only
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Nov 22, 2024
1 parent 4771080 commit db16a0c
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions src/libraries/System.Numerics.Vectors/tests/Matrix4x4Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
Expand All @@ -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)
Expand Down

0 comments on commit db16a0c

Please sign in to comment.