|
@ -0,0 +1,16 @@ |
|
|
|
|
|
#include "unity.h" |
|
|
|
|
|
#include "userinput.h" |
|
|
|
|
|
#include "fakeinput.h" |
|
|
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
|
|
|
|
void setUp(void){} |
|
|
|
|
|
void tearDown(void){} |
|
|
|
|
|
|
|
|
|
|
|
void test_gets_WithMinLengthAndMaxLength(void) { |
|
|
|
|
|
unsigned long minLength = 3; |
|
|
|
|
|
unsigned long maxLength = 10; |
|
|
|
|
|
char *input[] = {"ei", "e", "sddfdfdfdfdf", "dddd", NULL}; |
|
|
|
|
|
fakeInput = input; |
|
|
|
|
|
char *actual = gets("", &minLength, &maxLength); |
|
|
|
|
|
TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual)); |
|
|
|
|
|
} |