Add test cases to unit_test_text.cpp#165
Open
kyriesk wants to merge 1 commit intothoth-tech:mainfrom
Open
Conversation
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 targeted at
splashkit-core. - Readability: High. The code follows the established Catch2 pattern used throughout the repository. Sections are well-named and logic is easy to follow.
- Maintainability: High. The tests are modular and can be easily extended as new text features are added.
Functionality
- Correctness: The tests accurately verify the core functionality of the text module, including:
- Font loading and retrieval (
load_font,font_named). - Availability checks (
has_font). - Font style manipulation (
set_font_style,get_font_style). - Font size management (
font_has_size,font_load_size).
- Font loading and retrieval (
- Impact on Existing Functionality: No impact on existing library functionality as these are strictly test additions.
Testing
- Test Coverage: This PR significantly improves test coverage for the text module.
- Test Results: Logic check confirms the tests are valid. (Note: Local execution in this environment was limited by missing graphics context, but the code adheres to successful patterns seen in
unit_test_geometry.cppand others).
Documentation
- Documentation: The code is self-documenting through clear test case and section naming.
Pull Request Details
- PR Description: The purpose of the PR (improving test coverage for text) is clear from the file content.
- Checklist Completion: All relevant items reviewed.
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 PR adapts font-related tests from
test_text.cpp(sktest) into comprehensive unit tests forunit_test_text.cpp(skunit_tests). Previously, font functionality testing was only available in the manual sktest suite. This change brings robust, automated unit test coverage for the font API, including:Fixes # (none - feature enhancement)
Type of change
How Has This Been Tested?
The new unit tests have been structured following the Catch2 framework conventions already in use by skunit_tests. Tests cover:
Font Style Tests: Verify that all font styles can be set and retrieved correctly
Font Size Tests: Verify font size preloading and availability checking
Font Availability Tests: Verify font loading and retrieval
Testing Checklist
All tests were run and verified to pass:
Checklist