mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 10:18:06 +00:00
* RFC: Add ExternalStorage for ByteBuffer in Swift implementation This PR proposed one more API for ByteBuffer such that no copy is required to parse FlatBuffers content. This API has limited use, but for cases that you need to read part of the flatbuffers' data to decide whether you want to parse / copy the full buffer out, it is useful. * Use a variable rather than protocol. * Revert grouping changes from the other PR. * Add unit test to read from unowned UnsafePointer. * Manifest changed.
98 lines
3.8 KiB
Swift
98 lines
3.8 KiB
Swift
#if !canImport(ObjectiveC)
|
|
import XCTest
|
|
|
|
extension FlatBuffersDoubleTests {
|
|
// DO NOT MODIFY: This is autogenerated, use:
|
|
// `swift test --generate-linuxmain`
|
|
// to regenerate.
|
|
static let __allTests__FlatBuffersDoubleTests = [
|
|
("testCreateCountry", testCreateCountry),
|
|
("testCreateFinish", testCreateFinish),
|
|
("testCreateFinishWithPrefix", testCreateFinishWithPrefix),
|
|
]
|
|
}
|
|
|
|
extension FlatBuffersMonsterWriterTests {
|
|
// DO NOT MODIFY: This is autogenerated, use:
|
|
// `swift test --generate-linuxmain`
|
|
// to regenerate.
|
|
static let __allTests__FlatBuffersMonsterWriterTests = [
|
|
("testCreateMonster", testCreateMonster),
|
|
("testCreateMonsterPrefixed", testCreateMonsterPrefixed),
|
|
("testCreateMonsterResizedBuffer", testCreateMonsterResizedBuffer),
|
|
("testData", testData),
|
|
("testReadFromOtherLanguages", testReadFromOtherLanguages),
|
|
("testReadMonsterFromUnsafePointerWithoutCopying", testReadMonsterFromUnsafePointerWithoutCopying),
|
|
]
|
|
}
|
|
|
|
extension FlatBuffersStructsTests {
|
|
// DO NOT MODIFY: This is autogenerated, use:
|
|
// `swift test --generate-linuxmain`
|
|
// to regenerate.
|
|
static let __allTests__FlatBuffersStructsTests = [
|
|
("testCreatingEnums", testCreatingEnums),
|
|
("testCreatingStruct", testCreatingStruct),
|
|
("testCreatingVectorStruct", testCreatingVectorStruct),
|
|
("testCreatingVectorStructWithForcedDefaults", testCreatingVectorStructWithForcedDefaults),
|
|
("testReadingStruct", testReadingStruct),
|
|
("testReadingStructWithEnums", testReadingStructWithEnums),
|
|
("testWritingAndMutatingBools", testWritingAndMutatingBools),
|
|
]
|
|
}
|
|
|
|
extension FlatBuffersTests {
|
|
// DO NOT MODIFY: This is autogenerated, use:
|
|
// `swift test --generate-linuxmain`
|
|
// to regenerate.
|
|
static let __allTests__FlatBuffersTests = [
|
|
("testCreate", testCreate),
|
|
("testCreateFinish", testCreateFinish),
|
|
("testCreateFinishWithPrefix", testCreateFinishWithPrefix),
|
|
("testCreateString", testCreateString),
|
|
("testEndian", testEndian),
|
|
("testOffset", testOffset),
|
|
("testReadCountry", testReadCountry),
|
|
("testStartTable", testStartTable),
|
|
]
|
|
}
|
|
|
|
extension FlatBuffersUnionTests {
|
|
// DO NOT MODIFY: This is autogenerated, use:
|
|
// `swift test --generate-linuxmain`
|
|
// to regenerate.
|
|
static let __allTests__FlatBuffersUnionTests = [
|
|
("testCreateMonstor", testCreateMonstor),
|
|
("testEndTableFinish", testEndTableFinish),
|
|
("testEnumVector", testEnumVector),
|
|
("testUnionVector", testUnionVector),
|
|
]
|
|
}
|
|
|
|
extension FlatBuffersVectors {
|
|
// DO NOT MODIFY: This is autogenerated, use:
|
|
// `swift test --generate-linuxmain`
|
|
// to regenerate.
|
|
static let __allTests__FlatBuffersVectors = [
|
|
("testCreateEmptyIntArray", testCreateEmptyIntArray),
|
|
("testCreateIntArray", testCreateIntArray),
|
|
("testCreateSharedStringVector", testCreateSharedStringVector),
|
|
("testCreateVectorOfStrings", testCreateVectorOfStrings),
|
|
("testCreatingTwoCountries", testCreatingTwoCountries),
|
|
("testReadDoubleArray", testReadDoubleArray),
|
|
("testReadInt32Array", testReadInt32Array),
|
|
]
|
|
}
|
|
|
|
public func __allTests() -> [XCTestCaseEntry] {
|
|
return [
|
|
testCase(FlatBuffersDoubleTests.__allTests__FlatBuffersDoubleTests),
|
|
testCase(FlatBuffersMonsterWriterTests.__allTests__FlatBuffersMonsterWriterTests),
|
|
testCase(FlatBuffersStructsTests.__allTests__FlatBuffersStructsTests),
|
|
testCase(FlatBuffersTests.__allTests__FlatBuffersTests),
|
|
testCase(FlatBuffersUnionTests.__allTests__FlatBuffersUnionTests),
|
|
testCase(FlatBuffersVectors.__allTests__FlatBuffersVectors),
|
|
]
|
|
}
|
|
#endif
|