mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Tests: LargestAbsoluteComponentIndex test to reproduce #2674
This commit is contained in:
parent
3d67c72336
commit
c5080d1ab3
@ -28,6 +28,15 @@ public void LargestAbsoluteComponentIndex()
|
||||
Assert.That(index, Is.EqualTo(0));
|
||||
Assert.That(largest, Is.EqualTo(Mathf.Abs(value.x)));
|
||||
Assert.That(withoutLargest, Is.EqualTo(new Vector3(value.y, value.z, value.w)));
|
||||
|
||||
// test to guarantee it uses 'abs' for first value
|
||||
// to reproduce https://github.com/vis2k/Mirror/issues/2674
|
||||
// IF all values are properly 'abs', THEN first one should be largest
|
||||
value = new Vector4(-3, 0, 1, 2);
|
||||
index = Compression.LargestAbsoluteComponentIndex(value, out largest, out withoutLargest);
|
||||
Assert.That(index, Is.EqualTo(0));
|
||||
Assert.That(largest, Is.EqualTo(Mathf.Abs(value.x)));
|
||||
Assert.That(withoutLargest, Is.EqualTo(new Vector3(value.y, value.z, value.w)));
|
||||
}
|
||||
|
||||
[Test, Ignore("Enable when needed.")]
|
||||
|
Loading…
Reference in New Issue
Block a user