Browse Source

added test for gethd with min and max

remotes/origin/userinput
TheUltimateOptimist 11 months ago
parent
commit
fb5a121d40
  1. 8
      test/test_userinput.c

8
test/test_userinput.c

@ -14,3 +14,11 @@ void test_gets_WithMinLengthAndMaxLength(void) {
char *actual = gets("", &minLength, &maxLength); char *actual = gets("", &minLength, &maxLength);
TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual)); TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual));
} }
void test_gethd_WithMinAndMax(void) {
short min = 10;
short max = 100;
char *input[] = {"sdf", "1", "101", "50"};
fakeInput = input;
TEST_ASSERT_EQUAL_INT64(50, gethd("", &min, &max));
}
Loading…
Cancel
Save