Skip to content

ucsi: Reduce zeros in test constants#70

Merged
RobertZ2011 merged 1 commit into
OpenDevicePartnership:mainfrom
RobertZ2011:ucsi-test-less-zeros
Jun 18, 2026
Merged

ucsi: Reduce zeros in test constants#70
RobertZ2011 merged 1 commit into
OpenDevicePartnership:mainfrom
RobertZ2011:ucsi-test-less-zeros

Conversation

@RobertZ2011

Copy link
Copy Markdown
Contributor

Reduce the number of zeros used in test constants to make tests more robust in detecting regressions in field layouts.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CommandHeader decoding tests to use a non-zero data_len byte.
  • Updates GET_ERROR_STATUS response-data test to use non-zero vendor bytes and matching raw byte expectations.
  • Updates GET_CONNECTOR_STATUS response-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.

Comment thread src/ucsi/mod.rs Outdated
Reduce the number of zeros used in test constants to make tests more
robust in detecting regressions in field layouts.
@RobertZ2011 RobertZ2011 force-pushed the ucsi-test-less-zeros branch from 77d2e9b to 11ed357 Compare June 18, 2026 16:22
@RobertZ2011 RobertZ2011 marked this pull request as ready for review June 18, 2026 16:23
@RobertZ2011 RobertZ2011 requested a review from a team as a code owner June 18, 2026 16:23
@RobertZ2011 RobertZ2011 merged commit 95ca690 into OpenDevicePartnership:main Jun 18, 2026
10 checks passed
@RobertZ2011 RobertZ2011 deleted the ucsi-test-less-zeros branch June 18, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants