Browse Source

added test for getd with max

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

7
test/test_userinput.c

@ -61,6 +61,13 @@ void test_getd_WithMin(void) {
TEST_ASSERT_EQUAL_INT64(10000000, getd("", &min, NULL)); TEST_ASSERT_EQUAL_INT64(10000000, getd("", &min, NULL));
} }
void test_getd_WithMax(void) {
int max = 1000;
char *input[] = {"sdf", "4000", "10000000", "-200", NULL};
fakeInput = input;
TEST_ASSERT_EQUAL_INT64(-200, getd("", NULL, &max));
}
void test_getld_WithMinAndMax(void) { void test_getld_WithMinAndMax(void) {
long min = -100; long min = -100;
long max = 100000000; long max = 100000000;

Loading…
Cancel
Save