From faa3d325ad5f645ef30ee1bf8e5a3f3d9857a515 Mon Sep 17 00:00:00 2001 From: TheUltimateOptimist Date: Wed, 7 Feb 2024 09:39:31 +0100 Subject: [PATCH] added unittest for usergethd with min --- test/test_userinput.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_userinput.c b/test/test_userinput.c index 1cd93f2..648f1ad 100644 --- a/test/test_userinput.c +++ b/test/test_userinput.c @@ -46,6 +46,13 @@ void test_usergethd_WithMinAndMax(void) { TEST_ASSERT_EQUAL_INT(50, usergethd("", &min, &max)); } +void test_usergethd_WithMin(void) { + short min = 13; + char *input[] = {"sdf", "1", "100000", "6000", NULL}; + fakeInput = input; + TEST_ASSERT_EQUAL_INT(6000, usergethd("", &min, NULL)); +} + void test_usergetd_WithMinAndMax(void) { int min = 10; int max = 100000;