From cf9aa5a2bfbbfd8aacc36d69d641b09983a4f500 Mon Sep 17 00:00:00 2001 From: TheUltimateOptimist Date: Mon, 29 Jan 2024 02:42:19 +0100 Subject: [PATCH] added test for getd with max --- test/test_userinput.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_userinput.c b/test/test_userinput.c index b0d6bac..b247b6b 100644 --- a/test/test_userinput.c +++ b/test/test_userinput.c @@ -61,6 +61,13 @@ void test_getd_WithMin(void) { 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) { long min = -100; long max = 100000000;