mirror of
https://github.com/apple/swift-system
synced 2026-11-29 05:24:25 +00:00
Add a test that ensures makeSendOnce is creating unique send-once rights
This commit is contained in:
1 parent
6a9ebce259
commit
47feb93a38
1 file changed
+11
@@ -110,6 +110,17 @@ final class MachPortTests: XCTestCase {
|
||||
XCTAssert(same == zero)
|
||||
}
|
||||
|
||||
func testMakeSendOnceIsUnique() throws {
|
||||
let recv = Mach.Port<Mach.ReceiveRight>()
|
||||
let once = recv.makeSendOnceRight()
|
||||
recv.withBorrowedName { rname in
|
||||
once.withBorrowedName { oname in
|
||||
print(oname, rname)
|
||||
XCTAssert(oname != rname)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testMakePair() throws {
|
||||
let (recv, send) = Mach.allocatePortRightPair()
|
||||
XCTAssert(recv.makeSendCount == 1)
|
||||
|
||||
Reference in new issue
Block a user