Skip to content

Validate SCSI error codes (sense key, asc) in unit tests (issue #895)#950

Merged
uweseimet merged 4 commits intodevelopfrom
feature_issue_895
Oct 29, 2022
Merged

Validate SCSI error codes (sense key, asc) in unit tests (issue #895)#950
uweseimet merged 4 commits intodevelopfrom
feature_issue_895

Conversation

@uweseimet
Copy link
Copy Markdown
Contributor

No description provided.

@uweseimet uweseimet linked an issue Oct 29, 2022 that may be closed by this pull request
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

TEST(ScsiControllerTest, MsgOut)
{
auto bus = make_shared<MockBus>();
auto bus = make_shared<NiceMock<MockBus>>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@uweseimet - only for my own understanding, what does NiceMock<> do?

Copy link
Copy Markdown
Contributor Author

@uweseimet uweseimet Oct 29, 2022

Choose a reason for hiding this comment

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

@akuker NiceMock suppresses warnings like the one below provided that you definitely know that the warning is irrelevant for your test case. We have some of these scenarios, where the mocks are tailored for testing AbstractController, for instance, but when being used with a different test (where AbstractController is not the object under test but is just needed to set up the object under test) cause lots of these warnings.

GMOCK WARNING:
Uninteresting mock function call - returning directly.
    Function call: SetCD(false)
NOTE: You can safely ignore the above warning unless this call should not happen.  Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call.  See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#knowing-when-to-expect for details.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. Thanks!!

@uweseimet uweseimet merged commit 9a4f433 into develop Oct 29, 2022
@uweseimet uweseimet deleted the feature_issue_895 branch October 29, 2022 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate SCSI error codes (sense key, ASC) in unit tests

2 participants