Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Coverity issues in acl_globals_test.cpp #259

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

IlanTruanovsky
Copy link
Contributor

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)".

@pcolberg pcolberg added the bug Something isn't working label Jan 30, 2023
@pcolberg pcolberg added this to the 2023.2 milestone Jan 30, 2023
pcolberg
pcolberg previously approved these changes Jan 31, 2023
Copy link
Contributor

@pcolberg pcolberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @IlanTruanovsky. Either solution is fine, your initial solution delaying the error and this solution checking the return value; the latter is slightly easier to debug when the call does fail.

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)".
```
@pcolberg pcolberg merged commit 4ba0a9a into intel:main Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants