Browse Source

added test for getu with min and max

remotes/origin/userinput
TheUltimateOptimist 11 months ago
parent
commit
948b3c0ddc
  1. 10
      test/test_userinput.c

10
test/test_userinput.c

@ -52,5 +52,13 @@ void test_gethu_WithMinAndMax(void) {
unsigned short max = 100; unsigned short max = 100;
char *input[] = {"sdf", "-1", "1", "101", "50", NULL}; char *input[] = {"sdf", "-1", "1", "101", "50", NULL};
fakeInput = input; fakeInput = input;
TEST_ASSERT_EQUAL_INT64(50, gethu("", &min, &max));
TEST_ASSERT_EQUAL_UINT64(50, gethu("", &min, &max));
}
void test_getu_WithMinAndMax(void) {
unsigned int min = 10;
unsigned int max = 100000;
char *input[] = {"sdf", "4", "10000000", "1167", NULL};
fakeInput = input;
TEST_ASSERT_EQUAL_UINT64(1167, getu("", &min, &max));
} }
Loading…
Cancel
Save