Internal changes to extensions

PiperOrigin-RevId: 509903560
pull/11953/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent 0c013ec412
commit 335a0c58b7
  1. 1
      src/google/protobuf/descriptor.cc
  2. 3
      src/google/protobuf/descriptor.h
  3. 10
      src/google/protobuf/descriptor_unittest.cc

@ -5375,6 +5375,7 @@ struct IncrementWhenDestroyed {
} // namespace
void DescriptorBuilder::BuildMessage(const DescriptorProto& proto,
const Descriptor* parent,
Descriptor* result,

@ -65,6 +65,7 @@
#include "google/protobuf/port.h"
#include "absl/base/attributes.h"
#include "absl/base/call_once.h"
#include "absl/container/btree_map.h"
#include "absl/container/flat_hash_map.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
@ -1902,7 +1903,7 @@ class PROTOBUF_EXPORT DescriptorPool {
// in a .proto file.
enum ErrorLocation {
NAME, // the symbol name, or the package name for files
NUMBER, // field or extension range number
NUMBER, // field, extension range or extension decl number
TYPE, // field type
EXTENDEE, // field extendee
DEFAULT_VALUE, // field default value

@ -3979,6 +3979,16 @@ class ValidationErrorTest : public testing::Test {
BuildFileInTestPool(DescriptorProto::descriptor()->file());
}
void BuildDescriptorMessagesInTestPoolWithErrors(
absl::string_view expected_errors) {
FileDescriptorProto file_proto;
DescriptorProto::descriptor()->file()->CopyTo(&file_proto);
MockErrorCollector error_collector;
EXPECT_TRUE(pool_.BuildFileCollectingErrors(file_proto, &error_collector) ==
nullptr);
EXPECT_EQ(error_collector.text_, expected_errors);
}
DescriptorPool pool_;
};

Loading…
Cancel
Save