mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix several MSVC issues numeric.h
-> Round negative numbers correctly CMakeLists.txt -> Link Json with the static run-time library
This commit is contained in:
parent
37ca3212ee
commit
6626a3f72f
3 changed files with 16 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue