From e48b4f38a61a028fdf7c63b76e230816446e3337 Mon Sep 17 00:00:00 2001 From: Laurin Date: Fri, 2 Feb 2024 09:23:44 +0100 Subject: [PATCH] added test for converting binary string of 1s 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 a5132dc..954bdd5 100644 --- a/test/conversionOfNumbers/test_conversionOfNumbers.c +++ b/test/conversionOfNumbers/test_conversionOfNumbers.c @@ -78,4 +78,16 @@ void test_convertNegative12ToBinaryStrNegative1100(){ //assert TEST_ASSERT_EQUAL_STRING(expected, result); free(result); +} + +void test_convertBinaryStr11ToInt3(){ + //arrange + unsigned int result; + unsigned int expected = 3; + + //act + result = convertBinaryStrToInt("11"); + + //assert + TEST_ASSERT_EQUAL_UINT(expected, result); } \ No newline at end of file