From 948b3c0ddc30cd8aa186518bba06a46a46db892f Mon Sep 17 00:00:00 2001 From: TheUltimateOptimist Date: Mon, 29 Jan 2024 02:14:36 +0100 Subject: [PATCH] added test for getu with min and max --- test/test_userinput.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test_userinput.c b/test/test_userinput.c index 35a8824..2aec85c 100644 --- a/test/test_userinput.c +++ b/test/test_userinput.c @@ -52,5 +52,13 @@ void test_gethu_WithMinAndMax(void) { unsigned short max = 100; char *input[] = {"sdf", "-1", "1", "101", "50", NULL}; 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)); } \ No newline at end of file