fixed other occurenace of big buffer

This commit is contained in:
Derek Bailey
2023-05-11 09:39:54 -07:00
parent 9fc153a8f8
commit 66e9d9823a

View File

@@ -16,6 +16,7 @@
#include "test_64bit_generated.h"
#include "test_assert.h"
namespace flatbuffers {
namespace tests {
@@ -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;
@@ -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());