Browse Source

added test for converting binary string of 1s to decimal

remotes/origin/conversionOfNumbers
Laurin 11 months ago
parent
commit
e48b4f38a6
  1. 12
      test/conversionOfNumbers/test_conversionOfNumbers.c

12
test/conversionOfNumbers/test_conversionOfNumbers.c

@ -79,3 +79,15 @@ void test_convertNegative12ToBinaryStrNegative1100(){
TEST_ASSERT_EQUAL_STRING(expected, result); TEST_ASSERT_EQUAL_STRING(expected, result);
free(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);
}
Loading…
Cancel
Save