-
Notifications
You must be signed in to change notification settings - Fork 41
Restructure bitmap unit tests file #134
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
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.
Summary
- this code is good enough to approve for the 2nd peer review
Type of Change
- This piece of code correctly identifies the changes made being a modification and adding functions
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 deal with edge cases well
Test Thoroughness
- Tested in sktest and sk_unit_test and they both worked
Backward Compatibility
- The code doesn't break existing functionality in the way it works.
Performance Considerations
- Performance works well but it isn't usually a consideration for this type of change
Security Concerns
- This code has no impact negatively or positively for security.
Dependencies
- There are no new added dependencies.
Documentation
- The documentation provided is through and simple to follow at the same time
rory-cd
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.
General Information
Type of Change:
- Unit test improvement
This PR greatly improves the structure of the bitmap unit tests file, with sections isolating functionality, and appropriate resource cleanup. Tests are made more robust with the addition of many edge cases.
Code Quality
- Repository: Pull Request is made to the correct repository
- Readability: The code is easy to read and follow, broken into logical sections
- Maintainability: The code could easily be maintained or extended in the future
Functionality
- Correctness: The code meets the requirements of the task
- Impact on Existing Functionality: The impact on existing functionality has been considered
Testing
- Test Coverage: Unit tests provided for new or modified code
- Test Results: All test passed with
skunit_test(73 new assertions in 7 test cases)
Documentation
- Documentation: Inline documentation is updated and clear
Pull Request Details
- PR Description: The problem being solved is clearly described
- Checklist Completion: All relevant checklist items have been reviewed and completed
Optional Improvements
- Use
Approx()for floating point comparisons - Use logging handling to suppress expected warning messages
- Use general
"[bitmap]"tag on each test case to improve test targeting - Suggest
REQUIRE(rocket_bmp != nullptr)rather thanREQUIRE_FALSE(rocket_bmp == nullptr), as readability is slightly better
Description
According to the Thoth Tech guide for writing unit tests, you should aim to isolate functionality as much as possible when creating a test. The unit testing for bitmap functions doesn't follow this convention, as many unit tests are testing multiple functions at the same time and some functions are getting tested repeatedly by separate tests. This isn't ideal so what I have done is try to restructure the bitmap unit tests file such that each test only tests the fewest number of bitmap functions at a time and each test is mutually exclusive, meaning that they are isolated as much as possible.
Type of change
How Has This Been Tested?
This has been tested by running all unit tests in a randomized order and ensuring that all tests pass.
Tests can be run from either the terminal or directly from VS Code using Cmake Tools. For more information, please consult the Thoth Tech documentation.
Testing Checklist
Checklist