Browse Source

Disable double index smoke test

I'm not 100% sure whether this test is practical.
af/merge-core
James Jackson-South 9 years ago
parent
commit
a46e5fc59f
  1. 83
      tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs

83
tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs

@ -59,47 +59,48 @@ namespace ImageSharp.Tests.Formats.Png
} }
} }
[Theory] // JJS: Commented out for now since the test does not take into lossy nature of indexing.
[WithTestPatternImages(100, 100, PixelTypes.Color)] //[Theory]
public void CanSaveIndexedPngTwice<TColor>(TestImageProvider<TColor> provider) //[WithTestPatternImages(100, 100, PixelTypes.Color)]
where TColor : struct, IPixel<TColor> //public void CanSaveIndexedPngTwice<TColor>(TestImageProvider<TColor> provider)
{ // where TColor : struct, IPixel<TColor>
// does saving a file then repoening mean both files are identical??? //{
using (Image<TColor> source = provider.GetImage()) // // does saving a file then repoening mean both files are identical???
using (MemoryStream ms = new MemoryStream()) // using (Image<TColor> source = provider.GetImage())
{ // using (MemoryStream ms = new MemoryStream())
source.MetaData.Quality = 256; // {
source.Save(ms, new PngEncoder(), new PngEncoderOptions { // source.MetaData.Quality = 256;
Threshold = 200 // source.Save(ms, new PngEncoder(), new PngEncoderOptions {
}); // Threshold = 200
ms.Position = 0; // });
using (Image img1 = Image.Load(ms, new PngDecoder())) // ms.Position = 0;
{ // using (Image img1 = Image.Load(ms, new PngDecoder()))
using (MemoryStream ms2 = new MemoryStream()) // {
{ // using (MemoryStream ms2 = new MemoryStream())
img1.Save(ms2, new PngEncoder(), new PngEncoderOptions // {
{ // img1.Save(ms2, new PngEncoder(), new PngEncoderOptions
Threshold = 200 // {
}); // Threshold = 200
ms2.Position = 0; // });
using (Image img2 = Image.Load(ms2, new PngDecoder())) // ms2.Position = 0;
{ // using (Image img2 = Image.Load(ms2, new PngDecoder()))
using (PixelAccessor<Color> pixels1 = img1.Lock()) // {
using (PixelAccessor<Color> pixels2 = img2.Lock()) // using (PixelAccessor<Color> pixels1 = img1.Lock())
{ // using (PixelAccessor<Color> pixels2 = img2.Lock())
for (int y = 0; y < img1.Height; y++) // {
{ // for (int y = 0; y < img1.Height; y++)
for (int x = 0; x < img1.Width; x++) // {
{ // for (int x = 0; x < img1.Width; x++)
Assert.Equal(pixels1[x, y], pixels2[x, y]); // {
} // Assert.Equal(pixels1[x, y], pixels2[x, y]);
} // }
} // }
} // }
} // }
} // }
} // }
} // }
//}
[Theory] [Theory]
[WithTestPatternImages(300, 300, PixelTypes.All)] [WithTestPatternImages(300, 300, PixelTypes.All)]

Loading…
Cancel
Save