Upgrade linux protobuf

This commit is contained in:
John Colvin committed 2021-12-12 15:56:55 -05:00
1 parent 79f2f356d5
commit 0f3130fb47
689 files changed
+141922 -132057

No files matched your search

@@ -36,13 +36,12 @@
#include <memory>
#include <google/protobuf/testing/file.h>
#include <google/protobuf/testing/file.h>
#include <google/protobuf/compiler/java/java_generator.h>
#include <google/protobuf/compiler/command_line_interface.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/io/printer.h>
#include <google/protobuf/testing/file.h>
#include <google/protobuf/testing/file.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/testing/googletest.h>
#include <gtest/gtest.h>
@@ -58,10 +57,9 @@ class TestGenerator : public CodeGenerator {
~TestGenerator() {}
virtual bool Generate(const FileDescriptor* file,
const string& parameter,
GeneratorContext* context,
string* error) const {
string filename = "Test.java";
const std::string& parameter, GeneratorContext* context,
std::string* error) const {
std::string filename = "Test.java";
TryInsert(filename, "outer_class_scope", context);
TryInsert(filename, "class_scope:foo.Bar", context);
TryInsert(filename, "class_scope:foo.Bar.Baz", context);
@@ -71,7 +69,8 @@ class TestGenerator : public CodeGenerator {
return true;
}
void TryInsert(const string& filename, const string& insertion_point,
void TryInsert(const std::string& filename,
const std::string& insertion_point,
GeneratorContext* context) const {
std::unique_ptr<io::ZeroCopyOutputStream> output(
context->OpenForInsert(filename, insertion_point));
@@ -95,7 +94,7 @@ TEST(JavaPluginTest, PluginTest) {
"enum Qux { BLAH = 1; }\n",
true));
google::protobuf::compiler::CommandLineInterface cli;
CommandLineInterface cli;
cli.SetInputsAreProtoPathRelative(true);
JavaGenerator java_generator;
@@ -103,17 +102,12 @@ TEST(JavaPluginTest, PluginTest) {
cli.RegisterGenerator("--java_out", &java_generator, "");
cli.RegisterGenerator("--test_out", &test_generator, "");
string proto_path = "-I" + TestTempDir();
string java_out = "--java_out=" + TestTempDir();
string test_out = "--test_out=" + TestTempDir();
std::string proto_path = "-I" + TestTempDir();
std::string java_out = "--java_out=" + TestTempDir();
std::string test_out = "--test_out=" + TestTempDir();
const char* argv[] = {
"protoc",
proto_path.c_str(),
java_out.c_str(),
test_out.c_str(),
"test.proto"
};
const char* argv[] = {"protoc", proto_path.c_str(), java_out.c_str(),
test_out.c_str(), "test.proto"};
EXPECT_EQ(0, cli.Run(5, argv));
}