Browse Source

Implementation of unit tests for the function characterIsUpperCase().

main
fdai7057 2 years ago
parent
commit
db2b69a461
  1. 15
      tests/test_helperFunctions.c

15
tests/test_helperFunctions.c

@ -211,3 +211,18 @@ void test_generateCheckString()
TEST_ASSERT_EQUAL_STRING(result_3[i],generateCheckString(random_numbers[i],strings_3[i])); TEST_ASSERT_EQUAL_STRING(result_3[i],generateCheckString(random_numbers[i],strings_3[i]));
} }
} }
void test_characterIsUpperCase()
{
/*test values*/
char c1 = 'x', c2 = 'y', c3 = 'z';
char c4 = 'A', c5 = 'B', c6 = 'C';
/*assertions*/
TEST_ASSERT_FALSE(characterIsUpperCase(c1));
TEST_ASSERT_FALSE(characterIsUpperCase(c2));
TEST_ASSERT_FALSE(characterIsUpperCase(c3));
TEST_ASSERT_TRUE(characterIsUpperCase(c4));
TEST_ASSERT_TRUE(characterIsUpperCase(c5));
TEST_ASSERT_TRUE(characterIsUpperCase(c6));
}
Loading…
Cancel
Save