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

[cpp cmd] Fix leakage and multiple composition bug in SelectCommand #5571

Merged
merged 4 commits into from
Aug 30, 2023

Conversation

rzblue
Copy link
Member

@rzblue rzblue commented Aug 25, 2023

No description provided.

@rzblue rzblue added the component: command-based WPILib Command Based Library label Aug 25, 2023
@rzblue rzblue requested a review from a team as a code owner August 25, 2023 22:32
Copy link
Member

@Starlight220 Starlight220 left a comment

Choose a reason for hiding this comment

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

That command should probably be marked as composed, for good measure.

@rzblue rzblue changed the title [cpp cmd] Fix leakage in SelectCommand [cpp cmd] Fix leakage and multiple composition bug in SelectCommand Aug 26, 2023
@rzblue
Copy link
Member Author

rzblue commented Aug 26, 2023

Merging with #5569 to avoid conflicts

@Starlight220
Copy link
Member

Starlight220 commented Aug 27, 2023

(Continuing my review from the other PR)

Should we add tests for all commands to ensure that they are handling inner commands properly?

That's not a bad idea, and can be done easily by adding to the MultiCompositionTest test suite a test that tries including the same command twice (for example).

As long as there aren't active changes to tests specific to other classes, I'd consider it in scope.

@rzblue
Copy link
Member Author

rzblue commented Aug 29, 2023

#5581 adds tests for this in java. I'm not sure how to test the behavior in c++, since ownership semantics largely prevent users from doubly composing commands.

I'd rather stick the tests in that PR, since it's already touching a bunch of files.

@PeterJohnson PeterJohnson merged commit cf19102 into wpilibsuite:main Aug 30, 2023
23 checks passed
@rzblue rzblue deleted the selectcmd-leakage branch August 30, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: command-based WPILib Command Based Library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants