From 3e3c71af521425c2569b78ba09bd15ad5a53611e Mon Sep 17 00:00:00 2001 From: MeltyPlayer Date: Sun, 1 Dec 2024 11:50:07 -0600 Subject: [PATCH] Added tests for the previous commit. --- Schema Tests/util/BitLogicTests.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Schema Tests/util/BitLogicTests.cs b/Schema Tests/util/BitLogicTests.cs index 9eeeb77..a49dffb 100644 --- a/Schema Tests/util/BitLogicTests.cs +++ b/Schema Tests/util/BitLogicTests.cs @@ -13,4 +13,13 @@ public class BitLogicTests { [TestCase((uint) 17, ExpectedResult = (uint) 3)] public uint TestBytesNeededToContainBits(uint bits) => BitLogic.BytesNeededToContainBits(bits); + + [Test] + [TestCase((uint) 0, ExpectedResult = 0.0)] + [TestCase((uint) 1, ExpectedResult = 0.000244140625)] + [TestCase((uint) 100, ExpectedResult = 0.0244140625)] + [TestCase(0xF0000000, ExpectedResult = -65536)] + [TestCase(uint.MaxValue, ExpectedResult = -0.000244140625)] + public double TestFixed32_1_19_12(uint x) + => BitLogic.GetFixedPointDouble(x, 1, 19, 12); } \ No newline at end of file