mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-14 08:26:59 +00:00
Run clang-format -i **/*.cpp (#8865)
This commit is contained in:
@@ -79,7 +79,7 @@ void Offset64Test() {
|
||||
}
|
||||
|
||||
{
|
||||
const RootTable *root_table = GetRootTable(builder.GetBufferPointer());
|
||||
const RootTable* root_table = GetRootTable(builder.GetBufferPointer());
|
||||
|
||||
// Expect the far vector to be properly sized.
|
||||
TEST_EQ(root_table->far_vector()->size(), far_vector_size);
|
||||
@@ -130,12 +130,12 @@ void Offset64NestedFlatBuffer() {
|
||||
fbb.Finish(root_table_offset);
|
||||
|
||||
// Ensure the buffer is valid.
|
||||
const RootTable *root_table = GetRootTable(fbb.GetBufferPointer());
|
||||
const RootTable* root_table = GetRootTable(fbb.GetBufferPointer());
|
||||
TEST_EQ_STR(root_table->near_string()->c_str(), "nested: some near string");
|
||||
|
||||
// Copy the data out of the builder.
|
||||
std::vector<uint8_t> nested_data{ fbb.GetBufferPointer(),
|
||||
fbb.GetBufferPointer() + fbb.GetSize() };
|
||||
std::vector<uint8_t> nested_data{fbb.GetBufferPointer(),
|
||||
fbb.GetBufferPointer() + fbb.GetSize()};
|
||||
|
||||
{
|
||||
// Clear so we can reuse the builder.
|
||||
@@ -167,7 +167,7 @@ void Offset64NestedFlatBuffer() {
|
||||
}
|
||||
|
||||
{
|
||||
const RootTable *root_table = GetRootTable(fbb.GetBufferPointer());
|
||||
const RootTable* root_table = GetRootTable(fbb.GetBufferPointer());
|
||||
|
||||
// Test that the parent buffer field is ok.
|
||||
TEST_EQ_STR(root_table->near_string()->c_str(), "some near string");
|
||||
@@ -185,7 +185,7 @@ void Offset64CreateDirect() {
|
||||
FlatBufferBuilder64 fbb;
|
||||
|
||||
// Create a vector of some data
|
||||
std::vector<uint8_t> data{ 0, 1, 2 };
|
||||
std::vector<uint8_t> data{0, 1, 2};
|
||||
|
||||
// Call the "Direct" creation method to ensure that things are added to the
|
||||
// buffer in the correct order, Offset64 first followed by any Offsets.
|
||||
@@ -205,7 +205,7 @@ void Offset64CreateDirect() {
|
||||
TEST_EQ(VerifyRootTableBuffer(verifier), true);
|
||||
|
||||
// Verify the data.
|
||||
const RootTable *root_table = GetRootTable(fbb.GetBufferPointer());
|
||||
const RootTable* root_table = GetRootTable(fbb.GetBufferPointer());
|
||||
TEST_EQ(root_table->far_vector()->size(), data.size());
|
||||
TEST_EQ(root_table->big_vector()->size(), data.size());
|
||||
TEST_EQ_STR(root_table->far_string()->c_str(), "some far string");
|
||||
@@ -214,8 +214,8 @@ void Offset64CreateDirect() {
|
||||
|
||||
void Offset64Evolution() {
|
||||
// Some common data for the tests.
|
||||
const std::vector<uint8_t> data = { 1, 2, 3, 4 };
|
||||
const std::vector<uint8_t> big_data = { 6, 7, 8, 9, 10 };
|
||||
const std::vector<uint8_t> data = {1, 2, 3, 4};
|
||||
const std::vector<uint8_t> big_data = {6, 7, 8, 9, 10};
|
||||
|
||||
// Built V1 read V2
|
||||
{
|
||||
@@ -301,13 +301,13 @@ void Offset64VectorOfStructs() {
|
||||
FlatBufferBuilder64 builder;
|
||||
|
||||
std::vector<LeafStruct> far_leaves;
|
||||
far_leaves.emplace_back(LeafStruct{ 123, 4.567 });
|
||||
far_leaves.emplace_back(LeafStruct{ 987, 6.543 });
|
||||
far_leaves.emplace_back(LeafStruct{123, 4.567});
|
||||
far_leaves.emplace_back(LeafStruct{987, 6.543});
|
||||
|
||||
std::vector<LeafStruct> big_leaves;
|
||||
big_leaves.emplace_back(LeafStruct{ 72, 72.8 });
|
||||
big_leaves.emplace_back(LeafStruct{ 82, 82.8 });
|
||||
big_leaves.emplace_back(LeafStruct{ 92, 92.8 });
|
||||
big_leaves.emplace_back(LeafStruct{72, 72.8});
|
||||
big_leaves.emplace_back(LeafStruct{82, 82.8});
|
||||
big_leaves.emplace_back(LeafStruct{92, 92.8});
|
||||
|
||||
// Add the two vectors of leaf structs.
|
||||
const Offset<RootTable> root_table_offset =
|
||||
@@ -327,7 +327,7 @@ void Offset64VectorOfStructs() {
|
||||
TEST_EQ(VerifyRootTableBuffer(verifier), true);
|
||||
|
||||
// Verify the data.
|
||||
const RootTable *root_table = GetRootTable(builder.GetBufferPointer());
|
||||
const RootTable* root_table = GetRootTable(builder.GetBufferPointer());
|
||||
TEST_EQ(root_table->far_struct_vector()->size(), far_leaves.size());
|
||||
TEST_EQ(root_table->far_struct_vector()->Get(0)->a(), 123);
|
||||
TEST_EQ(root_table->far_struct_vector()->Get(0)->b(), 4.567);
|
||||
@@ -369,7 +369,7 @@ void Offset64SizePrefix() {
|
||||
|
||||
TEST_EQ(VerifySizePrefixedRootTableBuffer(verifier), true);
|
||||
|
||||
const RootTable *root_table =
|
||||
const RootTable* root_table =
|
||||
GetSizePrefixedRootTable(builder.GetBufferPointer());
|
||||
|
||||
// Verify the fields.
|
||||
@@ -432,7 +432,7 @@ void Offset64ManyVectors() {
|
||||
|
||||
TEST_EQ(VerifyRootTableBuffer(verifier), true);
|
||||
|
||||
const RootTable *root_table = GetRootTable(builder.GetBufferPointer());
|
||||
const RootTable* root_table = GetRootTable(builder.GetBufferPointer());
|
||||
|
||||
// Verify the fields.
|
||||
TEST_EQ_STR(root_table->far_string()->c_str(), "some far string");
|
||||
@@ -449,7 +449,7 @@ void Offset64ForceAlign() {
|
||||
|
||||
// Setup some data to serialize that is less than the force_align size of 32
|
||||
// bytes.
|
||||
std::vector<uint8_t> data{ 1, 2, 3 };
|
||||
std::vector<uint8_t> data{1, 2, 3};
|
||||
|
||||
// Use the CreateDirect which calls the ForceVectorAlign
|
||||
const auto root_table_offset =
|
||||
|
||||
Reference in New Issue
Block a user