@@ -239,13 +239,10 @@ CStringTests.test("String.cString.with.Array.UInt8.input") {
239
239
}
240
240
}
241
241
// no need to test every case; that is covered in other tests
242
- #if os(Linux)
243
- expectCrashLater ( )
244
- #else
245
242
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"
247
245
)
248
- #endif
249
246
_ = String ( cString: [ ] as [ UInt8 ] )
250
247
expectUnreachable ( )
251
248
}
@@ -264,13 +261,10 @@ CStringTests.test("String.cString.with.Array.CChar.input") {
264
261
}
265
262
}
266
263
// no need to test every case; that is covered in other tests
267
- #if os(Linux)
268
- expectCrashLater ( )
269
- #else
270
264
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"
272
267
)
273
- #endif
274
268
_ = String ( cString: [ ] as [ CChar ] )
275
269
expectUnreachable ( )
276
270
}
@@ -293,13 +287,10 @@ CStringTests.test("String.cString.with.inout.UInt8.conversion") {
293
287
var str = String ( cString: & c)
294
288
expectTrue ( str. isEmpty)
295
289
c = 100
296
- #if os(Linux)
297
- expectCrashLater ( )
298
- #else
299
290
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"
301
293
)
302
- #endif
303
294
str = String ( cString: & c)
304
295
expectUnreachable ( )
305
296
}
@@ -309,13 +300,10 @@ CStringTests.test("String.cString.with.inout.CChar.conversion") {
309
300
var str = String ( cString: & c)
310
301
expectTrue ( str. isEmpty)
311
302
c = 100
312
- #if os(Linux)
313
- expectCrashLater ( )
314
- #else
315
303
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"
317
306
)
318
- #endif
319
307
str = String ( cString: & c)
320
308
expectUnreachable ( )
321
309
}
@@ -335,13 +323,10 @@ CStringTests.test("String.validatingUTF8.with.Array.input") {
335
323
}
336
324
}
337
325
// no need to test every case; that is covered in other tests
338
- #if os(Linux)
339
- expectCrashLater ( )
340
- #else
341
326
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"
343
329
)
344
- #endif
345
330
_ = String ( validatingUTF8: [ ] )
346
331
expectUnreachable ( )
347
332
}
@@ -367,13 +352,10 @@ CStringTests.test("String.validatingUTF8.with.inout.conversion") {
367
352
expectNotNil ( str)
368
353
expectEqual ( str? . isEmpty, true )
369
354
c = 100
370
- #if os(Linux)
371
- expectCrashLater ( )
372
- #else
373
355
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"
375
358
)
376
- #endif
377
359
str = String ( validatingUTF8: & c)
378
360
expectUnreachable ( )
379
361
}
@@ -394,13 +376,10 @@ CStringTests.test("String.decodeCString.with.Array.input") {
394
376
}
395
377
}
396
378
// no need to test every case; that is covered in other tests
397
- #if os(Linux)
398
- expectCrashLater ( )
399
- #else
400
379
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"
402
382
)
403
- #endif
404
383
_ = String . decodeCString ( [ ] , as: Unicode . UTF8. self)
405
384
expectUnreachable ( )
406
385
}
@@ -433,13 +412,10 @@ CStringTests.test("String.decodeCString.with.inout.conversion") {
433
412
expectEqual ( result? . result. isEmpty, true )
434
413
expectEqual ( result? . repairsMade, false )
435
414
c = 100
436
- #if os(Linux)
437
- expectCrashLater ( )
438
- #else
439
415
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"
441
418
)
442
- #endif
443
419
result = String . decodeCString ( & c, as: Unicode . UTF8. self)
444
420
expectUnreachable ( )
445
421
}
@@ -458,13 +434,10 @@ CStringTests.test("String.init.decodingCString.with.Array.input") {
458
434
}
459
435
}
460
436
// no need to test every case; that is covered in other tests
461
- #if os(Linux)
462
- expectCrashLater ( )
463
- #else
464
437
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"
466
440
)
467
- #endif
468
441
_ = String ( decodingCString: [ ] , as: Unicode . UTF8. self)
469
442
expectUnreachable ( )
470
443
}
@@ -487,13 +460,10 @@ CStringTests.test("String.init.decodingCString.with.inout.conversion") {
487
460
var str = String ( decodingCString: & c, as: Unicode . UTF8. self)
488
461
expectEqual ( str. isEmpty, true )
489
462
c = 100
490
- #if os(Linux)
491
- expectCrashLater ( )
492
- #else
493
463
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"
495
466
)
496
- #endif
497
467
str = String ( decodingCString: & c, as: Unicode . UTF8. self)
498
468
expectUnreachable ( )
499
469
}
0 commit comments