Skip to content

Fix stale/inaccurate comments in UpdateVersion test cases#511

Merged
jgeurten merged 2 commits into
add-test-casesfrom
copilot/sub-pr-509
Mar 23, 2026
Merged

Fix stale/inaccurate comments in UpdateVersion test cases#511
jgeurten merged 2 commits into
add-test-casesfrom
copilot/sub-pr-509

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 20, 2026

Test comments described a "double increment" carry behavior that doesn't exist in UpdateVersion. The actual loop increments at position i, resets to 0 and moves to i-1 on overflow, then breaks on the next non-overflowing increment — no position ever gets incremented twice.

Changes

  • UpdateVersion_MaxLastPart_RollsOverCascades: Replaced misleading "incremented TWICE" explanation with accurate per-iteration trace
  • UpdateVersion_MaxThirdPart_RollsOverCascades: Corrected claim that i=1 increments from 1→2; it increments from 0→1 and breaks
  • UpdateVersion_MultipleRollovers_HandlesCorrectly: Removed "loop continues and third gets incremented again" narrative; replaced with accurate step-by-step trace and dropped the incorrect inline Assert comment

Before → After (example)

// Before (inaccurate):
// Loop at i=3: 65535 >= MaxValue, so set to 0 and increment position 2 to 1
// Loop at i=2: position 2 is 1 (not at max), so increment again to 2 and break
// Result: position gets incremented TWICE (once in rollover, once in loop)

// After (accurate):
// i=3: versionIdx[3]++ -> 65536 >= MaxValue, reset to 0, move to i=2
// i=2: versionIdx[2]++ -> 1, below max, break

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] [WIP] Address feedback on test cases for the Wizard Fix stale/inaccurate comments in UpdateVersion test cases Mar 20, 2026
Copilot AI requested a review from jgeurten March 20, 2026 18:51
@jgeurten jgeurten marked this pull request as ready for review March 23, 2026 15:29
@jgeurten jgeurten merged commit fa1cad8 into add-test-cases Mar 23, 2026
1 check passed
@jgeurten jgeurten deleted the copilot/sub-pr-509 branch March 23, 2026 15:29
jgeurten added a commit that referenced this pull request Mar 23, 2026
* Added test unit tests

* Fixed version tests and logic

* Added EKU and COM tests

* Fixed EKU test

* Update .gitignore

* Update WDAC-Policy-Wizard/WDAC-Wizard.Tests/HelperTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update WDAC-Policy-Wizard/app/WDAC Wizard.sln

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix stale/inaccurate comments in UpdateVersion test cases (#511)

* Initial plan

* Fix stale comments in UpdateVersion test cases to match actual implementation

Co-authored-by: jgeurten <23045608+jgeurten@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MicrosoftDocs/WDAC-Toolkit/sessions/6c0a8b8c-31b6-4779-b9a7-baa99617b602

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jgeurten <23045608+jgeurten@users.noreply.github.com>

* Update .gitignore

* Updated git ignore

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jgeurten <23045608+jgeurten@users.noreply.github.com>
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.

2 participants