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

Added missing expectations for EnginMasterTests #11309

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

daschuer
Copy link
Member

This fixes warnings reported in #11308

Comment on lines +76 to +79
EXPECT_CALL(*pChannel, collectFeatures(_))
.Times(1);
EXPECT_CALL(*pChannel, postProcess(160000))
.Times(1);
Copy link
Member

Choose a reason for hiding this comment

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

Do we really expect these to be called or is that just an artifact of the internals?
If so, there are better ways of dealing with that.
https://github.com/google/googletest/blob/3d787f5a0d58cfc37a0563bb15647a0d8aa2c1bf/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall

Copy link
Member Author

Choose a reason for hiding this comment

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

It is just when the call is missing, it is likely a regression. I stumbled over it when digging into #11257

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't really understand why ONE_CALL is an alternative.

So use ON_CALL by default, and only use EXPECT_CALL when you actually intend to verify that the call is made

In this case I want the later, so I think the solution is OK.

Copy link
Member

@Swiftb0y Swiftb0y Feb 27, 2023

Choose a reason for hiding this comment

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

Mhmm, the thing is that the other calls actually make sense. I don't understand why we need to verify that collectFeatures and postProcess calls have been made or what they even do or why its important for the test that those two methods have been called. Perhaps you can shed some light on that?

Copy link
Member Author

Choose a reason for hiding this comment

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

For my understanding the purpose of these test is to detect significant changes in the code that may introduce regressions. All output should make the same calls.
The tests are pointless in terms of "testing a contract" or such which is the original purpose of a Mock.

I am currently working on finding the bug reported in #11257 where any additional test condition is welcome. But actually the main issue was the disturbing warning. This is fixed.

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

I guess its questionable how needed these are, but as long as they don't make it worse, I don't see a reason to reject this.

@daschuer
Copy link
Member Author

daschuer commented Mar 6, 2023

@Swiftb0y So this can be merged?

@Swiftb0y
Copy link
Member

Swiftb0y commented Mar 6, 2023

Yes, I just wanted to give somebody else the opportunity to comment before merging.

@Swiftb0y Swiftb0y merged commit 3aeafd6 into mixxxdj:2.3 Mar 6, 2023
@daschuer
Copy link
Member Author

daschuer commented Mar 6, 2023

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants