Skip to content

Commit

Permalink
fixed other occurenace of big buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaileychess authored and Jochen Parmentier committed Oct 29, 2024
1 parent 3a0c347 commit 91dc91f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/64bit/offset64_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "test_64bit_generated.h"
#include "test_assert.h"


namespace flatbuffers {
namespace tests {

Expand Down Expand Up @@ -62,9 +63,6 @@ void Offset64Test() {
// Finish the buffer.
builder.Finish(root_table_offset);

// Ensure the buffer is big.
TEST_ASSERT(builder.GetSize() > FLATBUFFERS_MAX_BUFFER_SIZE);

Verifier::Options options;
// Allow the verifier to verify 64-bit buffers.
options.max_size = FLATBUFFERS_MAX_64_BUFFER_SIZE;
Expand Down Expand Up @@ -269,15 +267,12 @@ void Offset64Evolution() {
FlatBufferBuilder64 builder;

std::vector<uint8_t> giant_data;
giant_data.resize(1LL << 31);
giant_data.resize(1LL << 3);
giant_data[2] = 42;

builder.Finish(
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.
auto v1_root = v1::GetRootTable(builder.GetBufferPointer());
auto v2_root = v2::GetRootTable(builder.GetBufferPointer());
Expand Down

0 comments on commit 91dc91f

Please sign in to comment.