From 9ec85ac87ec272a2bed68e83649a020b4d61571b Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Fri, 25 Feb 2022 16:25:17 +0100 Subject: [PATCH] add tests for roundUpToMultiple --- tests/core.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/core.cpp b/tests/core.cpp index cb5b75537a..ddd679581c 100644 --- a/tests/core.cpp +++ b/tests/core.cpp @@ -487,6 +487,15 @@ TEST_CASE("BoxedValue.Constant") STATIC_REQUIRE(vc() == 1); } +TEST_CASE("roundUpToMultiple") +{ + STATIC_REQUIRE(llama::roundUpToMultiple(0, 16) == 0); + STATIC_REQUIRE(llama::roundUpToMultiple(5, 16) == 16); + STATIC_REQUIRE(llama::roundUpToMultiple(16, 16) == 16); + STATIC_REQUIRE(llama::roundUpToMultiple(17, 16) == 32); + STATIC_REQUIRE(llama::roundUpToMultiple(300, 16) == 304); +} + TEST_CASE("divCeil") { STATIC_REQUIRE(llama::divCeil(0, 16) == 0);