-
Notifications
You must be signed in to change notification settings - Fork 40
Add unit tests for camera #123
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
base: main
Are you sure you want to change the base?
Conversation
Was checking top left coordinates rather than centered camera coordinates
Broccoli811
left a comment
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.
The new test file for the camera module looks solid. It covers a broad range of key functionalities for a camera function, and it is well documented and readable to me.
All tests passed successfully in my environment, and the expected results match the documented behavior in camera.cpp
A suggestion that could be useful is to add edge case tests for when the camera is moved to negative/unreasonable coordinates or when the rectangles lie exactly on the screen border. This may ensure behavior is consistent in those scenarios.
Also, you may want to update the company board card on your additions/tests and potentially reference the camera.cpp document, it may sound trivial to some, but it doesn't hurt to add more context to the card for the next reviewer :)
Overall, great implementation!
JPF2209
left a comment
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.
Type of Change
- This piece of code correctly identifies the changes made being adding additional tests
Code Readability
- The code is very understandable and clear in what it needs to be comparing it to the other code.
Maintainability
- As this is in the same style as the other code, it's quite maintainable being simple while doing the job.
Code Simplicity
- This code is simple in it's execution following established design patterns and best practices
Edge Cases
- The code deals with edge cases simply since the inner functionality of the test code manages this
Test Thoroughness
- For all the key tests in this type of scenario, this covers it all and the code has been tested in multiple environments and it works.
Backward Compatibility
- The code doesn't break existing functionality in the way it works.
Performance Considerations
- Performance is usually more of a concern with the function itself but this works out well for performance.
Security Concerns
- Ensure to fulfilll branch protection policy
Dependencies
- There are no new added dependencies.
Documentation
- The documentation provided is through and simple to follow at the same time
Description
This adds tests for the camera functions in camera.cpp. Duplicate of #119 but without the tag changes.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Testing Checklist
I've verified that the tests run and assertions pass as expected. I've also run code coverage which reports 80% coverage for camera.cpp
Checklist