31 #include <google/protobuf/arena_test_util.h>
32 #include <google/protobuf/map_lite_test_util.h>
33 #include <gtest/gtest.h>
43 options.start_block_size = 128 * 1024;
44 options.max_block_size = 128 * 1024;
48 Arena::CreateArray<char>(
arena_.get(), 1);
54 TEST_F(LiteArenaTest, MapNoHeapAllocation) {
56 data.reserve(128 * 1024);
63 protobuf_unittest::TestArenaMapLite*
from =
64 Arena::CreateMessage<protobuf_unittest::TestArenaMapLite>(
arena_.get());
68 protobuf_unittest::TestArenaMapLite*
to =
69 Arena::CreateMessage<protobuf_unittest::TestArenaMapLite>(
arena_.get());
75 TEST_F(LiteArenaTest, UnknownFieldMemLeak) {
76 protobuf_unittest::ForeignMessageArenaLite*
message =
77 Arena::CreateMessage<protobuf_unittest::ForeignMessageArenaLite>(
80 int original_capacity =
data.capacity();
81 while (
data.capacity() <= original_capacity) {