aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/map_test.cc
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2017-07-18 15:38:30 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2017-07-18 15:38:30 -0700
commit09354db1434859a31a3c81abebcc4018d42f2715 (patch)
treeb87c7cdc2255e6c8062ab92b4082665cd698d753 /src/google/protobuf/map_test.cc
parent9053033a5076f82cf18b823c31f352e95e5bfd8d (diff)
Merge from Google internal for 3.4 release
Diffstat (limited to 'src/google/protobuf/map_test.cc')
-rw-r--r--src/google/protobuf/map_test.cc18
1 files changed, 18 insertions, 0 deletions
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) {