Repository navigation
Clean up System.Drawing.Common unit tests - #38771
stephentoub merged 19 commits into
Conversation
|
@qmfrederick, thanks for the PRs, but I'd prefer so many commits all doing the same thing just in different tests don't clutter commit history. Can you please combine them into a single PR? I'm going to close the others and you can cherry-pick them into this one. Thanks. |
|
@stephentoub Sure, I'll get the commits in a single PR. The tests are still a bit finicky (running them all on macOS causes the test process to abort, apparently because of an exception in a finalizer). I'd like to get a clear indication on which set of changes may cause a regression, and running the tests locally only covers one of the many OS configurations. Hence the smaller PRs. Having the CI run in parallel speeds up things. I'll cherry-pick the 'green' PRs into this one, re-open the PRs failing CI until they are stable, and then cherry-pick them into this PR. Hope that works for you. |
|
So it turns out that except for one, all other PRs failed because of CI flakes. So that simplifies things 😄 . |
|
Thanks, @qmfrederik! |
This test was previously disabled (because it was incorrectly marked as a theory instead of a fact). This is the current behavior on NetFX.
|
|
||
| [ConditionalTheory(Helpers.IsDrawingSupported)] | ||
| public void SurroundColors_Null_ThrowsArgumentNullException() | ||
| [ConditionalFact(Helpers.IsDrawingSupported)] |
There was a problem hiding this comment.
FYI @ViktorHofer, as this will conflict with your xunit test cleanup.
stephentoub
left a comment
There was a problem hiding this comment.
Thank you for cleaning all this up. A few comments to be addressed, but otherwise LGTM.
* LinearGradientBrushTests: Add missing using statements * EncoderParametersTests: Add missing using statements * EncoderParametertests: Additional using statements * GraphicsPathTests: Add using statements * Add missing using statements * RegionTests: Add missing using statements * Fix typo * MatrixTests: Add using statements * GraphicsTests: Add missing using statements * Fix ConditionalTheory -> ConditionalFact * Clone the clip before applying a transform * Convert Rotate1bit4bit to a theory * SurroundColors_Null_ThrowsArgumentNullException: Theory -> Fact * Check for a NullReferenceException instead of an ArgumentNullException This test was previously disabled (because it was incorrectly marked as a theory instead of a fact). This is the current behavior on NetFX. * No parameter name to validate * Don't use statics for disposed objects * Invoke the finalizer during the test * PR feedback * PR feedback Commit migrated from dotnet/corefx@8ede3e8
IDisposableand use native resources. Make sure these types are wrapped in ausingstatement in the unit tests.BitmapTests.Rotate1bit4bitto a theory, and prevent it from using/tmpdirectlyScaleTransform_ZeroZero_ThrowsArgumentExceptionandSurroundColors_Null_ThrowsArgumentNullExceptionfrom a theory to a fact (they have no test parameters)