Skip to content

Bug fix for wrong output parameters being copied #1008

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 3 commits into from
Jun 23, 2016

Conversation

jgonzalezdr
Copy link
Contributor

It's been a long time since my last contributions, but I've finally managed to get some free time and I've spend it in finishing the modifications that I started to enable expected calls to match multiple calls. I'm still merging all the changes of the main branch into my outdated code (almost a year full of commits!), but I've detected a bug that I've just fixed, so I'm submitting this standalone PR for it.

Here goes the bug description and fixing notes:

The present code can copy the output parameters of an expected call, but finally fulfill a different one.

This happens for example if an expected call for a function that returns output parameters and ignores other parameters is declared before an expected call for the same function, that also returns expected parameters, but that doesn't ignore parameters.

The solution has been to just prioritize output parameter finalization of expected calls that don't ignore parameters over calls that can ignore them (in the same way that call fulfillment works), instead of just picking the first one.

BTW, some optimizations have been also applied on the affected code, to avoid traversing the expected calls list twice (first to check if there is a call that matches some criteria, then again to get that call), and therefore some methods that are not necessary any more have been deleted.

@coveralls
Copy link

coveralls commented Jun 22, 2016

Coverage Status

Coverage decreased (-0.0001%) to 99.875% when pulling ad5942c on jgonzalezdr:output-parameters-bug-fix into 52d45fe on cpputest:master.

@arstrube
Copy link
Contributor

The appveyor error is a random failure.

@basvodde basvodde merged commit 2ed1869 into cpputest:master Jun 23, 2016
@jgonzalezdr jgonzalezdr deleted the output-parameters-bug-fix branch July 5, 2016 22:45
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.

4 participants