Add 'bitmap creation, save, load, and pixel verification' test#161
Open
kyriesk wants to merge 1 commit intothoth-tech:mainfrom
Open
Add 'bitmap creation, save, load, and pixel verification' test#161kyriesk wants to merge 1 commit intothoth-tech:mainfrom
kyriesk wants to merge 1 commit intothoth-tech:mainfrom
Conversation
…t_test_graphics.cpp
222448082Ashen
approved these changes
May 8, 2026
222448082Ashen
left a comment
There was a problem hiding this comment.
General Information
- Type of Change: New feature (Unit Testing)
Code Quality
- Repository: Correct. The PR is made to
splashkit-core. - Readability: High. The comments clearly explain each step of the test (creating the pattern, verifying rows).
- Maintainability: High. Uses standard SplashKit color and bitmap functions.
Functionality
- Correctness: The test case title mentions "load", but the implementation currently lacks a
load_bitmapstep. It verifies the pixels on the originaltest_bmpin memory but does not verify if the saved file on disk can be successfully reloaded and contains the correct data. - Impact on Existing Functionality: No impact on existing code.
Testing
- Test Coverage: This PR adds valuable testing for
get_pixelandsave_bitmap. - Test Completeness: To fully satisfy the "save and load" requirement in the title, the test should load the saved bitmap from disk into a second bitmap object and compare its pixels to the expected colors.
Documentation
- Documentation: The test code is well-commented and self-explanatory.
Pull Request Details
- Checklist Completion: All relevant items reviewed.
Recommendations & Observations
|
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
This pull request adds comprehensive unit tests for bitmap creation, manipulation, and saving functionality in SplashKit. The new test verifies that bitmaps can be created with specific dimensions, filled with different colors using
fill_rectangle_on_bitmap(), and that individual pixels can be correctly retrieved and verified usingget_pixel()with color component extraction functions.The test creates a 5x5 bitmap with five distinct color rows (white, red, green, blue, and black), then validates each color by checking the RGB components of sampled pixels to ensure the bitmap graphics functions work correctly.
Type of change
Changes Made
"bitmap creation, save, and pixel verification"tocoresdk/src/test/unit_tests/unit_test_graphics.cppcreate_bitmap()- bitmap creation with specified dimensionsfill_rectangle_on_bitmap()- filling bitmap regions with colorscolor_white(),color_red(),color_green(),color_blue(),color_black()- color creation functionsget_pixel()- pixel retrieval from bitmapred_of(),green_of(),blue_of()- RGB component extractionsave_bitmap()- bitmap persistence to diskfree_bitmap()- resource cleanupHow Has This Been Tested?
The new test was run using the skunit_tests test suite. The test:
get_pixel()and component extractionfree_bitmap()All tests were run and verified to pass:
Testing Checklist
Checklist