From a81e8d3d3c1867bda933755d979d7bb1b6d24b78 Mon Sep 17 00:00:00 2001 From: TheUltimateOptimist Date: Mon, 29 Jan 2024 02:11:42 +0100 Subject: [PATCH] added test for gethu with min and max --- test/test_userinput.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_userinput.c b/test/test_userinput.c index 157f5b0..35a8824 100644 --- a/test/test_userinput.c +++ b/test/test_userinput.c @@ -45,4 +45,12 @@ void test_getlld_WithMinAndMax(void) { char *input[] = {"sdf", "-400", "10000000000000", "11001100", NULL}; fakeInput = input; TEST_ASSERT_EQUAL_INT64(11001100, getlld("", &min, &max)); +} + +void test_gethu_WithMinAndMax(void) { + unsigned short min = 10; + unsigned short max = 100; + char *input[] = {"sdf", "-1", "1", "101", "50", NULL}; + fakeInput = input; + TEST_ASSERT_EQUAL_INT64(50, gethu("", &min, &max)); } \ No newline at end of file