From b4cd0886bb1473f02acc7692f3d27d764ab3447b Mon Sep 17 00:00:00 2001 From: Ethan Looney Date: Wed, 29 Jul 2020 14:23:03 -0700 Subject: [PATCH] Changed test returns for 'get_digit' to remove implicit conversion errors --- tests/api.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/api.c b/tests/api.c index deb612ee8..d72942e0d 100644 --- a/tests/api.c +++ b/tests/api.c @@ -33757,11 +33757,24 @@ static int test_get_digit (void) ret = -1; } if (ret == 0) { - ret = get_digit(NULL, n); + if (get_digit(NULL, n) != 0) { /* Should not hit this*/ + ret = -1; + } } - if (ret == 0) { - ret = get_digit(&a, n); + if (get_digit(NULL, n) == 0) { /* Should hit this*/ + ret = 0; + } + } + if (ret == 0) { + if (get_digit(&a, n) != 0) { /* Should not hit this*/ + ret = -1; + } + } + if (ret == 0) { + if (get_digit(&a, n) == 0) { /* Should hit this*/ + ret = 0; + } }