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

Revised & extended test coverage for Resize #782

Merged
merged 10 commits into from Dec 10, 2018
Merged

Conversation

antonfirsov
Copy link
Member

@antonfirsov antonfirsov commented Nov 30, 2018

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Issues addressed:

  • There were no test cases for scale-up
  • Resize_WorksWithAllResamplers was not covering all resamplers
  • Resize was not tested for non-typical dimensions values

All new test cases were by changing/extending the input for Resize_WorksWithAllResamplers. We need these tests to implement #642 in a safe way.

Unrelated changes:

  • TolerantMath.Default is a readonly field now
  • Minor additions + code cleanup in test utilities

@codecov
Copy link

codecov bot commented Nov 30, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@dce781d). Click here to learn what that means.
The diff coverage is 95.12%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #782   +/-   ##
=========================================
  Coverage          ?   88.68%           
=========================================
  Files             ?     1012           
  Lines             ?    43306           
  Branches          ?     3185           
=========================================
  Hits              ?    38404           
  Misses            ?     4197           
  Partials          ?      705
Impacted Files Coverage Δ
src/ImageSharp/Common/Helpers/TolerantMath.cs 100% <100%> (ø)
...ests/TestUtilities/Tests/TestImageProviderTests.cs 97.57% <100%> (ø)
...sing/Processors/Transforms/ResizeKernelMapTests.cs 83.59% <100%> (ø)
...estUtilities/ImageProviders/TestPatternProvider.cs 98.01% <100%> (ø)
...TestUtilities/Attributes/ImageDataAttributeBase.cs 81.66% <100%> (ø)
tests/ImageSharp.Tests/TestUtilities/TestUtils.cs 85% <88%> (ø)
...ts/Processing/Processors/Transforms/ResizeTests.cs 99.52% <97.77%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dce781d...0274eae. Read the comment docs.

// NeirestNeighbourResampler is producing slightly different results With classic .NET framework on 32bit
// most likely because of differences in numeric behavior.
// The difference is well visible when comparing output for
// Resize_WorksWithAllResamplers_TestPattern301x1180_NearestNeighbor-300x480.png
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is worth to check (and cry).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth us trying to fix it. NN is low quality anyway and 32bit NET Framework would be increasingly rare. I’d put a note and skip test on those platforms.

@JimBobSquarePants JimBobSquarePants merged commit 4544512 into master Dec 10, 2018
@JimBobSquarePants JimBobSquarePants deleted the af/resize1 branch December 10, 2018 21:26
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.

None yet

2 participants