-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Remove unused local variables and methods from System.Drawing.Common #39551
Remove unused local variables and methods from System.Drawing.Common #39551
Conversation
Remove unused locals, and update a few unit tests that has no asserts.
Tagging subscribers to this area: @safern, @tannergooding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
One failure in WASM
|
Thanks for that! This was a case of a test that wasn't asserting anything, so my initial change was to default to true. From code inspection it looks like on "unix" systems If there are Windows tests that have / simulate a duplex printer, then I'll weaken the assert to just verify that the property doesn't throw and use a discard to avoid tripping the unused local check. |
I only know of |
I was going to comment that actually but then thought it might just work and now I remember we intentionally don't assert on those properties, just make sure they "work" don't fail, since we can guarantee they will have the same behavior specially because the installed printers can be different in every computer we use to run tests and in every platform. |
Since the tests run across different printer hardware they can't take a dependency on the default printer settings. Revert adding asserts in these cases so the tests still verify that the properties don't throw.
f61fda0
to
7b3cb5e
Compare
This makes sense! I was a bit confused when I saw tests that looked like they weren't verifying anything -- the "assert that it doesn't throw" behavior makes sense now that you mention it. I've undone my changes for all 4 tests in that area. If you have any questions, please let me know. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again 😄
Hello @danmosemsft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…otnet#39551) * Remove unused local variables and methods from System.Drawing.Common Remove unused locals, and update a few unit tests that has no asserts. * Revert adding asserts in tests Since the tests run across different printer hardware they can't take a dependency on the default printer settings. Revert adding asserts in these cases so the tests still verify that the properties don't throw.
Remove unused locals, and update a few unit tests that had no asserts.
Fixes a part of #30457