Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test code never executes - ill defined loop #175

Closed
ariccio opened this issue Mar 7, 2019 · 1 comment · Fixed by #465
Closed

Test code never executes - ill defined loop #175

ariccio opened this issue Mar 7, 2019 · 1 comment · Fixed by #465
Assignees
Labels
fixed help wanted Issues identified as good community contribution opportunities Pri: 3

Comments

@ariccio
Copy link

ariccio commented Mar 7, 2019

NumbersAndOperatorsEnum::Add is never <= NumbersAndOperatorsEnum::None, so the test never executes.

Describe the bug
Someone wanted to write some unit tests, and idk, maybe they thought that CM::Command::CommandNULL was >=NumbersAndOperatorsEnum::Add because it was lower on the screen... but, alas, it's not:
enum_add
enum_none

Steps To Reproduce

I just enabled code analysis. C'mon, Microsoft, it's your own tool!

@MicrosoftIssueBot
Copy link
Collaborator

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

@danbelcher-MSFT danbelcher-MSFT added triage approved Issue has been approved by Calculator team member and removed investigate labels Mar 21, 2019
@danbelcher-MSFT danbelcher-MSFT added the help wanted Issues identified as good community contribution opportunities label Apr 11, 2019
@danbelcher-MSFT danbelcher-MSFT removed their assignment Apr 11, 2019
@EriWong EriWong self-assigned this Apr 18, 2019
EriWong added a commit to EriWong/calculator that referenced this issue Apr 18, 2019
Test code never executes - ill defined loop
EriWong added a commit to EriWong/calculator that referenced this issue Apr 18, 2019
Test code never executes - ill defined loop
HowardWolosky pushed a commit that referenced this issue Apr 19, 2019
Fixes #175.
Fixes loop in test code to verify that commands not supported by the unit converter viewmodel result in no-op.

Description of the changes:
Removed loop of range of enums with a being tested for no-ops since it added no intrinsic value (and the way that the range was handled was incorrect).  Considered adding an iterator over a static list of commands to validate against, but determined it didn't add any notable value.

How changes were validated:
Ran modified test to ensure it passes
@MicrosoftIssueBot MicrosoftIssueBot added fixed and removed triage approved Issue has been approved by Calculator team member Bug Issue is a bug labels Apr 19, 2019
EriWong added a commit to EriWong/calculator that referenced this issue Jun 5, 2019
Fixes microsoft#175.
Fixes loop in test code to verify that commands not supported by the unit converter viewmodel result in no-op.

Description of the changes:
Removed loop of range of enums with a being tested for no-ops since it added no intrinsic value (and the way that the range was handled was incorrect).  Considered adding an iterator over a static list of commands to validate against, but determined it didn't add any notable value.

How changes were validated:
Ran modified test to ensure it passes
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed help wanted Issues identified as good community contribution opportunities Pri: 3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants