Get desktop application:
View/edit binary Protocol Buffers messages
(message has no fields)
(message has no fields)
Test that RPC services work.
(message has no fields)
(message has no fields)
(message has no fields)
(message has no fields)
Used in: , , , ,
Define these after TestAllTypes to make sure the compiler can handle that.
Used in: , , ,
Test int32, uint32, int64, uint64, and bool are all compatible
This proto includes a recusively nested message.
Test String and Bytes: string is for valid UTF-8 strings
(message has no fields)
This proto includes every type of field in both singular and repeated forms.
Used in: , , , , , ,
Singular
Defined in unittest_import_public.proto
Repeated
Singular with defaults
For oneof test
Used in:
Intentionally negative.
Used in: ,
The field name "b" fails to compile in proto1 because it conflicts with a local variable named "b" in one of the generated methods. Doh. This file needs to compile in proto1 to test backwards-compatibility.
Test message with CamelCase field names. This violates Protocol Buffer standard style.
*/ <- This should not close the generated doc comment
Test that groups have disjoint field numbers from their siblings and parents. This is NOT possible in proto1; only google.protobuf. When attempting to compile with proto1, this will emit an error; so we only include it in protobuf_unittest_proto.
NO_PROTO1
NO_PROTO1
Used by ExtensionSetTest/DynamicExtensions. The test actually builds a set of extensions to TestAllExtensions dynamically, based on the fields of this message type.
Used in:
Used in:
Additional messages for testing lazy fields.
TestEmptyMessage is used to test unknown field support.
(message has no fields)
Like above, but declare all field numbers as potential extensions. No actual extensions should ever be defined for this type.
(message has no fields)
Test an enum that has multiple values with the same number.
optional bytes escaped_bytes = 1 [default = "\0\001\a\b\f\n\r\t\v\\\'\"\xfe"];
The default value here is UTF-8 for "\u1234". (We could also just type the UTF-8 text directly into this text file rather than escape it, but lots of people use editors that would be confused by this.)
Tests for single-precision floating-point values.
Using exponents
Tests for C++ trigraphs. Trigraphs should be escaped in C++ generated files, but they should not be escaped for other languages. Note that in .proto file, "\?" is a valid way to escape ? in string literals.
String defaults containing the character '\000'
We list fields out of order, to ensure that we're using field number and not field index to determine serialization order.
Used in:
The field name "b" fails to compile in proto1 because it conflicts with a local variable named "b" in one of the generated methods. Doh. This file needs to compile in proto1 to test backwards-compatibility.
Test that we can use NestedMessage from outside TestAllTypes.
(message has no fields)
Test that mutual recursion works.
Used in:
Used in:
(message has no fields)
Needed for a Python test.
Used in:
Test oneofs.
group FooGroup = 4 { optional int32 a = 5; optional string b = 6; }
group FooGroup = 8 { optional int32 a = 9; optional string b = 10; }
string bar_string = 13 [default = "STRING"]; string bar_cord = 14 [ctype=CORD, default = "CORD"]; string bar_string_piece = 15 [ctype=STRING_PIECE, default = "SPIECE"]; bytes bar_bytes = 16 [default = "BYTES"];
Used in:
Used in:
optional group FooGroup = 4 { optional int32 a = 5; optional string b = 6; }
(message has no fields)
Test that if an optional or required message/group field appears multiple times in the input, they need to be merged.
RepeatedFieldsGenerator defines matching field types as TestParsingMerge, except that all fields are repeated. In the tests, we will serialize the RepeatedFieldsGenerator to bytes, and parse the bytes to TestParsingMerge. Repeated fields in RepeatedFieldsGenerator are expected to be merged into the corresponding required/optional fields in TestParsingMerge.
repeated group Group1 = 10 { optional TestAllTypes field1 = 11; } repeated group Group2 = 20 { optional TestAllTypes field1 = 21; }
Test that really large tag numbers don't break anything.
The largest possible tag number is 2^28 - 1, since the wire format uses three bits to communicate wire type.
Parsing repeated fixed size values used to fail. This message needs to be used in order to get a tag of the right size; all of the repeated fields in TestAllTypes didn't trigger the check.
Check for a varint type, just for good measure.
These have two-byte tags.
Three byte tags.
We have separate messages for testing required fields because it's annoying to have to fill in required fields in TestProto in order to do anything with it. Note that we don't need to test every type of required filed because the code output is basically identical to optional fields for all types.
Used in:
Pad the field count to 32 so that we can test that IsInitialized() properly checks multiple elements of has_bits_.
Used in:
(message has no fields)
Test an enum with large, unordered values.
Used in:
(message has no fields)
A message with the same fields as TestPackedTypes, but without packing. Used to test packed <-> unpacked wire compatibility.