@@ -42,7 +42,6 @@ struct PointerOffsetTests {
4242 #expect( invalidPointer == UnsafeMutablePointer ( bitPattern: stride) )
4343 }
4444
45- #if compiler(>=6.0)
4645 @Test ( . bug( " https://github.com/OpenSwiftUIProject/OpenGraph/issues/70 " , id: 70 , " Verify fix of #70 " ) )
4746 func ofAndOffset( ) {
4847 struct Empty {
@@ -79,7 +78,6 @@ struct PointerOffsetTests {
7978 . of( & invalid. third)
8079 }
8180 }
82- #endif
8381
8482 @Test ( " Extension API between UnsafePointer/UnsafeMutablePointer and PointerOffset " )
8583 func unsafePointerAndUnsafeMutablePointerExtension( ) {
@@ -147,7 +145,6 @@ struct PointerOffsetTests {
147145 #expect( ( pointer + secondOffset) . pointee == 4 )
148146 #expect( ( pointer + thirdOffset) . pointee == 5 )
149147 }
150- #if !(!canImport(Darwin) && !DEBUG)
151148 withUnsafePointer ( to: triple) { pointer in
152149 #expect( ( pointer + firstOffset) . pointee == 3 )
153150 #expect( ( pointer + secondOffset) . pointee == 4 )
@@ -156,31 +153,6 @@ struct PointerOffsetTests {
156153 #expect( triple. first == 3 )
157154 #expect( triple. second == 4 )
158155 #expect( triple. third == 5 )
159- #endif
160- }
161- }
162-
163- #if !canImport(Darwin) && !DEBUG
164- @Test ( " Undefined Behavior Issue for PointerOffset " , . bug( " #73 " , relationship: . uncoveredBug) )
165- func unsafePointerAndUnsafeMutablePointerExtensionUB( ) {
166- var tuple = Tuple ( first: 1 , second: 2 )
167- typealias Base = Tuple < Int , Int >
168- let firstOffset = PointerOffset < Base , Int > ( byteOffset: 0 )
169- withUnsafeMutablePointer ( to: & tuple) { pointer in
170- #expect( pointer [ offset: firstOffset] == 1 )
171- pointer [ offset: firstOffset] = 3
172- }
173- let unexpectedValue = tuple. first
174- // The value will be unexpected due to UB
175- #expect( unexpectedValue == 1 )
176- // The value will be expected after and within a withKnownIssue block
177- withKnownIssue {
178- let expectedValue = tuple. first
179- #expect( expectedValue == 3 )
180- Issue . record ( " To make withKnownIssue pass " )
181156 }
182- let expectedValue = tuple. first
183- #expect( expectedValue == 3 )
184157 }
185- #endif
186158}
0 commit comments