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

Add a test suite for Rect2 and Rect2i #43514

Merged
merged 1 commit into from
Nov 20, 2020

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Nov 13, 2020

No description provided.

@Calinou Calinou force-pushed the test-add-rect2-rect2i branch from 2ecd88c to ad2d988 Compare November 19, 2020 22:31
@Calinou
Copy link
Member Author

Calinou commented Nov 19, 2020

I added tests for has_point() at the edges (on negative and positive coordinates), both for Rect2 and Rect2i. This should be ready to merge now.

@akien-mga
Copy link
Member

Style issue after recent change to file_format.sh.

@Calinou Calinou force-pushed the test-add-rect2-rect2i branch from ad2d988 to 7cb21c2 Compare November 20, 2020 11:53
@akien-mga akien-mga merged commit 29f3478 into godotengine:master Nov 20, 2020
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the test-add-rect2-rect2i branch March 31, 2021 09:45
Comment on lines +323 to +328
CHECK_MESSAGE(
Math::is_equal_approx(Rect2i(0, 100, -1280, 720).get_area(), -921'600),
"get_area() should return the expected value.");
CHECK_MESSAGE(
Math::is_zero_approx(Rect2i(0, 100, 0, 720).get_area()),
"get_area() should return the expected value.");
Copy link
Member

Choose a reason for hiding this comment

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

Heads up for the future: You don't need to use is_equal_approx and is_zero_approx to compare integers :)

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.

3 participants