Repository navigation
Conversation
Create a distortion manager class singleton to load image capture card distortion setting from the test repo. This class will then work with the rest of the test framework to apply color distortions to test images Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mysticial
reviewed
Oct 11, 2026
| // `UNIT_TEST_RESOURCE_PATH()`, e.g. "NintendoSwitch/UpdateMenuDetector/English_1_True.png". | ||
| // This is useful for tracking and managing image assets at runtime along with applying the | ||
| // correct image distortion to augment test coverage. | ||
| virtual std::vector<std::string> image_paths() const{ |
Collaborator
There was a problem hiding this comment.
This UnitTest file is not the right place to put specific stuff like image distortions. This is a generic API and we shouldn't be adding test-specific plugs into it.
Is there another way to architect this? Like just a helper function that takes a ImageViewRGB32 and returns a brand new ImageRGB32 with the distortions? Then we plug it into the call sites? Because your follow up PR is already just as invasive in touching all the call sites.
Mysticial
reviewed
Oct 11, 2026
| @@ -24,6 +24,10 @@ namespace PokemonAutomation{ | |||
| class UnitTestRunner final : public CancellableScope{ | |||
Collaborator
There was a problem hiding this comment.
Same thing with these two files. Test-specific stuff like image distortions should not be leaking into the generic test API.
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.
Add color distortion to image tests to widen test coverage.
This only changes the test framework, but still requires another PR to change individual unit tests to really use the distortion feature.
Vibe coded by Claude but I've personally review each line of the code.
Design:
Create a TestImageDistortionManager to manage the distortion data asset. This is a global singleton.
The test framework will initialize that manager. For each test at runtime, the runner will query the image paths each test provides from the manager, and manager will give a list of distortions to apply on the given images.
Each unit test will need to call a image color distortion function to apply each given distortion onto its loaded image, internally.