aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/java/java_plugin_unittest.cc
diff options
context:
space:
mode:
authorjieluo@google.com <jieluo@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2014-07-18 00:47:59 +0000
committerjieluo@google.com <jieluo@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2014-07-18 00:47:59 +0000
commit4de8f55113007fdc8e34107950e605fc0209d465 (patch)
tree92b7da8757a7740d9e1f2d3ead233542947d8c8c /src/google/protobuf/compiler/java/java_plugin_unittest.cc
parentc5553a3d18f80132b9079c5504bc0aa1f7f950a0 (diff)
downloadprotobuf-4de8f55113007fdc8e34107950e605fc0209d465.tar.gz
protobuf-4de8f55113007fdc8e34107950e605fc0209d465.tar.bz2
protobuf-4de8f55113007fdc8e34107950e605fc0209d465.zip
down integrate to svn
Diffstat (limited to 'src/google/protobuf/compiler/java/java_plugin_unittest.cc')
-rw-r--r--src/google/protobuf/compiler/java/java_plugin_unittest.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/google/protobuf/compiler/java/java_plugin_unittest.cc b/src/google/protobuf/compiler/java/java_plugin_unittest.cc
index ccc94c9d..52577626 100644
--- a/src/google/protobuf/compiler/java/java_plugin_unittest.cc
+++ b/src/google/protobuf/compiler/java/java_plugin_unittest.cc
@@ -34,6 +34,8 @@
// It seemed like parameterizing it would add more complexity than it is
// worth.
+#include <memory>
+
#include <google/protobuf/compiler/java/java_generator.h>
#include <google/protobuf/compiler/command_line_interface.h>
#include <google/protobuf/io/zero_copy_stream.h>
@@ -71,7 +73,7 @@ class TestGenerator : public CodeGenerator {
void TryInsert(const string& filename, const string& insertion_point,
GeneratorContext* context) const {
scoped_ptr<io::ZeroCopyOutputStream> output(
- context->OpenForInsert(filename, insertion_point));
+ context->OpenForInsert(filename, insertion_point));
io::Printer printer(output.get(), '$');
printer.Print("// inserted $name$\n", "name", insertion_point);
}
@@ -81,16 +83,16 @@ class TestGenerator : public CodeGenerator {
// not verify that they are correctly-placed; that would require actually
// compiling the output which is a bit more than I care to do for this test.
TEST(JavaPluginTest, PluginTest) {
- File::WriteStringToFileOrDie(
- "syntax = \"proto2\";\n"
- "package foo;\n"
- "option java_package = \"\";\n"
- "option java_outer_classname = \"Test\";\n"
- "message Bar {\n"
- " message Baz {}\n"
- "}\n"
- "enum Qux { BLAH = 1; }\n",
- TestTempDir() + "/test.proto");
+ GOOGLE_CHECK_OK(File::SetContents(TestTempDir() + "/test.proto",
+ "syntax = \"proto2\";\n"
+ "package foo;\n"
+ "option java_package = \"\";\n"
+ "option java_outer_classname = \"Test\";\n"
+ "message Bar {\n"
+ " message Baz {}\n"
+ "}\n"
+ "enum Qux { BLAH = 1; }\n",
+ true));
google::protobuf::compiler::CommandLineInterface cli;
cli.SetInputsAreProtoPathRelative(true);