-
Notifications
You must be signed in to change notification settings - Fork 71
Fix acl_test.cpp
Coverity issues
#272
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcolberg
reviewed
Feb 3, 2023
3b452b8
to
1622672
Compare
pcolberg
reviewed
Feb 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @IlanTruanovsky, just one minor nitpick.
1622672
to
2666451
Compare
pcolberg
previously approved these changes
Feb 3, 2023
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)". ```
pcolberg
approved these changes
Feb 3, 2023
For some reason the GitHub review UI tries hard to hide commit messages, which means an outdated commit message is easy to miss when reviewing unless one remembers each and every time to click through to the commit. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Coverity complains that some setup functions' return values are not being checked. I chose to ignore the return values of these functions.
I tried adding a CHECK(...) to check for success, but this caused a function in Utest.cpp to seg fault. I'm assuming this is caused due to some CppUTest things variables/methods not being initialized until after the problematic
acl_test.cpp
function is called.I think it is better to just ignore the function call's return value and if it fails, the test that called the initialization function(s) will fail.
Fixes: