diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2015-08-22 18:25:48 -0700 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2015-08-22 18:25:48 -0700 |
commit | eee38b0c018b3279f77d03dff796f440f40d3516 (patch) | |
tree | 7ff0978e30238d493fc7899b75abeb6d66939f07 /src/google/protobuf/lite_unittest.cc | |
parent | c3bc155aceda36ecb01cde2367a3b427f2d7ce40 (diff) |
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/lite_unittest.cc')
-rw-r--r-- | src/google/protobuf/lite_unittest.cc | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/src/google/protobuf/lite_unittest.cc b/src/google/protobuf/lite_unittest.cc index 5af8b24d..d1948ab5 100644 --- a/src/google/protobuf/lite_unittest.cc +++ b/src/google/protobuf/lite_unittest.cc @@ -33,6 +33,7 @@ #include <string> #include <iostream> +#include <google/protobuf/stubs/logging.h> #include <google/protobuf/stubs/common.h> #include <google/protobuf/arena_test_util.h> #include <google/protobuf/map_lite_unittest.pb.h> @@ -377,13 +378,6 @@ int main(int argc, char* argv[]) { } { - // Proto2SetMapFieldsInitialized - protobuf_unittest::TestEnumStartWithNonZeroMapLite message; - EXPECT_EQ(protobuf_unittest::PROTO2_NON_ZERO_MAP_ENUM_FOO_LITE, - (*message.mutable_map_field())[0]); - } - - { // Clear protobuf_unittest::TestMapLite message; @@ -692,37 +686,6 @@ int main(int argc, char* argv[]) { EXPECT_TRUE(map_message.IsInitialized()); } - // arena support for map ========================================= - - { - // ParsingAndSerializingNoHeapAllocation - - // Allocate a large initial block to avoid mallocs during hooked test. - std::vector<char> arena_block(128 * 1024); - google::protobuf::ArenaOptions options; - options.initial_block = &arena_block[0]; - options.initial_block_size = arena_block.size(); - google::protobuf::Arena arena(options); - string data; - data.reserve(128 * 1024); - - { - google::protobuf::internal::NoHeapChecker no_heap; - - protobuf_unittest::TestArenaMapLite* from = - google::protobuf::Arena::CreateMessage<protobuf_unittest::TestArenaMapLite>( - &arena); - google::protobuf::MapLiteTestUtil::SetArenaMapFields(from); - from->SerializeToString(&data); - - protobuf_unittest::TestArenaMapLite* to = - google::protobuf::Arena::CreateMessage<protobuf_unittest::TestArenaMapLite>( - &arena); - to->ParseFromString(data); - google::protobuf::MapLiteTestUtil::ExpectArenaMapFieldsSet(*to); - } - } - std::cout << "PASS" << std::endl; return 0; } |