ucsi: Reduce zeros in test constants#70
Merged
RobertZ2011 merged 1 commit intoJun 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces the use of all-zero byte patterns in UCSI-related tests so the tests are more likely to catch regressions in bit/field layout and byte placement.
Changes:
- Updates
CommandHeaderdecoding tests to use a non-zerodata_lenbyte. - Updates
GET_ERROR_STATUSresponse-data test to use non-zero vendor bytes and matching raw byte expectations. - Updates
GET_CONNECTOR_STATUSresponse-data test to set non-zero connector partner flags and corresponding raw bit placements.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/ucsi/mod.rs |
Uses a non-zero data_len in command-header decoding tests to better validate field decoding. |
src/ucsi/lpm/get_error_status.rs |
Replaces mostly-zero vendor test bytes with distinct values and updates the expected raw layout accordingly. |
src/ucsi/lpm/get_connector_status.rs |
Sets non-zero partner_flags and updates expected raw bits to ensure partner-flag packing is exercised. |
Reduce the number of zeros used in test constants to make tests more robust in detecting regressions in field layouts.
77d2e9b to
11ed357
Compare
jerrysxie
approved these changes
Jun 18, 2026
tullom
approved these changes
Jun 18, 2026
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.
Reduce the number of zeros used in test constants to make tests more robust in detecting regressions in field layouts.