From 3c814432268b6bfc4e4f3b340ec7219c2da9dd5b Mon Sep 17 00:00:00 2001 From: Simon Whitty Date: Fri, 27 Sep 2024 12:25:39 +1000 Subject: [PATCH] remove redundant symlink --- FlyingFox/XCTests/Socket+Pair.swift | 1 - FlyingSocks/XCTests/Socket+Pair.swift | 70 ----------------------- FlyingSocks/XCTests/SocketPoolTests.swift | 3 + 3 files changed, 3 insertions(+), 71 deletions(-) delete mode 120000 FlyingFox/XCTests/Socket+Pair.swift delete mode 100644 FlyingSocks/XCTests/Socket+Pair.swift diff --git a/FlyingFox/XCTests/Socket+Pair.swift b/FlyingFox/XCTests/Socket+Pair.swift deleted file mode 120000 index 7e286a6..0000000 --- a/FlyingFox/XCTests/Socket+Pair.swift +++ /dev/null @@ -1 +0,0 @@ -../../FlyingSocks/XCTests/Socket+Pair.swift \ No newline at end of file diff --git a/FlyingSocks/XCTests/Socket+Pair.swift b/FlyingSocks/XCTests/Socket+Pair.swift deleted file mode 100644 index cee5a39..0000000 --- a/FlyingSocks/XCTests/Socket+Pair.swift +++ /dev/null @@ -1,70 +0,0 @@ -// -// Socket+Pair.swift -// FlyingFox -// -// Created by Simon Whitty on 22/02/2022. -// Copyright © 2022 Simon Whitty. All rights reserved. -// -// Distributed under the permissive MIT license -// Get the latest version from here: -// -// https://github.com/swhitty/FlyingFox -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -#if canImport(Darwin) -import Darwin -#else -import Glibc -#endif - -@testable import FlyingSocks - -extension Socket { - - static func socketpair(_ domain: Int32, _ type: Int32, _ protocol: Int32) -> (FileDescriptor, FileDescriptor) { - var sockets: [Int32] = [-1, -1] - #if canImport(Darwin) - _ = Darwin.socketpair(domain, type, `protocol`, &sockets) - #else - _ = Glibc.socketpair(domain, type, `protocol`, &sockets) - #endif - return (FileDescriptor(rawValue: sockets[0]), FileDescriptor(rawValue: sockets[1])) - } - - static func makeNonBlockingPair() throws -> (Socket, Socket) { - let (file1, file2) = Socket.socketpair(AF_UNIX, Socket.stream, 0) - guard file1.rawValue > -1, file2.rawValue > -1 else { - throw SocketError.makeFailed("SocketPair") - } - - let s1 = Socket(file: file1) - try s1.setFlags(.nonBlocking) - - let s2 = Socket(file: file2) - try s2.setFlags(.nonBlocking) - - return (s1, s2) - } -} - -extension Socket.FileDescriptor { - static let validMock = Socket.FileDescriptor(rawValue: 999) -} diff --git a/FlyingSocks/XCTests/SocketPoolTests.swift b/FlyingSocks/XCTests/SocketPoolTests.swift index c63c613..fc57d20 100644 --- a/FlyingSocks/XCTests/SocketPoolTests.swift +++ b/FlyingSocks/XCTests/SocketPoolTests.swift @@ -344,3 +344,6 @@ extension IdentifiableContinuation where T: Sendable { } } +extension Socket.FileDescriptor { + static let validMock = Socket.FileDescriptor(rawValue: 999) +}