From 3af2dc7802164d6c22dbef1f144c9bd945a35c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20K=C3=BChndel?= Date: Tue, 11 May 2021 16:26:55 +0200 Subject: _TOD_Validate(): Fix incorrect return code This patch fixes bug #4403. Directives * rtems_timer_fire_when() * rtems_timer_server_fire_when() * rtems_task_wake_when() are documented to return RTEMS_INVALID_ADDRESS when their time-of-day argument is NULL. But actually they return RTEMS_INVALID_CLOCK. To fix the issue this patch changes _TOD_Validate() to return a status code instead of just true/false. Close #4403 --- testsuites/sptests/sp2038/init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'testsuites') diff --git a/testsuites/sptests/sp2038/init.c b/testsuites/sptests/sp2038/init.c index 10850d9c4d..035b9a9b9b 100644 --- a/testsuites/sptests/sp2038/init.c +++ b/testsuites/sptests/sp2038/init.c @@ -277,14 +277,14 @@ static void test_problem_year(void) static void test_leap_year(void) { - bool test_status; + rtems_status_code test_status; const rtems_time_of_day *problem = &problem_2100; const rtems_time_of_day *problem2 = &problem_2100_2; // 2100 is not a leap year, so it should have 28 days test_status = _TOD_Validate(problem); - rtems_test_assert(test_status == true); + rtems_test_assert(test_status == RTEMS_SUCCESSFUL); test_status = _TOD_Validate(problem2); - rtems_test_assert(test_status == false); + rtems_test_assert(test_status == RTEMS_INVALID_CLOCK); } static bool test_year_is_leap_year(uint32_t year) -- cgit v1.2.3