From 09354db1434859a31a3c81abebcc4018d42f2715 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Tue, 18 Jul 2017 15:38:30 -0700 Subject: Merge from Google internal for 3.4 release --- src/google/protobuf/map_test.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/google/protobuf/map_test.cc') diff --git a/src/google/protobuf/map_test.cc b/src/google/protobuf/map_test.cc index a06b432a..960589ce 100644 --- a/src/google/protobuf/map_test.cc +++ b/src/google/protobuf/map_test.cc @@ -236,6 +236,13 @@ TEST_F(MapImplTest, UsageErrors) { #endif // PROTOBUF_HAS_DEATH_TEST +TEST_F(MapImplTest, MapKeyAssignment) { + MapKey from, to; + from.SetStringValue("abc"); + to = from; + EXPECT_EQ("abc", to.GetStringValue()); +} + TEST_F(MapImplTest, CountNonExist) { EXPECT_EQ(0, map_.count(0)); } @@ -954,6 +961,17 @@ TEST_F(MapImplTest, SwapArena) { testing::Pair(9398, 41999))); } +TEST_F(MapImplTest, CopyAssignMapIterator) { + TestMap message; + MapReflectionTester reflection_tester( + unittest::TestMap::descriptor()); + reflection_tester.SetMapFieldsViaMapReflection(&message); + MapIterator it1 = reflection_tester.MapBegin(&message, "map_int32_int32"); + MapIterator it2 = reflection_tester.MapEnd(&message, "map_int32_int32"); + it2 = it1; + EXPECT_EQ(it1.GetKey().GetInt32Value(), it2.GetKey().GetInt32Value()); +} + // Map Field Reflection Test ======================================== static int Func(int i, int j) { -- cgit v1.2.3