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

Unit tests for Path2D class #66927

Merged
merged 1 commit into from
Nov 2, 2022
Merged

Conversation

jbcolli2
Copy link
Contributor

@jbcolli2 jbcolli2 commented Oct 5, 2022

Unit tests for the Path2D class. This follows pretty closely to the Path3D tests that already exist, testing to be sure the path is initialized correctly and that the Curve of the path is set correctly under various conditions.

@jbcolli2 jbcolli2 requested a review from a team as a code owner October 5, 2022 12:18
@MewPurPur
Copy link
Contributor

Have you seen #66425?

@jbcolli2
Copy link
Contributor Author

jbcolli2 commented Oct 5, 2022

Nope, thanks for pointing it out. I was working on this off of issue #43440 and didn't see anyone mention Path2d since 2020 so I thought I'd take care of it. I'm new to contributing so not sure what to do at this point.

@Geometror
Copy link
Member

Provided you have the time, I would suggest looking at #66425, combining the test cases of both PRs and adding @MatthewTave as a co-author since according to their last comment they might be busy currently and won't be able to work on their PR.

@jbcolli2
Copy link
Contributor Author

jbcolli2 commented Oct 7, 2022

Updated PR with tests from PR #66425 authored by @MatthewTave.

@Geometror
Copy link
Member

Thanks for updating your PR so quickly! There are just two things left to do: Please squash your commits into a single one as described here. Furthermore, please don't mention a PR in your commit message since that thread will be spammed whenever you forcepush. You can add @MatthewTave as a co-author to your single commit by following the steps here.

@Geometror
Copy link
Member

Sorry that I have to annoy you again, but there should be an empty line between the first line of the commit message and the line with the co-author mention, otherwise the contribution won't count for the co-author (for whatever reason). You can check whether it has worked by looking at the "Commits" tab of this PR, there should be two profile pictures displayed on your commit.

@jbcolli2 jbcolli2 force-pushed the Path2d-Tests branch 2 times, most recently from b73c9f1 to a93973d Compare October 11, 2022 13:27
@jbcolli2
Copy link
Contributor Author

Ok, I think that should do it. Took me a sec to figure out the co author syntax. It actually wasn't the empty line, the email has to be within brackets, which isn't shown in the official github co-author help site. Thanks for the help.

Copy link
Member

@Geometror Geometror left a comment

Choose a reason for hiding this comment

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

LGTM overall, there are still test cases missing which actually test the functionality of Path2D, but as a start I think this is fine.

CHECK_MESSAGE(test_path->get_curve() != curve1,
"After rewrite, second curve should be in class");
CHECK_MESSAGE(test_path->get_curve() == curve2,
"After rewrite, second curve should be in class");
Copy link
Member

Choose a reason for hiding this comment

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

This wordings seems a bit off to me, but that's also used in the Path3D tests, so I think we can change that later.

@akien-mga akien-mga merged commit 1bff95a into godotengine:master Nov 2, 2022
@akien-mga akien-mga modified the milestones: 4.x, 4.0 Nov 2, 2022
@akien-mga
Copy link
Member

Thanks!

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.

5 participants