@@ -131,9 +131,8 @@ UnsafeRawBufferPointerTestSuite.test("initFromArray") {
131
131
expectEqual ( array2, array1)
132
132
}
133
133
134
- #if !os(WASI)
135
- // Trap tests aren't available on WASI.
136
- UnsafeRawBufferPointerTestSuite . test ( " initializeMemory(as:from:).underflow " ) {
134
+ UnsafeRawBufferPointerTestSuite . test ( " initializeMemory(as:from:).underflow " )
135
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
137
136
let buffer = UnsafeMutableRawBufferPointer . allocate (
138
137
byteCount: 30 ,
139
138
alignment: MemoryLayout< UInt64> . alignment
@@ -152,7 +151,8 @@ UnsafeRawBufferPointerTestSuite.test("initializeMemory(as:from:).underflow") {
152
151
expectEqualSequence ( [ 5 , 4 , 3 ] , bound)
153
152
}
154
153
155
- UnsafeRawBufferPointerTestSuite . test ( " initializeMemory(as:from:).overflow " ) {
154
+ UnsafeRawBufferPointerTestSuite . test ( " initializeMemory(as:from:).overflow " )
155
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
156
156
let buffer = UnsafeMutableRawBufferPointer . allocate (
157
157
byteCount: 30 ,
158
158
alignment: MemoryLayout< UInt64> . alignment
@@ -170,7 +170,6 @@ UnsafeRawBufferPointerTestSuite.test("initializeMemory(as:from:).overflow") {
170
170
expected. withUnsafeBytes { expectEqualSequence ( $0, buffer [ 0 ..< idx] ) }
171
171
expectEqualSequence ( [ 5 , 4 , 3 ] , bound)
172
172
}
173
- #endif
174
173
175
174
UnsafeRawBufferPointerTestSuite . test ( " initializeMemory(as:from:).exact " ) {
176
175
let buffer = UnsafeMutableRawBufferPointer . allocate (
@@ -187,15 +186,13 @@ UnsafeRawBufferPointerTestSuite.test("initializeMemory(as:from:).exact") {
187
186
expectEqualSequence ( [ 5 , 4 , 3 ] , bound)
188
187
}
189
188
190
- #if !os(WASI)
191
- // Trap tests aren't available on WASI.
192
- UnsafeRawBufferPointerTestSuite . test ( " initializeMemory(as:from:).invalidNilPtr " ) {
189
+ UnsafeRawBufferPointerTestSuite . test ( " initializeMemory(as:from:).invalidNilPtr " )
190
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
193
191
let buffer = UnsafeMutableRawBufferPointer ( start: nil , count: 0 )
194
192
let source : [ Int64 ] = [ 5 , 4 , 3 , 2 , 1 ]
195
193
expectCrashLater ( )
196
194
_ = buffer. initializeMemory ( as: Int64 . self, from: source)
197
195
}
198
- #endif
199
196
200
197
UnsafeRawBufferPointerTestSuite . test ( " initializeMemory(as:from:).validNilPtr " ) {
201
198
let buffer = UnsafeMutableRawBufferPointer ( start: nil , count: 0 )
@@ -305,9 +302,8 @@ UnsafeRawBufferPointerTestSuite.test("inBounds") {
305
302
expectEqualSequence ( firstHalf, secondHalf)
306
303
}
307
304
308
- #if !os(WASI)
309
- // Trap tests aren't available on WASI.
310
- UnsafeRawBufferPointerTestSuite . test ( " subscript.get.underflow " ) {
305
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.get.underflow " )
306
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
311
307
let buffer = UnsafeMutableRawBufferPointer . allocate (
312
308
byteCount: 2 ,
313
309
alignment: MemoryLayout< UInt> . alignment
@@ -323,7 +319,8 @@ UnsafeRawBufferPointerTestSuite.test("subscript.get.underflow") {
323
319
_ = bytes [ - 1 ]
324
320
}
325
321
326
- UnsafeRawBufferPointerTestSuite . test ( " subscript.get.overflow " ) {
322
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.get.overflow " )
323
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
327
324
let buffer = UnsafeMutableRawBufferPointer . allocate (
328
325
byteCount: 2 ,
329
326
alignment: MemoryLayout< UInt> . alignment
@@ -339,7 +336,8 @@ UnsafeRawBufferPointerTestSuite.test("subscript.get.overflow") {
339
336
_ = bytes [ 1 ]
340
337
}
341
338
342
- UnsafeRawBufferPointerTestSuite . test ( " subscript.set.underflow " ) {
339
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.set.underflow " )
340
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
343
341
let buffer = UnsafeMutableRawBufferPointer . allocate (
344
342
byteCount: 2 ,
345
343
alignment: MemoryLayout< UInt> . alignment
@@ -355,7 +353,8 @@ UnsafeRawBufferPointerTestSuite.test("subscript.set.underflow") {
355
353
bytes [ - 1 ] = 0
356
354
}
357
355
358
- UnsafeRawBufferPointerTestSuite . test ( " subscript.set.overflow " ) {
356
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.set.overflow " )
357
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
359
358
let buffer = UnsafeMutableRawBufferPointer . allocate (
360
359
byteCount: 2 ,
361
360
alignment: MemoryLayout< UInt> . alignment
@@ -371,7 +370,8 @@ UnsafeRawBufferPointerTestSuite.test("subscript.set.overflow") {
371
370
bytes [ 1 ] = 0
372
371
}
373
372
374
- UnsafeRawBufferPointerTestSuite . test ( " subscript.range.get.underflow " ) {
373
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.range.get.underflow " )
374
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
375
375
let buffer = UnsafeMutableRawBufferPointer . allocate (
376
376
byteCount: 3 ,
377
377
alignment: MemoryLayout< UInt> . alignment
@@ -387,7 +387,8 @@ UnsafeRawBufferPointerTestSuite.test("subscript.range.get.underflow") {
387
387
_ = bytes [ - 1 ..< 1 ]
388
388
}
389
389
390
- UnsafeRawBufferPointerTestSuite . test ( " subscript.range.get.overflow " ) {
390
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.range.get.overflow " )
391
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
391
392
let buffer = UnsafeMutableRawBufferPointer . allocate (
392
393
byteCount: 3 ,
393
394
alignment: MemoryLayout< UInt> . alignment
@@ -403,7 +404,8 @@ UnsafeRawBufferPointerTestSuite.test("subscript.range.get.overflow") {
403
404
_ = bytes [ 1 ..< 3 ]
404
405
}
405
406
406
- UnsafeRawBufferPointerTestSuite . test ( " subscript.range.set.underflow " ) {
407
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.range.set.underflow " )
408
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
407
409
let buffer = UnsafeMutableRawBufferPointer . allocate (
408
410
byteCount: 3 ,
409
411
alignment: MemoryLayout< UInt> . alignment
@@ -419,7 +421,8 @@ UnsafeRawBufferPointerTestSuite.test("subscript.range.set.underflow") {
419
421
bytes [ - 1 ..< 1 ] = bytes [ 0 ..< 2 ]
420
422
}
421
423
422
- UnsafeRawBufferPointerTestSuite . test ( " subscript.range.set.overflow " ) {
424
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.range.set.overflow " )
425
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
423
426
let buffer = UnsafeMutableRawBufferPointer . allocate (
424
427
byteCount: 3 ,
425
428
alignment: MemoryLayout< UInt> . alignment
@@ -436,7 +439,8 @@ UnsafeRawBufferPointerTestSuite.test("subscript.range.set.overflow") {
436
439
bytes [ 1 ..< 3 ] = bytes [ 0 ..< 2 ]
437
440
}
438
441
439
- UnsafeRawBufferPointerTestSuite . test ( " subscript.range.narrow " ) {
442
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.range.narrow " )
443
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
440
444
let buffer = UnsafeMutableRawBufferPointer . allocate (
441
445
byteCount: 3 ,
442
446
alignment: MemoryLayout< UInt> . alignment
@@ -450,7 +454,8 @@ UnsafeRawBufferPointerTestSuite.test("subscript.range.narrow") {
450
454
buffer [ 0 ..< 3 ] = buffer [ 0 ..< 2 ]
451
455
}
452
456
453
- UnsafeRawBufferPointerTestSuite . test ( " subscript.range.wide " ) {
457
+ UnsafeRawBufferPointerTestSuite . test ( " subscript.range.wide " )
458
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
454
459
let buffer = UnsafeMutableRawBufferPointer . allocate (
455
460
byteCount: 3 ,
456
461
alignment: MemoryLayout< UInt> . alignment
@@ -463,7 +468,6 @@ UnsafeRawBufferPointerTestSuite.test("subscript.range.wide") {
463
468
// Performs a valid byte-wise copy but triggers a debug bounds check.
464
469
buffer [ 0 ..< 2 ] = buffer [ 0 ..< 3 ]
465
470
}
466
- #endif
467
471
468
472
UnsafeRawBufferPointerTestSuite . test ( " _copyContents " ) {
469
473
let a = Array < UInt8 > ( 0 ..< 20 )
@@ -477,9 +481,8 @@ UnsafeRawBufferPointerTestSuite.test("_copyContents") {
477
481
expectEqual ( written, a. count)
478
482
}
479
483
480
- #if !os(WASI)
481
- // Trap tests aren't available on WASI.
482
- UnsafeRawBufferPointerTestSuite . test ( " copyMemory.overflow " ) {
484
+ UnsafeRawBufferPointerTestSuite . test ( " copyMemory.overflow " )
485
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
483
486
let buffer = UnsafeMutableRawBufferPointer . allocate (
484
487
byteCount: 3 ,
485
488
alignment: MemoryLayout< UInt> . alignment
@@ -495,7 +498,6 @@ UnsafeRawBufferPointerTestSuite.test("copyMemory.overflow") {
495
498
UnsafeMutableRawBufferPointer ( rebasing: bytes) . copyMemory (
496
499
from: UnsafeRawBufferPointer ( buffer) )
497
500
}
498
- #endif
499
501
500
502
// Use copyBytes without contiguous storage
501
503
UnsafeRawBufferPointerTestSuite . test ( " copyBytes.withoutContiguousStorage " ) {
@@ -510,9 +512,8 @@ UnsafeRawBufferPointerTestSuite.test("copyBytes.withoutContiguousStorage") {
510
512
}
511
513
}
512
514
513
- #if !os(WASI)
514
- // Trap tests aren't available on WASI.
515
- UnsafeRawBufferPointerTestSuite . test ( " copyBytes.sequence.overflow " ) {
515
+ UnsafeRawBufferPointerTestSuite . test ( " copyBytes.sequence.overflow " )
516
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) ) . code {
516
517
let buffer = UnsafeMutableRawBufferPointer . allocate (
517
518
byteCount: 3 ,
518
519
alignment: MemoryLayout< UInt> . alignment
@@ -530,6 +531,7 @@ UnsafeRawBufferPointerTestSuite.test("copyBytes.sequence.overflow") {
530
531
}
531
532
532
533
UnsafeRawBufferPointerTestSuite . test ( " load.before " )
534
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) )
533
535
. skip ( . custom(
534
536
{ !_isDebugAssertConfiguration( ) } ,
535
537
reason: " This tests a debug precondition. " ) )
@@ -542,6 +544,7 @@ UnsafeRawBufferPointerTestSuite.test("load.before")
542
544
}
543
545
544
546
UnsafeRawBufferPointerTestSuite . test ( " load.after " )
547
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) )
545
548
. skip ( . custom(
546
549
{ !_isDebugAssertConfiguration( ) } ,
547
550
reason: " This tests a debug precondition.. " ) )
@@ -566,6 +569,7 @@ UnsafeRawBufferPointerTestSuite.test("load.aligned") {
566
569
}
567
570
568
571
UnsafeRawBufferPointerTestSuite . test ( " load.invalid " )
572
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) )
569
573
. skip ( . custom( { !_isDebugAssertConfiguration( ) } , // require debugAssert
570
574
reason: " This tests a debug precondition.. " ) )
571
575
. code {
@@ -594,6 +598,7 @@ UnsafeRawBufferPointerTestSuite.test("load.unaligned")
594
598
}
595
599
596
600
UnsafeRawBufferPointerTestSuite . test ( " store.before " )
601
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) )
597
602
. skip ( . custom(
598
603
{ !_isDebugAssertConfiguration( ) } ,
599
604
reason: " This tests a debug precondition.. " ) )
@@ -605,6 +610,7 @@ UnsafeRawBufferPointerTestSuite.test("store.before")
605
610
}
606
611
}
607
612
UnsafeRawBufferPointerTestSuite . test ( " store.after " )
613
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) )
608
614
. skip ( . custom(
609
615
{ !_isDebugAssertConfiguration( ) } ,
610
616
reason: " This tests a debug precondition.. " ) )
@@ -641,6 +647,7 @@ UnsafeRawBufferPointerTestSuite.test("store.unaligned")
641
647
}
642
648
643
649
UnsafeRawBufferPointerTestSuite . test ( " store.invalid " )
650
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) )
644
651
. skip ( . custom( { !_isDebugAssertConfiguration( ) } , // require debugAssert
645
652
reason: " This tests a debug precondition.. " ) )
646
653
. require ( . stdlib_5_7)
@@ -666,6 +673,7 @@ UnsafeRawBufferPointerTestSuite.test("store.valid") {
666
673
}
667
674
668
675
UnsafeRawBufferPointerTestSuite . test ( " copy.bytes.overflow " )
676
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) )
669
677
. skip ( . custom(
670
678
{ !_isDebugAssertConfiguration( ) } ,
671
679
reason: " This tests a debug precondition.. " ) )
@@ -682,6 +690,7 @@ UnsafeRawBufferPointerTestSuite.test("copy.bytes.overflow")
682
690
}
683
691
684
692
UnsafeRawBufferPointerTestSuite . test ( " copy.sequence.overflow " )
693
+ . skip ( . wasiAny( reason: " Trap tests aren't supported on WASI. " ) )
685
694
. skip ( . custom(
686
695
{ !_isDebugAssertConfiguration( ) } ,
687
696
reason: " This tests a debug precondition.. " ) )
@@ -695,7 +704,6 @@ UnsafeRawBufferPointerTestSuite.test("copy.sequence.overflow")
695
704
}
696
705
}
697
706
}
698
- #endif
699
707
700
708
UnsafeRawBufferPointerTestSuite . test ( " copy.overlap " ) {
701
709
let bytes = UnsafeMutableRawBufferPointer . allocate (
0 commit comments