@@ -239,13 +239,10 @@ CStringTests.test("String.cString.with.Array.UInt8.input") {
239239 }
240240 }
241241 // no need to test every case; that is covered in other tests
242- #if os(Linux)
243- expectCrashLater ( )
244- #else
245242 expectCrashLater (
246- withMessage: " input of String.init(cString:) must be null-terminated "
243+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
244+ // withMessage: "input of String.init(cString:) must be null-terminated"
247245 )
248- #endif
249246 _ = String ( cString: [ ] as [ UInt8 ] )
250247 expectUnreachable ( )
251248}
@@ -264,13 +261,10 @@ CStringTests.test("String.cString.with.Array.CChar.input") {
264261 }
265262 }
266263 // no need to test every case; that is covered in other tests
267- #if os(Linux)
268- expectCrashLater ( )
269- #else
270264 expectCrashLater (
271- withMessage: " input of String.init(cString:) must be null-terminated "
265+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
266+ // withMessage: "input of String.init(cString:) must be null-terminated"
272267 )
273- #endif
274268 _ = String ( cString: [ ] as [ CChar ] )
275269 expectUnreachable ( )
276270}
@@ -293,13 +287,10 @@ CStringTests.test("String.cString.with.inout.UInt8.conversion") {
293287 var str = String ( cString: & c)
294288 expectTrue ( str. isEmpty)
295289 c = 100
296- #if os(Linux)
297- expectCrashLater ( )
298- #else
299290 expectCrashLater (
300- withMessage: " input of String.init(cString:) must be null-terminated "
291+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
292+ // withMessage: "input of String.init(cString:) must be null-terminated"
301293 )
302- #endif
303294 str = String ( cString: & c)
304295 expectUnreachable ( )
305296}
@@ -309,13 +300,10 @@ CStringTests.test("String.cString.with.inout.CChar.conversion") {
309300 var str = String ( cString: & c)
310301 expectTrue ( str. isEmpty)
311302 c = 100
312- #if os(Linux)
313- expectCrashLater ( )
314- #else
315303 expectCrashLater (
316- withMessage: " input of String.init(cString:) must be null-terminated "
304+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
305+ // withMessage: "input of String.init(cString:) must be null-terminated"
317306 )
318- #endif
319307 str = String ( cString: & c)
320308 expectUnreachable ( )
321309}
@@ -335,13 +323,10 @@ CStringTests.test("String.validatingUTF8.with.Array.input") {
335323 }
336324 }
337325 // no need to test every case; that is covered in other tests
338- #if os(Linux)
339- expectCrashLater ( )
340- #else
341326 expectCrashLater (
342- withMessage: " input of String.init(validatingUTF8:) must be null-terminated "
327+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
328+ // withMessage: "input of String.init(validatingUTF8:) must be null-terminated"
343329 )
344- #endif
345330 _ = String ( validatingUTF8: [ ] )
346331 expectUnreachable ( )
347332}
@@ -367,13 +352,10 @@ CStringTests.test("String.validatingUTF8.with.inout.conversion") {
367352 expectNotNil ( str)
368353 expectEqual ( str? . isEmpty, true )
369354 c = 100
370- #if os(Linux)
371- expectCrashLater ( )
372- #else
373355 expectCrashLater (
374- withMessage: " input of String.init(validatingUTF8:) must be null-terminated "
356+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
357+ // withMessage: "input of String.init(validatingUTF8:) must be null-terminated"
375358 )
376- #endif
377359 str = String ( validatingUTF8: & c)
378360 expectUnreachable ( )
379361}
@@ -394,13 +376,10 @@ CStringTests.test("String.decodeCString.with.Array.input") {
394376 }
395377 }
396378 // no need to test every case; that is covered in other tests
397- #if os(Linux)
398- expectCrashLater ( )
399- #else
400379 expectCrashLater (
401- withMessage: " input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated "
380+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
381+ // withMessage: "input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated"
402382 )
403- #endif
404383 _ = String . decodeCString ( [ ] , as: Unicode . UTF8. self)
405384 expectUnreachable ( )
406385}
@@ -433,13 +412,10 @@ CStringTests.test("String.decodeCString.with.inout.conversion") {
433412 expectEqual ( result? . result. isEmpty, true )
434413 expectEqual ( result? . repairsMade, false )
435414 c = 100
436- #if os(Linux)
437- expectCrashLater ( )
438- #else
439415 expectCrashLater (
440- withMessage: " input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated "
416+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
417+ // withMessage: "input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated"
441418 )
442- #endif
443419 result = String . decodeCString ( & c, as: Unicode . UTF8. self)
444420 expectUnreachable ( )
445421}
@@ -458,13 +434,10 @@ CStringTests.test("String.init.decodingCString.with.Array.input") {
458434 }
459435 }
460436 // no need to test every case; that is covered in other tests
461- #if os(Linux)
462- expectCrashLater ( )
463- #else
464437 expectCrashLater (
465- withMessage: " input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated "
438+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
439+ // withMessage: "input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated"
466440 )
467- #endif
468441 _ = String ( decodingCString: [ ] , as: Unicode . UTF8. self)
469442 expectUnreachable ( )
470443}
@@ -487,13 +460,10 @@ CStringTests.test("String.init.decodingCString.with.inout.conversion") {
487460 var str = String ( decodingCString: & c, as: Unicode . UTF8. self)
488461 expectEqual ( str. isEmpty, true )
489462 c = 100
490- #if os(Linux)
491- expectCrashLater ( )
492- #else
493463 expectCrashLater (
494- withMessage: " input of String.init(decodingCString:as:) must be null-terminated "
464+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
465+ // withMessage: "input of String.init(decodingCString:as:) must be null-terminated"
495466 )
496- #endif
497467 str = String ( decodingCString: & c, as: Unicode . UTF8. self)
498468 expectUnreachable ( )
499469}
0 commit comments