-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Do tests really use images from 'ReferenceOutput' folder? #2158
Comments
Nice catch! Looks like a bug sneaked into our ImageSharp/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs Lines 624 to 628 in 75dc96a
Other encoder tests seem to be correct. |
Note that the mentioned PNG tests are validating generated images. Tests which are working with file inputs are using a utility method ImageSharp/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs Lines 364 to 365 in 2aa150c
It compares the original image to the one re-decoded from the ImageSharp encoder output by a reference decoder, therefore it doesn't need reference images. Questionable approach for Jpeg, but still used in the current tests. |
I don't really have an idea how to compare new output color types in jpeg encoder. Funny thing, current tests found a bug in my PR :D |
@antonfirsov We actually do the same in the Bmp Encoder tests for quantized images. |
What would be a solution to fix this issue?
|
I'll have to re-read our tests. As a side I really want to put some time to focus on cleaning up our test suite. It's difficult to navigate. |
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
main branch
Other ImageSharp packages and versions
None
Environment (Operating system, version and so on)
Windows 10
.NET Framework version
net6
Description
I was writing tests for jpeg encoder PR and looked at the tests which compare saved images to reference images from 'ReferenceOutput' folder. Thing is, I don't see anything related to that folder in test code. Just to be sure I've deleted 'ReferenceOutput/PngEncoderTests' folder and all of png encoder tests still pass.
Most likely I've missed something but I just can't see any connections to this folder in test code.
Steps to Reproduce
Delete 'ReferenceOutput/PngEncoderTests' folder and launch png tests.
Images
No response
The text was updated successfully, but these errors were encountered: