Skip to content

Commit

Permalink
Tests/AK: Add some basic ceil_div() tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nico committed Apr 26, 2024
1 parent 3568215 commit 44f073b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Tests/AK/TestStdLibExtras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
#include <AK/Variant.h>
#include <AK/Vector.h>

TEST_CASE(ceil_div)
{
EXPECT_EQ(ceil_div(0, 1), 0);
EXPECT_EQ(ceil_div(1, 1), 1);
EXPECT_EQ(ceil_div(2, 1), 2);
EXPECT_EQ(ceil_div(3, 1), 3);
EXPECT_EQ(ceil_div(4, 1), 4);

EXPECT_EQ(ceil_div(0, 2), 0);
EXPECT_EQ(ceil_div(1, 2), 1);
EXPECT_EQ(ceil_div(2, 2), 1);
EXPECT_EQ(ceil_div(3, 2), 2);
EXPECT_EQ(ceil_div(4, 2), 2);
}

TEST_CASE(mix)
{
double a = 1.0;
Expand Down

0 comments on commit 44f073b

Please sign in to comment.