This commit is contained in:
vis2k 2021-08-07 21:31:10 +08:00
parent 572ce6c751
commit 1666bf5309

View File

@ -105,17 +105,6 @@ public void CompressAndDecompressQuaternion_90DegreeEuler()
Assert.That(Mathf.Abs(angle), Is.LessThanOrEqualTo(1));
}
// client sending invalid data should still produce valid quaternions to
// avoid any possible bugs on server
[Test]
public void DecompressQuaternionInvalidData()
{
// decompress
// 0xFFFFFFFF will decompress to (0.7, 0.7, 0.7, NaN)
Quaternion decompressed = Compression.DecompressQuaternion(0xFFFFFFFF);
Assert.That(decompressed, Is.EqualTo(Quaternion.identity));
}
// test for issue https://github.com/vis2k/Mirror/issues/2674
[Test]
public void CompressAndDecompressQuaternion_2674()
@ -141,6 +130,17 @@ public void CompressAndDecompressQuaternion_2674()
Assert.That(Mathf.Abs(angle), Is.LessThanOrEqualTo(1));
}
// client sending invalid data should still produce valid quaternions to
// avoid any possible bugs on server
[Test]
public void DecompressQuaternionInvalidData()
{
// decompress
// 0xFFFFFFFF will decompress to (0.7, 0.7, 0.7, NaN)
Quaternion decompressed = Compression.DecompressQuaternion(0xFFFFFFFF);
Assert.That(decompressed, Is.EqualTo(Quaternion.identity));
}
[Test]
public void VarInt()
{