@@ -3806,30 +3806,34 @@ class TestData : TestDataSuper {
3806
3806
}
3807
3807
3808
3808
func test_nsdataSequence( ) {
3809
- let bytes : [ UInt8 ] = Array ( 0x00 ... 0xFF )
3810
- let data = bytes. withUnsafeBytes { NSData ( bytes: $0. baseAddress, length: $0. count) }
3809
+ if #available( macOS 10 . 15 , iOS 13 , tvOS 13 , watchOS 6 , * ) {
3810
+ let bytes : [ UInt8 ] = Array ( 0x00 ... 0xFF )
3811
+ let data = bytes. withUnsafeBytes { NSData ( bytes: $0. baseAddress, length: $0. count) }
3811
3812
3812
- for byte in bytes {
3813
- expectEqual ( data [ Int ( byte) ] , byte)
3813
+ for byte in bytes {
3814
+ expectEqual ( data [ Int ( byte) ] , byte)
3815
+ }
3814
3816
}
3815
3817
}
3816
3818
3817
3819
func test_dispatchSequence( ) {
3818
- let bytes1 : [ UInt8 ] = Array ( 0x00 ..< 0xF0 )
3819
- let bytes2 : [ UInt8 ] = Array ( 0xF0 ..< 0xFF )
3820
- var data = DispatchData . empty
3821
- bytes1. withUnsafeBytes {
3822
- data. append ( $0)
3823
- }
3824
- bytes2. withUnsafeBytes {
3825
- data. append ( $0)
3826
- }
3820
+ if #available( macOS 10 . 15 , iOS 13 , tvOS 13 , watchOS 6 , * ) {
3821
+ let bytes1 : [ UInt8 ] = Array ( 0x00 ..< 0xF0 )
3822
+ let bytes2 : [ UInt8 ] = Array ( 0xF0 ..< 0xFF )
3823
+ var data = DispatchData . empty
3824
+ bytes1. withUnsafeBytes {
3825
+ data. append ( $0)
3826
+ }
3827
+ bytes2. withUnsafeBytes {
3828
+ data. append ( $0)
3829
+ }
3827
3830
3828
- for byte in bytes1 {
3829
- expectEqual ( data [ Int ( byte) ] , byte)
3830
- }
3831
- for byte in bytes2 {
3832
- expectEqual ( data [ Int ( byte) ] , byte)
3831
+ for byte in bytes1 {
3832
+ expectEqual ( data [ Int ( byte) ] , byte)
3833
+ }
3834
+ for byte in bytes2 {
3835
+ expectEqual ( data [ Int ( byte) ] , byte)
3836
+ }
3833
3837
}
3834
3838
}
3835
3839
}
@@ -4151,9 +4155,10 @@ DataTests.test("test_validateMutation_slice_customBacking_withUnsafeMutableBytes
4151
4155
DataTests . test ( " test_validateMutation_slice_customMutableBacking_withUnsafeMutableBytes_lengthLessThanLowerBound " ) { TestData ( ) . test_validateMutation_slice_customMutableBacking_withUnsafeMutableBytes_lengthLessThanLowerBound ( ) }
4152
4156
DataTests . test ( " test_byte_access_of_discontiguousData " ) { TestData ( ) . test_byte_access_of_discontiguousData ( ) }
4153
4157
DataTests . test ( " test_rangeOfSlice " ) { TestData ( ) . test_rangeOfSlice ( ) }
4154
- DataTests . test ( " test_nsdataSequence " ) { TestData ( ) . test_nsdataSequence ( ) }
4155
- DataTests . test ( " test_dispatchSequence " ) { TestData ( ) . test_dispatchSequence ( ) }
4156
-
4158
+ if #available( macOS 10 . 15 , iOS 13 , tvOS 13 , watchOS 6 , * ) {
4159
+ DataTests . test ( " test_nsdataSequence " ) { TestData ( ) . test_nsdataSequence ( ) }
4160
+ DataTests . test ( " test_dispatchSequence " ) { TestData ( ) . test_dispatchSequence ( ) }
4161
+ }
4157
4162
4158
4163
// XCTest does not have a crash detection, whereas lit does
4159
4164
DataTests . test ( " bounding failure subdata " ) {
0 commit comments