Add 39 C++ MSTest tests for MeasureTool#46933
Open
crutkas wants to merge 4 commits intomicrosoft:mainfrom
Open
Add 39 C++ MSTest tests for MeasureTool#46933crutkas wants to merge 4 commits intomicrosoft:mainfrom
crutkas wants to merge 4 commits intomicrosoft:mainfrom
Conversation
BGRATextureView pixel indexing and color proximity, edge detection (uniform, centered/corner/asymmetric boxes, tolerance), unit conversion (pixel/inch/cm/mm with DPI scaling), and constants validation (frame rate, font size, opacity). Split from PR microsoft#46905 (4/7) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
DHowett
requested changes
Apr 12, 2026
Member
DHowett
left a comment
There was a problem hiding this comment.
An engineer--not a computer--needs to verify each of these test cases to ensure that they are worthwhile and on-target.
…nt tests - Kept 19 BGRATextureView + EdgeDetection tests (all call real product code) - Deleted 12 hollow UnitConversion tests that reimplemented Convert() locally - Trimmed Constants to 2 safety-critical values (TargetFrameRate, MouseWheelToleranceStep) - Added 8 real Measurement class tests via MeasurementForTests.cpp - Added PixelsClose total-mode large diff test documenting & 0xFF truncation bug - Every test has deep comments explaining what product code it exercises and why - Documented 3 product bugs: mm formula 100x wrong, & 0xFF truncation, FindEdge boundary Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Deleted MeasurementForTests.cpp/h (copy-pasted product code). Now compiles the real MeasureToolCore/Measurement.cpp in the test project. Added #ifndef UNIT_TEST guards around WinRT-dependent functions (InitResources, GetUnitAbbreviation, Print, PrintToStream) that the tests don't need — Width/Height/GetUnitFromIndex/Convert are tested using the exact product code. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
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.
Summary
39 new TEST_METHODs covering MeasureTool:
Split from #46905 (4/7) — see that PR for full context.
Files Changed (7)
src/modules/MeasureTool/UnitTests/MeasureToolTests.cpp(new)src/modules/MeasureTool/UnitTests/UnitTests-MeasureTool.vcxproj(new)src/modules/MeasureTool/UnitTests/UnitTests-MeasureTool.vcxproj.filters(new)src/modules/MeasureTool/UnitTests/packages.config(new)src/modules/MeasureTool/UnitTests/pch.cpp(new)src/modules/MeasureTool/UnitTests/pch.h(new)PowerToys.slnx(modified — +1 project ref in /modules/MeasureTool/Tests/)