From 3b11e3b13f51a5e8f3120198f9050c73eab35451 Mon Sep 17 00:00:00 2001 From: Laurin Date: Sat, 3 Feb 2024 10:43:08 +0100 Subject: [PATCH] added final test for converting binary input 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 c29c097..b9a0429 100644 --- a/test/conversionOfNumbers/test_conversionOfNumbers.c +++ b/test/conversionOfNumbers/test_conversionOfNumbers.c @@ -189,4 +189,16 @@ void test_convert234ToHexStrEA(){ //assert TEST_ASSERT_EQUAL_STRING(expected, result); free(result); +} + +void test_convertBinaryStr10110ToInt22(){ + //arrange + unsigned int result; + unsigned int expected = 22; + + //act + result = convertBinaryStrToInt("10110"); + + //assert + TEST_ASSERT_EQUAL_UINT(expected, result); } \ No newline at end of file