mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 18:11:13 +00:00
[Swift] Migrate to swift 6.0 and Implements support gRPC v2 (#8983)
* Migrate to swift 6.0 & swift-gRPC 2.0 The following migrates to swift 6.0, and also migrate to swift-grpc 2.0 that uses swift-nio under the hood to provide nicer API and async await Adds sendable to enum & update @_implementationOnly imports to use internal imports * Address PR comments regarding misspelling & proper method naming.
This commit is contained in:
@@ -52,7 +52,7 @@ class FlatBuffersMonsterWriterTests: XCTestCase {
|
||||
#if os(macOS)
|
||||
// Gets the current path of this test file then
|
||||
// strips out the nested directories.
|
||||
let filePath = URL(filePath: #file)
|
||||
let filePath = URL(filePath: #filePath)
|
||||
.deletingLastPathComponent()
|
||||
return filePath.absoluteString
|
||||
#else
|
||||
@@ -331,7 +331,7 @@ class FlatBuffersMonsterWriterTests: XCTestCase {
|
||||
func testCreateMessage() {
|
||||
let fbb = createMonster(withPrefix: false)
|
||||
let byteBuffer = fbb.buffer
|
||||
let firstMessage = Message<Monster>(byteBuffer: byteBuffer)
|
||||
let firstMessage = GRPCMessage<Monster>(byteBuffer: byteBuffer)
|
||||
firstMessage.withUnsafeReadableBytes { ptr in
|
||||
var bytes = ByteBuffer(contiguousBytes: ptr, count: ptr.count)
|
||||
var monster: Monster = getRoot(byteBuffer: &bytes)
|
||||
@@ -339,7 +339,7 @@ class FlatBuffersMonsterWriterTests: XCTestCase {
|
||||
}
|
||||
|
||||
let secondByteBuffer = fbb.sizedBuffer
|
||||
let secondMessage = Message<Monster>(byteBuffer: secondByteBuffer)
|
||||
let secondMessage = GRPCMessage<Monster>(byteBuffer: secondByteBuffer)
|
||||
secondMessage.withUnsafeReadableBytes { ptr in
|
||||
var bytes = ByteBuffer(contiguousBytes: ptr, count: ptr.count)
|
||||
var monster: Monster = getRoot(byteBuffer: &bytes)
|
||||
|
||||
Reference in New Issue
Block a user