Add advanced tests#6
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR significantly improves MinUI's codebase architecture by extracting logic from monolithic files into reusable, testable modules. The main focus is on improving testability by separating pure logic from SDL/platform dependencies and adding comprehensive unit test coverage.
Key Changes:
- Extracted data structures (Array, Hash) from minui.c to collections.c for reusability
- Separated input handling logic (PAD_*) from api.c to pad.c for isolated testing
- Moved text rendering utilities (GFX_*) from api.c to gfx_text.c
- Created parsers for various file formats (M3U, map.txt, recent.txt, collections)
- Added path generation utilities and binary file I/O helpers
- Implemented comprehensive unit tests with mocking support (fff framework, file system mocks)
- Updated makefiles to include new source files in builds
Reviewed Changes
Copilot reviewed 63 out of 66 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| workspace/all/common/collections.{c,h} | Extracted Array and Hash data structures for reusability |
| workspace/all/common/pad.{c,h} | Separated input state management from SDL dependencies |
| workspace/all/common/gfx_text.{c,h} | Extracted text rendering utilities for testing |
| workspace/all/common/*_parser.{c,h} | New parsers for M3U, map.txt, collections, recent.txt files |
| workspace/all/common/minui_*.{c,h} | Helper utilities and file checking functions |
| workspace/all/common/minarch_paths.{c,h} | Path generation for save files |
| workspace/all/common/audio_resampler.{c,h} | Audio resampling algorithm extraction |
| workspace/all/common/binary_file_utils.{c,h} | Binary file I/O utilities |
| workspace/all/common/api.c | Removed extracted code, added includes for new modules |
| workspace/all/minui/minui.c | Removed data structures now in collections.c |
| workspace/all/*/makefile | Updated to include new source files in compilation |
| tests/unit/all/common/test_*.c | Comprehensive unit tests for all new modules |
| tests/support/* | Testing infrastructure (SDL stubs, fakes, mocks) |
| tests/integration/integration_support.{c,h} | Support utilities for integration tests |
| makefile* | Documentation improvements and qa target fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Added tests that need mocks and integration tests. This involves a lot of refactoring to make the code more testable. During review we need to be extra mindful of not regressing any features.