Fix legacy Green/Blue lightbar channels parsing the Red element's value#47
Open
anagnorisis2peripeteia wants to merge 1 commit into
Open
Conversation
In PostProcessXml's legacy per-channel colour path, the green and blue channels both parsed RedColorString instead of their own GreenColorString / BlueColorString, so a profile using the old separate <Red>/<Green>/<Blue> elements loaded with all three channels set to the red value and the lightbar showed the wrong colour. Parse each channel from its own element, and add a regression test that deserializes a legacy per-channel profile and asserts the mapped DS4Color channels individually.
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.
In
ProfileDTO.PostProcessXml, the legacy per-channel lightbar colour path parses the wrong source strings: the green and blue channels both readRedColorStringinstead ofGreenColorString/BlueColorString. A profile that stores its colour as the old separate<Red>/<Green>/<Blue>elements (rather than the combined<Color>) loads with all three channels set to the red value, so the lightbar shows the wrong colour.The fix: parse each channel from its own element (two-line change), plus a regression test that deserializes a legacy per-channel profile (
Red=10, Green=20, Blue=30) and asserts the mappedDS4Colorchannels individually.Before/after:
Assert.AreEqual failed. Expected:<20>. Actual:<10>(green channel received red's value).Bug 2 of #46 — found while mutation-testing the profile-serialization code (#37): the surviving mutants pointed at this block being unasserted, and reading it turned up the copy-paste slip.
Local review history: https://gist.github.com/anagnorisis2peripeteia/b97ed542427a5e3fe0184c8074873a24
Proof manifest
Before / After (same command, same machine)
ba4bdcb)Assert.AreEqual failed. Expected:<20>. Actual:<10>.— green channel received the Red element's valueaef33d4)Structured before/after manifest for the red-green evidence already in this description (regression test Expected:<20> Actual:<10> on base; passes on this branch; no new failures in the full suite).
Manifest + raw run outputs: https://gist.github.com/anagnorisis2peripeteia/5f618fc106fac64e4baa18fc28636a8e