Skip to content

Commit 59ddf00

Browse files
committed
Tests: remove error codes that are unavailable on windows
Not all the error codes are available on Windows, this matches SystemErrno cases to remove the cases that have no definition on Windows.
1 parent 025bcb1 commit 59ddf00

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Tests/SystemTests/ErrnoTest.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ final class ErrnoTest: XCTestCase {
3232
XCTAssert(ENOMEM == Errno.noMemory.rawValue)
3333
XCTAssert(EACCES == Errno.permissionDenied.rawValue)
3434
XCTAssert(EFAULT == Errno.badAddress.rawValue)
35+
#if !os(Windows)
3536
XCTAssert(ENOTBLK == Errno.notBlockDevice.rawValue)
37+
#endif
3638
XCTAssert(EBUSY == Errno.resourceBusy.rawValue)
3739
XCTAssert(EEXIST == Errno.fileExists.rawValue)
3840
XCTAssert(EXDEV == Errno.improperLink.rawValue)
@@ -42,8 +44,10 @@ final class ErrnoTest: XCTestCase {
4244
XCTAssert(EINVAL == Errno.invalidArgument.rawValue)
4345
XCTAssert(ENFILE == Errno.tooManyOpenFilesInSystem.rawValue)
4446
XCTAssert(EMFILE == Errno.tooManyOpenFiles.rawValue)
47+
#if !os(Windows)
4548
XCTAssert(ENOTTY == Errno.inappropriateIOCTLForDevice.rawValue)
4649
XCTAssert(ETXTBSY == Errno.textFileBusy.rawValue)
50+
#endif
4751
XCTAssert(EFBIG == Errno.fileTooLarge.rawValue)
4852
XCTAssert(ENOSPC == Errno.noSpace.rawValue)
4953
XCTAssert(ESPIPE == Errno.illegalSeek.rawValue)
@@ -111,7 +115,9 @@ final class ErrnoTest: XCTestCase {
111115
XCTAssert(EDEVERR == Errno.deviceError.rawValue)
112116
#endif
113117

118+
#if !os(Windows)
114119
XCTAssert(EOVERFLOW == Errno.overflow.rawValue)
120+
#endif
115121

116122
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
117123
XCTAssert(EBADEXEC == Errno.badExecutable.rawValue)
@@ -121,14 +127,17 @@ final class ErrnoTest: XCTestCase {
121127
#endif
122128

123129
XCTAssert(ECANCELED == Errno.canceled.rawValue)
130+
#if !os(Windows)
124131
XCTAssert(EIDRM == Errno.identifierRemoved.rawValue)
125132
XCTAssert(ENOMSG == Errno.noMessage.rawValue)
133+
#endif
126134
XCTAssert(EILSEQ == Errno.illegalByteSequence.rawValue)
127135

128136
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
129137
XCTAssert(ENOATTR == Errno.attributeNotFound.rawValue)
130138
#endif
131139

140+
#if !os(Windows)
132141
XCTAssert(EBADMSG == Errno.badMessage.rawValue)
133142
XCTAssert(EMULTIHOP == Errno.multiHop.rawValue)
134143
XCTAssert(ENODATA == Errno.noData.rawValue)
@@ -137,6 +146,7 @@ final class ErrnoTest: XCTestCase {
137146
XCTAssert(ENOSTR == Errno.notStream.rawValue)
138147
XCTAssert(EPROTO == Errno.protocolError.rawValue)
139148
XCTAssert(ETIME == Errno.timeout.rawValue)
149+
#endif
140150
XCTAssert(EOPNOTSUPP == Errno.notSupportedOnSocket.rawValue)
141151

142152
// From headers but not man page
@@ -148,8 +158,10 @@ final class ErrnoTest: XCTestCase {
148158
XCTAssert(ENOPOLICY == Errno.noSuchPolicy.rawValue)
149159
#endif
150160

161+
#if !os(Windows)
151162
XCTAssert(ENOTRECOVERABLE == Errno.notRecoverable.rawValue)
152163
XCTAssert(EOWNERDEAD == Errno.previousOwnerDied.rawValue)
164+
#endif
153165

154166
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
155167
XCTAssert(EQFULL == Errno.outputQueueFull.rawValue)

0 commit comments

Comments
 (0)