Add ROUND_UP and ROUND_DOWN

This commit is contained in:
Alex
2023-05-10 21:49:28 +03:00
parent fa8122659a
commit 79c6a5096d
2 changed files with 28 additions and 1 deletions

View File

@ -102,6 +102,27 @@ __constructor void TestMacros()
pgs++;
}
}
{
debug("Testing ROUND_UP and ROUND_DOWN");
int x = 0x101;
int y = 0x100;
int result;
result = ROUND_UP(x, y);
if (result != 0x200)
{
error("ERROR: ROUND_UP failed: %d != 0x200\n", result);
inf_loop;
}
result = ROUND_DOWN(x, y);
if (result != 0x100)
{
error("ERROR: ROUND_DOWN failed: %d != 0x100\n", result);
inf_loop;
}
}
}
#endif // DEBUG