From bd819ee5221a1058a0809c4ef0fefbe772ce5055 Mon Sep 17 00:00:00 2001 From: Dennis Sperzel Date: Thu, 1 Feb 2024 09:09:42 +0100 Subject: [PATCH] testing: addition for all unsigned integer --- test/test_addition.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test_addition.c b/test/test_addition.c index 36bfa7f..40af2ff 100644 --- a/test/test_addition.c +++ b/test/test_addition.c @@ -115,4 +115,22 @@ void test_addition_addition_basecasetotenscolumns(void) TEST_ASSERT_EQUAL_UINT(expected[4], result[4]); } +void test_addition_addition_allunsignedinteger(void) +{ + unsigned int result[5]; + unsigned int expected[5] = { 88879736, __UINT32_MAX__, 66558, __UINT32_MAX__, 477905879 }; + + result[0] = addition(13456275, 75423461); + result[1] = addition(4294967294, 1); + result[2] = addition(1023, 65535); + result[3] = addition(0, 4294967295); + result[4] = addition(54321567,423584312); + + TEST_ASSERT_EQUAL_UINT(expected[0], result[0]); + TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); + TEST_ASSERT_EQUAL_UINT(expected[2], result[2]); + TEST_ASSERT_EQUAL_UINT(expected[3], result[3]); + TEST_ASSERT_EQUAL_UINT(expected[4], result[4]); +} + #endif // TEST