Code cleanup + updates test and readme (#6004)

Updates Readme + adds asserts

Fixes documentation
This commit is contained in:
mustiikhalil
2020-06-30 21:37:43 +03:00
committed by GitHub
parent 8a721f69a1
commit 37a5dee105
8 changed files with 51 additions and 70 deletions

View File

@@ -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}`

View File

@@ -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)

View File

@@ -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)

View File

@@ -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),