1 message SubMessage { 2 required string substuff1 = 1 [default = "1"]; 3 required int32 substuff2 = 2 [default = 2]; 4 optional fixed32 substuff3 = 12365535 [default = 3]; 5 } 6 7 message EmptyMessage { 8 9 } 10 11 enum HugeEnum { 12 Negative = -2147483647; /* protoc doesn't accept -2147483648 here */ 13 Positive = 2147483647; 14 } 15 16 message Limits { 17 required int32 int32_min = 1; 18 required int32 int32_max = 2; 19 required uint32 uint32_min = 3; 20 required uint32 uint32_max = 4; 21 required int64 int64_min = 5; 22 required int64 int64_max = 6; 23 required uint64 uint64_min = 7; 24 required uint64 uint64_max = 8; 25 required HugeEnum enum_min = 9; 26 required HugeEnum enum_max = 10; 27 } 28 29 enum MyEnum { 30 Zero = 0; 31 First = 1; 32 Second = 2; 33 Truth = 42; 34 } 35 36 message AllTypes { 37 required int32 req_int32 = 1; 38 required int64 req_int64 = 2; 39 required uint32 req_uint32 = 3; 40 required uint64 req_uint64 = 4; 41 required sint32 req_sint32 = 5; 42 required sint64 req_sint64 = 6; 43 required bool req_bool = 7; 44 45 required fixed32 req_fixed32 = 8; 46 required sfixed32 req_sfixed32= 9; 47 required float req_float = 10; 48 49 required fixed64 req_fixed64 = 11; 50 required sfixed64 req_sfixed64= 12; 51 required double req_double = 13; 52 53 required string req_string = 14; 54 required bytes req_bytes = 15; 55 required SubMessage req_submsg = 16; 56 required MyEnum req_enum = 17; 57 required EmptyMessage req_emptymsg = 18; 58 59 60 repeated int32 rep_int32 = 21; 61 repeated int64 rep_int64 = 22; 62 repeated uint32 rep_uint32 = 23; 63 repeated uint64 rep_uint64 = 24; 64 repeated sint32 rep_sint32 = 25; 65 repeated sint64 rep_sint64 = 26; 66 repeated bool rep_bool = 27; 67 68 repeated fixed32 rep_fixed32 = 28; 69 repeated sfixed32 rep_sfixed32= 29; 70 repeated float rep_float = 30; 71 72 repeated fixed64 rep_fixed64 = 10031; 73 repeated sfixed64 rep_sfixed64= 10032; 74 repeated double rep_double = 10033; 75 76 repeated string rep_string = 10034; 77 repeated bytes rep_bytes = 10035; 78 repeated SubMessage rep_submsg = 10036; 79 repeated MyEnum rep_enum = 10037; 80 repeated EmptyMessage rep_emptymsg = 10038; 81 82 optional int32 opt_int32 = 10041 [default = 4041]; 83 optional int64 opt_int64 = 10042 [default = 4042]; 84 optional uint32 opt_uint32 = 10043 [default = 4043]; 85 optional uint64 opt_uint64 = 10044 [default = 4044]; 86 optional sint32 opt_sint32 = 10045 [default = 4045]; 87 optional sint64 opt_sint64 = 10046 [default = 4046]; 88 optional bool opt_bool = 10047 [default = false]; 89 90 optional fixed32 opt_fixed32 = 10048 [default = 4048]; 91 optional sfixed32 opt_sfixed32= 10049 [default = 4049]; 92 optional float opt_float = 10050 [default = 4050]; 93 94 optional fixed64 opt_fixed64 = 10051 [default = 4051]; 95 optional sfixed64 opt_sfixed64= 10052 [default = 4052]; 96 optional double opt_double = 10053 [default = 4053]; 97 98 optional string opt_string = 10054 [default = "4054"]; 99 optional bytes opt_bytes = 10055 [default = "4055"]; 100 optional SubMessage opt_submsg = 10056; 101 optional MyEnum opt_enum = 10057 [default = Second]; 102 optional EmptyMessage opt_emptymsg = 10058; 103 104 // Check that extreme integer values are handled correctly 105 required Limits req_limits = 98; 106 107 // Just to make sure that the size of the fields has been calculated 108 // properly, i.e. otherwise a bug in last field might not be detected. 109 required int32 end = 13432099; 110 } 111 112