@@ -6,6 +6,12 @@ import OpenSwiftUICore
66import OpenSwiftUITestsSupport
77import Testing
88
9+ extension GraphicsImage {
10+ fileprivate static var empty : GraphicsImage {
11+ self . init ( contents: nil , scale: 1 , unrotatedPixelSize: . zero, orientation: . up, isTemplate: false )
12+ }
13+ }
14+
915struct VariableBlurStyleTests {
1016 @Test
1117 func variableBlurStyleInit( ) {
@@ -27,7 +33,7 @@ struct VariableBlurStyleTests {
2733 let style3 = VariableBlurStyle ( radius: 10 , mask: . none)
2834 #expect( style3. isIdentity == true )
2935
30- let style4 = VariableBlurStyle ( radius: 10 , mask: . image( GraphicsImage ( ) ) )
36+ let style4 = VariableBlurStyle ( radius: 10 , mask: . image( . empty ) )
3137 #expect( style4. isIdentity == false )
3238 }
3339
@@ -63,9 +69,9 @@ struct VariableBlurStyleTests {
6369 func variableBlurStyleMaskEquality( ) {
6470 let mask1 = VariableBlurStyle . Mask. none
6571 let mask2 = VariableBlurStyle . Mask. none
66- let mask3 = VariableBlurStyle . Mask. image ( GraphicsImage ( ) )
67- let mask4 = VariableBlurStyle . Mask. image ( GraphicsImage ( ) )
68-
72+ let mask3 = VariableBlurStyle . Mask. image ( . empty )
73+ let mask4 = VariableBlurStyle . Mask. image ( . empty )
74+
6975 #expect( mask1 == mask2)
7076 #expect( mask3 == mask4)
7177 #expect( mask1 != mask3)
@@ -80,7 +86,7 @@ struct VariableBlurStyleTests {
8086 ( VariableBlurStyle ( radius: 10.0 , isOpaque: true ) , " 0d0000204110012200 " ) ,
8187 ( VariableBlurStyle ( radius: 10.0 , isOpaque: true , dither: true ) , " 0d00002041100118012200 " ) ,
8288 ( VariableBlurStyle ( radius: 10.0 , isOpaque: false , dither: true , mask: . none) , " 0d0000204118012200 " ) ,
83- ( VariableBlurStyle ( radius: 10.0 , mask: . image( GraphicsImage ( ) ) ) , " 0d0000204122020a00 " ) ,
89+ ( VariableBlurStyle ( radius: 10.0 , mask: . image( . empty ) ) , " 0d0000204122020a00 " ) ,
8490 ]
8591 )
8692 func pbMessage( style: VariableBlurStyle , hexString: String ) throws {
@@ -91,7 +97,7 @@ struct VariableBlurStyleTests {
9197 @Test (
9298 arguments: [
9399 ( VariableBlurStyle . Mask. none, " " ) ,
94- ( VariableBlurStyle . Mask. image ( GraphicsImage ( ) ) , " 0a00 " ) ,
100+ ( VariableBlurStyle . Mask. image ( . empty ) , " 0a00 " ) ,
95101 ]
96102 )
97103 func maskPBMessage( mask: VariableBlurStyle . Mask , hexString: String ) throws {
0 commit comments