aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/parser_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/parser_unittest.cc')
-rw-r--r--src/google/protobuf/compiler/parser_unittest.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/parser_unittest.cc b/src/google/protobuf/compiler/parser_unittest.cc
index 0725a682..008d97d5 100644
--- a/src/google/protobuf/compiler/parser_unittest.cc
+++ b/src/google/protobuf/compiler/parser_unittest.cc
@@ -39,6 +39,7 @@
#include <google/protobuf/compiler/parser.h>
+#include <google/protobuf/test_util2.h>
#include <google/protobuf/unittest.pb.h>
#include <google/protobuf/unittest_custom_options.pb.h>
#include <google/protobuf/io/tokenizer.h>
@@ -1746,7 +1747,8 @@ TEST_F(ParserValidationErrorTest, FieldDefaultValueError) {
TEST_F(ParserValidationErrorTest, FileOptionNameError) {
ExpectHasValidationErrors(
"option foo = 5;",
- "0:7: Option \"foo\" unknown.\n");
+ "0:7: Option \"foo\" unknown. Ensure that your proto definition file "
+ "imports the proto which defines the option.\n");
}
TEST_F(ParserValidationErrorTest, FileOptionValueError) {
@@ -1761,7 +1763,8 @@ TEST_F(ParserValidationErrorTest, FieldOptionNameError) {
"message Foo {\n"
" optional bool bar = 1 [foo=1];\n"
"}\n",
- "1:25: Option \"foo\" unknown.\n");
+ "1:25: Option \"foo\" unknown. Ensure that your proto definition file "
+ "imports the proto which defines the option.\n");
}
TEST_F(ParserValidationErrorTest, FieldOptionValueError) {
@@ -1866,7 +1869,7 @@ TEST_F(ParserValidationErrorTest, ResovledUndefinedOptionError) {
// base2.proto:
// package baz
- // import google/protobuf/descriptor.proto
+ // import net/proto2/proto/descriptor.proto
// message Bar { optional int32 foo = 1; }
// extend FileOptions { optional Bar bar = 7672757; }
FileDescriptorProto other_file;
@@ -1992,7 +1995,8 @@ TEST_F(ParseDescriptorDebugTest, TestAllDescriptorTypes) {
// We now have a FileDescriptorProto, but to compare with the expected we
// need to link to a FileDecriptor, then output back to a proto. We'll
// also need to give it the same name as the original.
- parsed.set_name("google/protobuf/unittest.proto");
+ parsed.set_name(
+ TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto"));
// We need the imported dependency before we can build our parsed proto
const FileDescriptor* public_import =
protobuf_unittest_import::PublicImportMessage::descriptor()->file();