Browse Source

added test for gets with maxLength

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

8
test/test_userinput.c

@ -23,6 +23,14 @@ void test_gets_WithMin(void) {
TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual)); TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual));
} }
void test_gets_WithMax(void) {
unsigned long maxLength = 6;
char *input[] = {"dfdfdfdf", "dddd", NULL};
fakeInput = input;
char *actual = gets("", NULL, &maxLength);
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