From bd55ea228be03dc75e15be20158cde3e08181ecd Mon Sep 17 00:00:00 2001 From: Laurin Date: Fri, 2 Feb 2024 14:10:07 +0100 Subject: [PATCH] added test for converting binary string of 1s and 0s to decimal --- test/conversionOfNumbers/test_conversionOfNumbers.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/conversionOfNumbers/test_conversionOfNumbers.c b/test/conversionOfNumbers/test_conversionOfNumbers.c index 5659461..c3f6ffe 100644 --- a/test/conversionOfNumbers/test_conversionOfNumbers.c +++ b/test/conversionOfNumbers/test_conversionOfNumbers.c @@ -100,6 +100,18 @@ void test_convertBinaryStr1111ToInt15(){ //act result = convertBinaryStrToInt("1111"); + //assert + TEST_ASSERT_EQUAL_UINT(expected, result); +} + +void test_convertBinaryStr1001ToInt9(){ + //arrange + unsigned int result; + unsigned int expected = 9; + + //act + result = convertBinaryStrToInt("1001"); + //assert TEST_ASSERT_EQUAL_UINT(expected, result); } \ No newline at end of file