diff options
author | EuAndreh <eu@euandre.org> | 2024-06-25 14:06:13 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-06-25 14:06:13 -0300 |
commit | 0f8911e29bd68af82cd6403e2c081f939477e265 (patch) | |
tree | 03bdaa831b242cff411f785cde7421b51b5aeafb /tests | |
parent | Fix clang warnings (diff) | |
download | pindaiba-0f8911e29bd68af82cd6403e2c081f939477e265.tar.gz pindaiba-0f8911e29bd68af82cd6403e2c081f939477e265.tar.xz |
src/math.h: Add max_size() function
Diffstat (limited to 'tests')
-rw-r--r-- | tests/math.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/math.c b/tests/math.c index 2aefa59..5dcebda 100644 --- a/tests/math.c +++ b/tests/math.c @@ -122,6 +122,19 @@ test_mul_size(void) { } } +static void +test_max_size(void) { + test_start("max_size()"); + + { + testing("simplistic cases"); + assert(max_size(0U, 0U) == 0U); + assert(max_size(1U, 0U) == 1U); + assert(max_size(10U, SIZE_MAX + 1U) == 10U); + test_ok(); + } +} + int main(void) { @@ -129,6 +142,7 @@ main(void) { test_add_size(); test_mul_size(); + test_max_size(); rc = EXIT_SUCCESS; return rc; |