Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: third_party/protobuf/src/google/protobuf/test_util.cc

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/test_util.cc
diff --git a/third_party/protobuf/src/google/protobuf/test_util.cc b/third_party/protobuf/src/google/protobuf/test_util.cc
index 07aa1d7781b55459768c96ca7fbae85fe10ffd36..4e02a85d8504751b0a6726c7faafbad6ca62400f 100644
--- a/third_party/protobuf/src/google/protobuf/test_util.cc
+++ b/third_party/protobuf/src/google/protobuf/test_util.cc
@@ -3230,7 +3230,7 @@ void TestUtil::ReflectionTester::RemoveLastRepeatedsViaReflection(
Message* message) {
const Reflection* reflection = message->GetReflection();
- vector<const FieldDescriptor*> output;
+ std::vector<const FieldDescriptor*> output;
reflection->ListFields(*message, &output);
for (int i=0; i<output.size(); ++i) {
const FieldDescriptor* field = output[i];
@@ -3244,7 +3244,7 @@ void TestUtil::ReflectionTester::ReleaseLastRepeatedsViaReflection(
Message* message, bool expect_extensions_notnull) {
const Reflection* reflection = message->GetReflection();
- vector<const FieldDescriptor*> output;
+ std::vector<const FieldDescriptor*> output;
reflection->ListFields(*message, &output);
for (int i=0; i<output.size(); ++i) {
const FieldDescriptor* field = output[i];
@@ -3263,7 +3263,7 @@ void TestUtil::ReflectionTester::ReleaseLastRepeatedsViaReflection(
void TestUtil::ReflectionTester::SwapRepeatedsViaReflection(Message* message) {
const Reflection* reflection = message->GetReflection();
- vector<const FieldDescriptor*> output;
+ std::vector<const FieldDescriptor*> output;
reflection->ListFields(*message, &output);
for (int i=0; i<output.size(); ++i) {
const FieldDescriptor* field = output[i];
@@ -3278,7 +3278,7 @@ SetAllocatedOptionalMessageFieldsToNullViaReflection(
Message* message) {
const Reflection* reflection = message->GetReflection();
- vector<const FieldDescriptor*> fields;
+ std::vector<const FieldDescriptor*> fields;
reflection->ListFields(*message, &fields);
for (int i = 0; i < fields.size(); ++i) {
@@ -3298,7 +3298,7 @@ SetAllocatedOptionalMessageFieldsToMessageViaReflection(
const Reflection* from_reflection = from_message->GetReflection();
const Reflection* to_reflection = to_message->GetReflection();
- vector<const FieldDescriptor*> fields;
+ std::vector<const FieldDescriptor*> fields;
from_reflection->ListFields(*from_message, &fields);
for (int i = 0; i < fields.size(); ++i) {
@@ -3332,7 +3332,11 @@ void TestUtil::ReflectionTester::ExpectMessagesReleasedViaReflection(
break;
case NOT_NULL:
EXPECT_TRUE(released != NULL);
- EXPECT_EQ(&sub_message, released);
+ if (message->GetArena() == NULL) {
+ // released message must be same as sub_message if source message is
+ // not on arena.
+ EXPECT_EQ(&sub_message, released);
+ }
break;
case CAN_BE_NULL:
break;

Powered by Google App Engine
This is Rietveld 408576698