|
|
@ -4548,6 +4548,12 @@ TEST_F(ValidationErrorTest, InvalidDefaults) { |
|
|
|
" field { name: \"corge\" number: 6 label: LABEL_REPEATED type: " |
|
|
|
" field { name: \"corge\" number: 6 label: LABEL_REPEATED type: " |
|
|
|
"TYPE_INT32" |
|
|
|
"TYPE_INT32" |
|
|
|
" default_value: \"1\" }" |
|
|
|
" default_value: \"1\" }" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Invalid CEscaped bytes default.
|
|
|
|
|
|
|
|
" field { name: \"bytes_default\" number: 7 label: LABEL_OPTIONAL " |
|
|
|
|
|
|
|
" type: TYPE_BYTES" |
|
|
|
|
|
|
|
" default_value: \"\\\\\" }" |
|
|
|
|
|
|
|
|
|
|
|
"}", |
|
|
|
"}", |
|
|
|
|
|
|
|
|
|
|
|
"foo.proto: Foo.foo: DEFAULT_VALUE: Couldn't parse default value " |
|
|
|
"foo.proto: Foo.foo: DEFAULT_VALUE: Couldn't parse default value " |
|
|
@ -4558,6 +4564,8 @@ TEST_F(ValidationErrorTest, InvalidDefaults) { |
|
|
|
"foo.proto: Foo.moo: DEFAULT_VALUE: Messages can't have default values.\n" |
|
|
|
"foo.proto: Foo.moo: DEFAULT_VALUE: Messages can't have default values.\n" |
|
|
|
"foo.proto: Foo.corge: DEFAULT_VALUE: Repeated fields can't have default " |
|
|
|
"foo.proto: Foo.corge: DEFAULT_VALUE: Repeated fields can't have default " |
|
|
|
"values.\n" |
|
|
|
"values.\n" |
|
|
|
|
|
|
|
"foo.proto: Foo.bytes_default: DEFAULT_VALUE: Invalid escaping in " |
|
|
|
|
|
|
|
"default value.\n" |
|
|
|
// This ends up being reported later because the error is detected at
|
|
|
|
// This ends up being reported later because the error is detected at
|
|
|
|
// cross-linking time.
|
|
|
|
// cross-linking time.
|
|
|
|
"foo.proto: Foo.mooo: DEFAULT_VALUE: Messages can't have default " |
|
|
|
"foo.proto: Foo.mooo: DEFAULT_VALUE: Messages can't have default " |
|
|
|