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

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

Issue 1322483002: Revert https://codereview.chromium.org/1291903002 (protobuf roll). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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/unknown_field_set_unittest.cc
diff --git a/third_party/protobuf/src/google/protobuf/unknown_field_set_unittest.cc b/third_party/protobuf/src/google/protobuf/unknown_field_set_unittest.cc
index 9b02f0b040708646cb10b85f8d3cf12667588cdd..c6b8769f32b0f6fb213cb3661c2324f614734297 100644
--- a/third_party/protobuf/src/google/protobuf/unknown_field_set_unittest.cc
+++ b/third_party/protobuf/src/google/protobuf/unknown_field_set_unittest.cc
@@ -1,6 +1,6 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
+// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -118,12 +118,7 @@ TEST_F(UnknownFieldSetTest, AllFieldsPresent) {
const FieldDescriptor* field = descriptor_->FindFieldByNumber(i);
if (field != NULL) {
ASSERT_LT(pos, unknown_fields_->field_count());
- // Do not check oneof field if it is not set.
- if (field->containing_oneof() == NULL) {
- EXPECT_EQ(i, unknown_fields_->field(pos++).number());
- } else if (i == unknown_fields_->field(pos).number()) {
- pos++;
- }
+ EXPECT_EQ(i, unknown_fields_->field(pos++).number());
if (field->is_repeated()) {
// Should have a second instance.
ASSERT_LT(pos, unknown_fields_->field_count());
@@ -482,13 +477,6 @@ TEST_F(UnknownFieldSetTest, UnknownEnumValue) {
}
}
-TEST_F(UnknownFieldSetTest, SpaceUsedExcludingSelf) {
- UnknownFieldSet empty;
- empty.AddVarint(1, 0);
- EXPECT_EQ(sizeof(vector<UnknownField>) + sizeof(UnknownField),
- empty.SpaceUsedExcludingSelf());
-}
-
TEST_F(UnknownFieldSetTest, SpaceUsed) {
unittest::TestEmptyMessage empty_message;

Powered by Google App Engine
This is Rietveld 408576698