Skip to content

Commit 47feb93

Browse files
committed
Add a test that ensures makeSendOnce is creating unique send-once rights
1 parent 6a9ebce commit 47feb93

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Tests/SystemTests/MachPortTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ final class MachPortTests: XCTestCase {
110110
XCTAssert(same == zero)
111111
}
112112

113+
func testMakeSendOnceIsUnique() throws {
114+
let recv = Mach.Port<Mach.ReceiveRight>()
115+
let once = recv.makeSendOnceRight()
116+
recv.withBorrowedName { rname in
117+
once.withBorrowedName { oname in
118+
print(oname, rname)
119+
XCTAssert(oname != rname)
120+
}
121+
}
122+
}
123+
113124
func testMakePair() throws {
114125
let (recv, send) = Mach.allocatePortRightPair()
115126
XCTAssert(recv.makeSendCount == 1)

0 commit comments

Comments
 (0)