mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-22 22:58:53 +00:00
Code cleanup + updates test and readme (#6004)
Updates Readme + adds asserts Fixes documentation
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
# FlatBuffers.GRPC.Swift
|
||||
|
||||
The following is Swift example on how GRPC would be with Swift Flatbuffers
|
||||
The following is Swift example on how GRPC would be with Swift Flatbuffers, you can simply run the following commands:
|
||||
|
||||
`swift run Server`
|
||||
|
||||
`swift run Client {port} {name}`
|
||||
|
||||
@@ -34,13 +34,6 @@ final class FlatBuffersTests: XCTestCase {
|
||||
XCTAssertEqual(b.startTable(with: 0), 12)
|
||||
}
|
||||
|
||||
func testCreate() {
|
||||
var b = FlatBufferBuilder(initialSize: 16)
|
||||
_ = Country.createCountry(builder: &b, name: country, log: 200, lan: 100)
|
||||
let v: [UInt8] = [10, 0, 16, 0, 4, 0, 8, 0, 12, 0, 10, 0, 0, 0, 12, 0, 0, 0, 100, 0, 0, 0, 200, 0, 0, 0, 6, 0, 0, 0, 78, 111, 114, 119, 97, 121, 0, 0]
|
||||
XCTAssertEqual(b.sizedByteArray, v)
|
||||
}
|
||||
|
||||
func testCreateFinish() {
|
||||
var b = FlatBufferBuilder(initialSize: 16)
|
||||
let countryOff = Country.createCountry(builder: &b, name: country, log: 200, lan: 100)
|
||||
|
||||
@@ -5,13 +5,6 @@ final class FlatBuffersDoubleTests: XCTestCase {
|
||||
|
||||
let country = "Norway"
|
||||
|
||||
func testCreateCountry() {
|
||||
var b = FlatBufferBuilder(initialSize: 16)
|
||||
_ = CountryDouble.createCountry(builder: &b, name: country, log: 200, lan: 100)
|
||||
let v: [UInt8] = [10, 0, 28, 0, 4, 0, 8, 0, 16, 0, 10, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 64, 0, 0, 0, 0, 0, 0, 105, 64, 0, 0, 0, 0, 6, 0, 0, 0, 78, 111, 114, 119, 97, 121, 0, 0]
|
||||
XCTAssertEqual(b.sizedByteArray, v)
|
||||
}
|
||||
|
||||
func testCreateFinish() {
|
||||
var b = FlatBufferBuilder(initialSize: 16)
|
||||
let countryOff = CountryDouble.createCountry(builder: &b, name: country, log: 200, lan: 100)
|
||||
|
||||
@@ -6,7 +6,6 @@ extension FlatBuffersDoubleTests {
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__FlatBuffersDoubleTests = [
|
||||
("testCreateCountry", testCreateCountry),
|
||||
("testCreateFinish", testCreateFinish),
|
||||
("testCreateFinishWithPrefix", testCreateFinishWithPrefix),
|
||||
]
|
||||
@@ -48,7 +47,6 @@ extension FlatBuffersTests {
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__FlatBuffersTests = [
|
||||
("testCreate", testCreate),
|
||||
("testCreateFinish", testCreateFinish),
|
||||
("testCreateFinishWithPrefix", testCreateFinishWithPrefix),
|
||||
("testCreateString", testCreateString),
|
||||
|
||||
Reference in New Issue
Block a user