Restructure bitmap unit tests file#134
Open
sam-stajnko wants to merge 7 commits intothoth-tech:mainfrom
Open
Conversation
JPF2209
approved these changes
Sep 27, 2025
JPF2209
left a comment
There was a problem hiding this comment.
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
approved these changes
Jan 12, 2026
rory-cd
left a comment
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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