aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/test_utilities.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unittest/test_utilities.cpp')
-rw-r--r--src/unittest/test_utilities.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/unittest/test_utilities.cpp b/src/unittest/test_utilities.cpp
index caf4515c8..07108706a 100644
--- a/src/unittest/test_utilities.cpp
+++ b/src/unittest/test_utilities.cpp
@@ -45,6 +45,7 @@ public:
void testWrapRows();
void testIsNumber();
void testIsPowerOfTwo();
+ void testMyround();
};
static TestUtilities g_test_instance;
@@ -67,6 +68,7 @@ void TestUtilities::runTests(IGameDef *gamedef)
TEST(testWrapRows);
TEST(testIsNumber);
TEST(testIsPowerOfTwo);
+ TEST(testMyround);
}
////////////////////////////////////////////////////////////////////////////////
@@ -239,3 +241,12 @@ void TestUtilities::testIsPowerOfTwo()
}
UASSERT(is_power_of_two((u32)-1) == false);
}
+
+void TestUtilities::testMyround()
+{
+ UASSERT(myround(4.6f) == 5);
+ UASSERT(myround(1.2f) == 1);
+ UASSERT(myround(-3.1f) == -3);
+ UASSERT(myround(-6.5f) == -7);
+}
+