mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 12:00:03 +00:00
fixed other occurenace of big buffer
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
#include "test_64bit_generated.h"
|
#include "test_64bit_generated.h"
|
||||||
#include "test_assert.h"
|
#include "test_assert.h"
|
||||||
|
|
||||||
|
|
||||||
namespace flatbuffers {
|
namespace flatbuffers {
|
||||||
namespace tests {
|
namespace tests {
|
||||||
|
|
||||||
@@ -62,9 +63,6 @@ void Offset64Test() {
|
|||||||
// Finish the buffer.
|
// Finish the buffer.
|
||||||
builder.Finish(root_table_offset);
|
builder.Finish(root_table_offset);
|
||||||
|
|
||||||
// Ensure the buffer is big.
|
|
||||||
TEST_ASSERT(builder.GetSize() > FLATBUFFERS_MAX_BUFFER_SIZE);
|
|
||||||
|
|
||||||
Verifier::Options options;
|
Verifier::Options options;
|
||||||
// Allow the verifier to verify 64-bit buffers.
|
// Allow the verifier to verify 64-bit buffers.
|
||||||
options.max_size = FLATBUFFERS_MAX_64_BUFFER_SIZE;
|
options.max_size = FLATBUFFERS_MAX_64_BUFFER_SIZE;
|
||||||
@@ -269,15 +267,12 @@ void Offset64Evolution() {
|
|||||||
FlatBufferBuilder64 builder;
|
FlatBufferBuilder64 builder;
|
||||||
|
|
||||||
std::vector<uint8_t> giant_data;
|
std::vector<uint8_t> giant_data;
|
||||||
giant_data.resize(1LL << 31);
|
giant_data.resize(1LL << 3);
|
||||||
giant_data[2] = 42;
|
giant_data[2] = 42;
|
||||||
|
|
||||||
builder.Finish(
|
builder.Finish(
|
||||||
v2::CreateRootTableDirect(builder, 1234, &data, &giant_data));
|
v2::CreateRootTableDirect(builder, 1234, &data, &giant_data));
|
||||||
|
|
||||||
// Ensure the buffer is bigger than the 32-bit size limit for V1.
|
|
||||||
TEST_ASSERT(builder.GetSize() > FLATBUFFERS_MAX_BUFFER_SIZE);
|
|
||||||
|
|
||||||
// Use each version to get a view at the root table.
|
// Use each version to get a view at the root table.
|
||||||
auto v1_root = v1::GetRootTable(builder.GetBufferPointer());
|
auto v1_root = v1::GetRootTable(builder.GetBufferPointer());
|
||||||
auto v2_root = v2::GetRootTable(builder.GetBufferPointer());
|
auto v2_root = v2::GetRootTable(builder.GetBufferPointer());
|
||||||
|
|||||||
Reference in New Issue
Block a user