@@ -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
}
@@ -265,13 +262,10 @@ CStringTests.test("String.cString.with.Array.CChar.input") {
265
262
}
266
263
}
267
264
// no need to test every case; that is covered in other tests
268
- #if os(Linux)
269
- expectCrashLater ( )
270
- #else
271
265
expectCrashLater (
272
- withMessage: " input of String.init(cString:) must be null-terminated "
266
+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
267
+ // withMessage: "input of String.init(cString:) must be null-terminated"
273
268
)
274
- #endif
275
269
_ = String ( cString: [ ] as [ CChar ] )
276
270
expectUnreachable ( )
277
271
}
@@ -294,13 +288,10 @@ CStringTests.test("String.cString.with.inout.UInt8.conversion") {
294
288
var str = String ( cString: & c)
295
289
expectTrue ( str. isEmpty)
296
290
c = 100
297
- #if os(Linux)
298
- expectCrashLater ( )
299
- #else
300
291
expectCrashLater (
301
- withMessage: " input of String.init(cString:) must be null-terminated "
292
+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
293
+ // withMessage: "input of String.init(cString:) must be null-terminated"
302
294
)
303
- #endif
304
295
str = String ( cString: & c)
305
296
expectUnreachable ( )
306
297
}
@@ -310,13 +301,10 @@ CStringTests.test("String.cString.with.inout.CChar.conversion") {
310
301
var str = String ( cString: & c)
311
302
expectTrue ( str. isEmpty)
312
303
c = 100
313
- #if os(Linux)
314
- expectCrashLater ( )
315
- #else
316
304
expectCrashLater (
317
- withMessage: " input of String.init(cString:) must be null-terminated "
305
+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
306
+ // withMessage: "input of String.init(cString:) must be null-terminated"
318
307
)
319
- #endif
320
308
str = String ( cString: & c)
321
309
expectUnreachable ( )
322
310
}
@@ -337,13 +325,10 @@ CStringTests.test("String.validatingUTF8.with.Array.input") {
337
325
}
338
326
}
339
327
// no need to test every case; that is covered in other tests
340
- #if os(Linux)
341
- expectCrashLater ( )
342
- #else
343
328
expectCrashLater (
344
- withMessage: " input of String.init(validatingUTF8:) must be null-terminated "
329
+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
330
+ // withMessage: "input of String.init(validatingUTF8:) must be null-terminated"
345
331
)
346
- #endif
347
332
_ = String ( validatingUTF8: [ ] )
348
333
expectUnreachable ( )
349
334
}
@@ -369,13 +354,10 @@ CStringTests.test("String.validatingUTF8.with.inout.conversion") {
369
354
expectNotNil ( str)
370
355
expectEqual ( str? . isEmpty, true )
371
356
c = 100
372
- #if os(Linux)
373
- expectCrashLater ( )
374
- #else
375
357
expectCrashLater (
376
- withMessage: " input of String.init(validatingUTF8:) must be null-terminated "
358
+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
359
+ // withMessage: "input of String.init(validatingUTF8:) must be null-terminated"
377
360
)
378
- #endif
379
361
str = String ( validatingUTF8: & c)
380
362
expectUnreachable ( )
381
363
}
@@ -397,13 +379,10 @@ CStringTests.test("String.decodeCString.with.Array.input") {
397
379
}
398
380
}
399
381
// no need to test every case; that is covered in other tests
400
- #if os(Linux)
401
- expectCrashLater ( )
402
- #else
403
382
expectCrashLater (
404
- withMessage: " input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated "
383
+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
384
+ // withMessage: "input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated"
405
385
)
406
- #endif
407
386
_ = String . decodeCString ( [ ] , as: Unicode . UTF8. self)
408
387
expectUnreachable ( )
409
388
}
@@ -436,13 +415,10 @@ CStringTests.test("String.decodeCString.with.inout.conversion") {
436
415
expectEqual ( result? . result. isEmpty, true )
437
416
expectEqual ( result? . repairsMade, false )
438
417
c = 100
439
- #if os(Linux)
440
- expectCrashLater ( )
441
- #else
442
418
expectCrashLater (
443
- withMessage: " input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated "
419
+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
420
+ // withMessage: "input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated"
444
421
)
445
- #endif
446
422
result = String . decodeCString ( & c, as: Unicode . UTF8. self)
447
423
expectUnreachable ( )
448
424
}
@@ -462,13 +438,10 @@ CStringTests.test("String.init.decodingCString.with.Array.input") {
462
438
}
463
439
}
464
440
// no need to test every case; that is covered in other tests
465
- #if os(Linux)
466
- expectCrashLater ( )
467
- #else
468
441
expectCrashLater (
469
- withMessage: " input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated "
442
+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
443
+ // withMessage: "input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated"
470
444
)
471
- #endif
472
445
_ = String ( decodingCString: [ ] , as: Unicode . UTF8. self)
473
446
expectUnreachable ( )
474
447
}
@@ -491,13 +464,10 @@ CStringTests.test("String.init.decodingCString.with.inout.conversion") {
491
464
var str = String ( decodingCString: & c, as: Unicode . UTF8. self)
492
465
expectEqual ( str. isEmpty, true )
493
466
c = 100
494
- #if os(Linux)
495
- expectCrashLater ( )
496
- #else
497
467
expectCrashLater (
498
- withMessage: " input of String.init(decodingCString:as:) must be null-terminated "
468
+ // Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
469
+ // withMessage: "input of String.init(decodingCString:as:) must be null-terminated"
499
470
)
500
- #endif
501
471
str = String ( decodingCString: & c, as: Unicode . UTF8. self)
502
472
expectUnreachable ( )
503
473
}
0 commit comments