Browse Source

added test for converting binary string of 1s and 0s to decimal

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

12
test/conversionOfNumbers/test_conversionOfNumbers.c

@ -100,6 +100,18 @@ void test_convertBinaryStr1111ToInt15(){
//act //act
result = convertBinaryStrToInt("1111"); 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 //assert
TEST_ASSERT_EQUAL_UINT(expected, result); TEST_ASSERT_EQUAL_UINT(expected, result);
} }
Loading…
Cancel
Save