From 94b5dbda1bd7238346ad4b8bb59fb6256efd0103 Mon Sep 17 00:00:00 2001 From: Ilan Truanovsky Date: Mon, 30 Jan 2023 12:06:06 -0800 Subject: [PATCH] Fix Coverity issues in `acl_globals_test.cpp` Fixes: ``` test/acl_globals_test.cpp:697:1: Type: Unchecked return value (CHECKED_RETURN) test/acl_globals_test.cpp:697:1: Unchecked call to function 1. check_return: Calling "acl_set_hal" without checking return value (as is done elsewhere 27 out of 31 times). src/acl_globals.cpp:206:3: Examples where return value from this function is checked 2. example_checked: Example 1: "acl_set_hal(board_hal)" has its value checked in "acl_set_hal(board_hal)". test/acl_hal_test.cpp:302:3: Examples where return value from this function is checked 3. example_checked: Example 2: "acl_set_hal(&simple_hal)" has its value checked in "acl_set_hal(&simple_hal)". test/acl_hal_test.cpp:180:3: Examples where return value from this function is checked 4. example_checked: Example 3: "acl_set_hal(&simple_hal)" has its value checked in "1 == acl_set_hal(&simple_hal)". test/acl_hal_test.cpp:231:3: Examples where return value from this function is checked 5. example_checked: Example 4: "acl_set_hal(&bad_hal)" has its value checked in "0 == acl_set_hal(&bad_hal)". test/acl_hal_test.cpp:234:3: Examples where return value from this function is checked 6. example_checked: Example 5: "acl_set_hal(&bad_hal)" has its value checked in "0 != acl_set_hal(&bad_hal)". ``` --- test/acl_globals_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/acl_globals_test.cpp b/test/acl_globals_test.cpp index 5376d4e6..00b65c7a 100644 --- a/test/acl_globals_test.cpp +++ b/test/acl_globals_test.cpp @@ -694,7 +694,7 @@ const acl_system_def_t *acl_test_get_empty_system_def() { } TEST_GROUP(acl_globals_undef){void setup(){acl_mutex_wrapper.lock(); -acl_set_hal(acl_test_get_simple_hal()); +CHECK(acl_set_hal(acl_test_get_simple_hal())); } void teardown() { acl_reset_hal();