@@ -14,22 +14,32 @@ public partial class JpegDecoderTests
1414 public const string DecodeProgressiveJpegOutputName = "DecodeProgressiveJpeg" ;
1515
1616 [ Theory ]
17- [ WithFileCollection ( nameof ( ProgressiveTestJpegs ) , PixelTypes . Rgba32 , false ) ]
18- [ WithFile ( TestImages . Jpeg . Progressive . Progress , PixelTypes . Rgba32 , true ) ]
19- public void DecodeProgressiveJpeg < TPixel > ( TestImageProvider < TPixel > provider , bool enforceDiscontiguousBuffers )
17+ [ WithFileCollection ( nameof ( ProgressiveTestJpegs ) , PixelTypes . Rgba32 ) ]
18+ public void DecodeProgressiveJpeg < TPixel > ( TestImageProvider < TPixel > provider )
2019 where TPixel : unmanaged, IPixel < TPixel >
20+ {
21+ using Image < TPixel > image = provider . GetImage ( JpegDecoder ) ;
22+ image . DebugSave ( provider ) ;
23+
24+ provider . Utility . TestName = DecodeProgressiveJpegOutputName ;
25+ image . CompareToReferenceOutput (
26+ GetImageComparer ( provider ) ,
27+ provider ,
28+ appendPixelTypeToFileName : false ) ;
29+ }
30+
31+ [ Theory ]
32+ [ WithFile ( TestImages . Jpeg . Progressive . Progress , PixelTypes . Rgba32 ) ]
33+ public void DecodeProgressiveJpeg_WithLimitedAllocatorBufferCapacity ( TestImageProvider < Rgba32 > provider )
2134 {
2235 static void RunTest ( string providerDump , string nonContiguousBuffersStr )
2336 {
24- TestImageProvider < TPixel > provider =
25- BasicSerializer . Deserialize < TestImageProvider < TPixel > > ( providerDump ) ;
37+ TestImageProvider < Rgba32 > provider =
38+ BasicSerializer . Deserialize < TestImageProvider < Rgba32 > > ( providerDump ) ;
2639
27- if ( ! string . IsNullOrEmpty ( nonContiguousBuffersStr ) )
28- {
29- provider . LimitAllocatorBufferCapacity ( ) . InBytesSqrt ( 200 ) ;
30- }
40+ provider . LimitAllocatorBufferCapacity ( ) . InBytesSqrt ( 200 ) ;
3141
32- using Image < TPixel > image = provider . GetImage ( JpegDecoder ) ;
42+ using Image < Rgba32 > image = provider . GetImage ( JpegDecoder ) ;
3343 image . DebugSave ( provider , nonContiguousBuffersStr ) ;
3444
3545 provider . Utility . TestName = DecodeProgressiveJpegOutputName ;
@@ -44,8 +54,8 @@ static void RunTest(string providerDump, string nonContiguousBuffersStr)
4454 RemoteExecutor . Invoke (
4555 RunTest ,
4656 providerDump ,
47- enforceDiscontiguousBuffers ? "Disco" : string . Empty )
48- . Dispose ( ) ;
57+ "Disco" )
58+ . Dispose ( ) ;
4959 }
5060 }
5161}
0 commit comments