Browse Source

added test for gets with minLength

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

8
test/test_userinput.c

@ -15,6 +15,14 @@ void test_gets_WithMinLengthAndMaxLength(void) {
TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual)); TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual));
} }
void test_gets_WithMin(void) {
unsigned long minLength = 3;
char *input[] = {"", "ei", "e", "dddd", NULL};
fakeInput = input;
char *actual = gets("", &minLength, NULL);
TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual));
}
void test_gethd_WithMinAndMax(void) { void test_gethd_WithMinAndMax(void) {
short min = 10; short min = 10;
short max = 100; short max = 100;

Loading…
Cancel
Save