-
Notifications
You must be signed in to change notification settings - Fork 0
Add advanced tests #6
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
Conversation
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.
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.
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.