11// Copyright (c) Six Labors.
22// Licensed under the Six Labors Split License.
33
4+ #pragma warning disable xUnit1004 // Test methods should not be skipped
45using System . Numerics ;
56using System . Runtime . InteropServices ;
67using GeoJSON . Net . Feature ;
@@ -73,10 +74,10 @@ private static void CompareToSkiaResultsImpl(TestImageProvider<Rgba32> provider,
7374 appendSourceFileOrDescription : false ) ;
7475
7576 ImageSimilarityReport < Rgba32 , Rgba32 > result = ImageComparer . Exact . CompareImagesOrFrames ( image , skResultImage ) ;
76- throw new Exception ( result . DifferencePercentageString ) ;
77+ throw new ImagesSimilarityException ( result . DifferencePercentageString ) ;
7778 }
7879
79- [ Theory ] // (Skip = "For local testing")]
80+ [ Theory ( Skip = "For local testing" ) ]
8081 [ WithSolidFilledImages ( 3600 , 2400 , "Black" , PixelTypes . Rgba32 , TestImages . GeoJson . States , 16 , 30 , 30 ) ]
8182 public void LargeGeoJson_Lines ( TestImageProvider < Rgba32 > provider , string geoJsonFile , int aa , float sx , float sy )
8283 {
@@ -107,14 +108,14 @@ public void LargeGeoJson_Lines(TestImageProvider<Rgba32> provider, string geoJso
107108 [ WithSolidFilledImages ( 7200 , 3300 , "Black" , PixelTypes . Rgba32 ) ]
108109 public void LargeGeoJson_States_Fill ( TestImageProvider < Rgba32 > provider )
109110 {
110- using Image < Rgba32 > image = this . FillGeoJsonPolygons ( provider , TestImages . GeoJson . States , 16 , new Vector2 ( 60 ) , new Vector2 ( 0 , - 1000 ) ) ;
111+ using Image < Rgba32 > image = FillGeoJsonPolygons ( provider , TestImages . GeoJson . States , true , new Vector2 ( 60 ) , new Vector2 ( 0 , - 1000 ) ) ;
111112 ImageComparer comparer = ImageComparer . TolerantPercentage ( 0.001f ) ;
112113
113114 image . DebugSave ( provider , appendPixelTypeToFileName : false , appendSourceFileOrDescription : false ) ;
114115 image . CompareToReferenceOutput ( comparer , provider , appendPixelTypeToFileName : false , appendSourceFileOrDescription : false ) ;
115116 }
116117
117- private Image < Rgba32 > FillGeoJsonPolygons ( TestImageProvider < Rgba32 > provider , string geoJsonFile , int aa , Vector2 scale , Vector2 pixelOffset )
118+ private static Image < Rgba32 > FillGeoJsonPolygons ( TestImageProvider < Rgba32 > provider , string geoJsonFile , bool aa , Vector2 scale , Vector2 pixelOffset )
118119 {
119120 string jsonContent = File . ReadAllText ( TestFile . GetInputFileFullPath ( geoJsonFile ) ) ;
120121
@@ -123,15 +124,15 @@ private Image<Rgba32> FillGeoJsonPolygons(TestImageProvider<Rgba32> provider, st
123124 Image < Rgba32 > image = provider . GetImage ( ) ;
124125 DrawingOptions options = new ( )
125126 {
126- GraphicsOptions = new GraphicsOptions ( ) { Antialias = aa > 0 } ,
127+ GraphicsOptions = new GraphicsOptions ( ) { Antialias = aa } ,
127128 } ;
128129 Random rnd = new ( 42 ) ;
129130 byte [ ] rgb = new byte [ 3 ] ;
130131 foreach ( PointF [ ] loop in points )
131132 {
132133 rnd . NextBytes ( rgb ) ;
133134
134- Color color = Color . FromPixel < Rgb24 > ( new Rgb24 ( rgb [ 0 ] , rgb [ 1 ] , rgb [ 2 ] ) ) ;
135+ Color color = Color . FromPixel ( new Rgb24 ( rgb [ 0 ] , rgb [ 1 ] , rgb [ 2 ] ) ) ;
135136 image . Mutate ( c => c . FillPolygon ( options , color , loop ) ) ;
136137 }
137138
@@ -201,9 +202,7 @@ public void LargeGeoJson_Mississippi_LinesScaled(TestImageProvider<Rgba32> provi
201202 image . CompareToReferenceOutput ( comparer , provider , testOutputDetails : details , appendPixelTypeToFileName : false , appendSourceFileOrDescription : false ) ;
202203 }
203204
204- #pragma warning disable xUnit1004 // Test methods should not be skipped
205205 [ Theory ( Skip = "For local experiments only" ) ]
206- #pragma warning restore xUnit1004 // Test methods should not be skipped
207206 [ InlineData ( 0 ) ]
208207 [ InlineData ( 5000 ) ]
209208 [ InlineData ( 9000 ) ]
@@ -259,7 +258,7 @@ public void Missisippi_Skia(int offset)
259258 data . SaveTo ( fs ) ;
260259 }
261260
262- [ Theory ]
261+ [ Theory ( Skip = "For local experiments only" ) ]
263262 [ WithSolidFilledImages ( 1000 , 1000 , "Black" , PixelTypes . Rgba32 , 10 ) ]
264263 public void LargeGeoJson_States_Separate_Benchmark ( TestImageProvider < Rgba32 > provider , int thickness )
265264 {
@@ -286,7 +285,7 @@ public void LargeGeoJson_States_Separate_Benchmark(TestImageProvider<Rgba32> pro
286285 image . DebugSave ( provider , $ "Benchmark_{ thickness } ", appendPixelTypeToFileName : false , appendSourceFileOrDescription : false ) ;
287286 }
288287
289- [ Theory ]
288+ [ Theory ( Skip = "For local experiments only" ) ]
290289 [ WithSolidFilledImages ( 1000 , 1000 , "Black" , PixelTypes . Rgba32 , 10 ) ]
291290 public void LargeGeoJson_States_All_Benchmark ( TestImageProvider < Rgba32 > provider , int thickness )
292291 {
@@ -320,7 +319,7 @@ public void LargeGeoJson_States_All_Benchmark(TestImageProvider<Rgba32> provider
320319 image . DebugSave ( provider , $ "Benchmark_{ thickness } ", appendPixelTypeToFileName : false , appendSourceFileOrDescription : false ) ;
321320 }
322321
323- [ Theory ]
322+ [ Theory ( Skip = "For local experiments only" ) ]
324323 [ WithSolidFilledImages ( 1000 , 1000 , "Black" , PixelTypes . Rgba32 , 10 ) ]
325324 public void LargeStar_Benchmark ( TestImageProvider < Rgba32 > provider , int thickness )
326325 {
@@ -362,3 +361,4 @@ private static List<PointF[]> CreateStarPolygon(int vertexCount, float radius)
362361 return [ [ .. contour ] ] ;
363362 }
364363}
364+ #pragma warning restore xUnit1004 // Test methods should not be skipped
0 commit comments