-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 the Image class #45737
Conversation
tests/test_image.h
Outdated
Ref<Image> image = memnew(Image(8, 4, false, Image::FORMAT_LA8)); | ||
CHECK_MESSAGE( | ||
image->get_width() == 8, | ||
"get_width() should return the expected value."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These type of messages are redundant in my opinion ("X expected to be Y"). I'd just use CHECK()
macro for those. My rule of thumb is: if I start to write rationale which contains the "expected" word, I just replace CHECK_MESSAGE
to CHECK
. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right, I changed some of the checks to just CHECK()
.
c1811a1
to
7a918ba
Compare
Thanks! |
Part of #43440. I created a test suite for the Image class. This is my first time ever writing unit tests (and my second PR to Godot), so feedback is appreciated! The tests cover:
The test suit is incomplete, the methods missing include most notably compression and mipmaps-related methods, bumpmap_to_normalmap(), srgb_to_linear() and some others, because I am not entirely sure how they work as I haven't used them so far.