Skip to content

Commit b95aa03

Browse files
authored
Fix warnings in SandboxTests (#3580)
Using `XCTSkipIf(true)` avoids build warnings on Linux.
1 parent fdb6662 commit b95aa03

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Tests/BasicsTests/SandboxTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class SandboxTest: XCTestCase {
2323

2424
func testNetworkNotAllowed() throws {
2525
#if !os(macOS)
26-
throw XCTSkip()
26+
try XCTSkipIf(true, "test is only supported on macOS")
2727
#endif
2828

2929
let command = Sandbox.apply(command: ["ping", "-t", "1", "localhost"], writableDirectories: [], strictness: .default)
@@ -38,7 +38,7 @@ final class SandboxTest: XCTestCase {
3838

3939
func testWritableAllowed() throws {
4040
#if !os(macOS)
41-
throw XCTSkip()
41+
try XCTSkipIf(true, "test is only supported on macOS")
4242
#endif
4343

4444
try withTemporaryDirectory { path in
@@ -49,7 +49,7 @@ final class SandboxTest: XCTestCase {
4949

5050
func testWritableNotAllowed() throws {
5151
#if !os(macOS)
52-
throw XCTSkip()
52+
try XCTSkipIf(true, "test is only supported on macOS")
5353
#endif
5454

5555
try withTemporaryDirectory { path in
@@ -65,7 +65,7 @@ final class SandboxTest: XCTestCase {
6565

6666
func testRemoveNotAllowed() throws {
6767
#if !os(macOS)
68-
throw XCTSkip()
68+
try XCTSkipIf(true, "test is only supported on macOS")
6969
#endif
7070

7171
try withTemporaryDirectory { path in
@@ -85,7 +85,7 @@ final class SandboxTest: XCTestCase {
8585
// FIXME: rdar://75707545 this should not be allowed outside very specific read locations
8686
func testReadAllowed() throws {
8787
#if !os(macOS)
88-
throw XCTSkip()
88+
try XCTSkipIf(true, "test is only supported on macOS")
8989
#endif
9090

9191
try withTemporaryDirectory { path in
@@ -100,7 +100,7 @@ final class SandboxTest: XCTestCase {
100100
// FIXME: rdar://75707545 this should not be allowed outside very specific programs
101101
func testExecuteAllowed() throws {
102102
#if !os(macOS)
103-
throw XCTSkip()
103+
try XCTSkipIf(true, "test is only supported on macOS")
104104
#endif
105105

106106
try withTemporaryDirectory { path in

0 commit comments

Comments
 (0)