Skip to content

Commit ce792b4

Browse files
IlanTruanovskypcolberg
authored andcommitted
Fix acl_test.cpp Coverity issues
Fixes: ``` test/acl_test.cpp:95:3: Type: Unchecked return value (CHECKED_RETURN) test/acl_test.cpp:95:3: Unchecked call to function 1. check_return: Calling "acl_set_hal" without checking return value (as is done elsewhere 28 out of 31 times). src/acl_globals.cpp:182: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_globals_test.cpp:697:1: Examples where return value from this function is checked 3. example_checked: Example 2: "acl_set_hal(acl_test_get_simple_hal())" has its value checked in "acl_set_hal(acl_test_get_simple_hal())". test/acl_hal_test.cpp:303: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 "acl_set_hal(&simple_hal)". test/acl_hal_test.cpp:181:3: Examples where return value from this function is checked 5. example_checked: Example 4: "acl_set_hal(&simple_hal)" has its value checked in "1 == acl_set_hal(&simple_hal)". test/acl_hal_test.cpp:232: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_test.cpp:102:3: Type: Unchecked return value (CHECKED_RETURN) test/acl_test.cpp:102:3: Unchecked call to function 1. check_return: Calling "acl_set_hal" without checking return value (as is done elsewhere 28 out of 31 times). src/acl_globals.cpp:182: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_globals_test.cpp:697:1: Examples where return value from this function is checked 3. example_checked: Example 2: "acl_set_hal(acl_test_get_simple_hal())" has its value checked in "acl_set_hal(acl_test_get_simple_hal())". test/acl_hal_test.cpp:303: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 "acl_set_hal(&simple_hal)". test/acl_hal_test.cpp:181:3: Examples where return value from this function is checked 5. example_checked: Example 4: "acl_set_hal(&simple_hal)" has its value checked in "1 == acl_set_hal(&simple_hal)". test/acl_hal_test.cpp:232: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_test.cpp:109:3: Type: Unchecked return value (CHECKED_RETURN) test/acl_test.cpp:109:3: Unchecked call to function 1. check_return: Calling "acl_set_hal" without checking return value (as is done elsewhere 28 out of 31 times). src/acl_globals.cpp:182: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_globals_test.cpp:697:1: Examples where return value from this function is checked 3. example_checked: Example 2: "acl_set_hal(acl_test_get_simple_hal())" has its value checked in "acl_set_hal(acl_test_get_simple_hal())". test/acl_hal_test.cpp:303: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 "acl_set_hal(&simple_hal)". test/acl_hal_test.cpp:181:3: Examples where return value from this function is checked 5. example_checked: Example 4: "acl_set_hal(&simple_hal)" has its value checked in "1 == acl_set_hal(&simple_hal)". test/acl_hal_test.cpp:232: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)". ```
1 parent 73b9fe7 commit ce792b4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/acl_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,22 @@ int main(int argc, const char **argv) {
9292

9393
void acl_test_setup_generic_system() {
9494
acl_mutex_wrapper.lock();
95-
acl_set_hal(acl_test_get_simple_hal());
96-
acl_init(acl_test_get_complex_system_def());
95+
assert(1 == acl_set_hal(acl_test_get_simple_hal()));
96+
assert(1 == acl_init(acl_test_get_complex_system_def()));
9797
acl_mutex_wrapper.unlock();
9898
}
9999

100100
void acl_test_setup_empty_system() {
101101
acl_mutex_wrapper.lock();
102-
acl_set_hal(acl_test_get_simple_hal());
103-
acl_init(acl_test_get_empty_system_def());
102+
assert(1 == acl_set_hal(acl_test_get_simple_hal()));
103+
assert(1 == acl_init(acl_test_get_empty_system_def()));
104104
acl_mutex_wrapper.unlock();
105105
}
106106

107107
void acl_test_setup_sample_default_board_system(void) {
108108
acl_mutex_wrapper.lock();
109-
acl_set_hal(acl_test_get_simple_hal());
110-
acl_init(&acl_test_example_binary_sysdef);
109+
assert(1 == acl_set_hal(acl_test_get_simple_hal()));
110+
assert(1 == acl_init(&acl_test_example_binary_sysdef));
111111
acl_mutex_wrapper.unlock();
112112
}
113113

0 commit comments

Comments
 (0)