xref: /aosp_15_r20/external/protobuf/objectivec/Tests/unittest_runtime_proto2.proto (revision 1b3f573f81763fcece89efc2b6a5209149e44ab8)
1*1b3f573fSAndroid Build Coastguard Worker// Protocol Buffers - Google's data interchange format
2*1b3f573fSAndroid Build Coastguard Worker// Copyright 2015 Google Inc.  All rights reserved.
3*1b3f573fSAndroid Build Coastguard Worker//
4*1b3f573fSAndroid Build Coastguard Worker// Redistribution and use in source and binary forms, with or without
5*1b3f573fSAndroid Build Coastguard Worker// modification, are permitted provided that the following conditions are
6*1b3f573fSAndroid Build Coastguard Worker// met:
7*1b3f573fSAndroid Build Coastguard Worker//
8*1b3f573fSAndroid Build Coastguard Worker//     * Redistributions of source code must retain the above copyright
9*1b3f573fSAndroid Build Coastguard Worker// notice, this list of conditions and the following disclaimer.
10*1b3f573fSAndroid Build Coastguard Worker//     * Redistributions in binary form must reproduce the above
11*1b3f573fSAndroid Build Coastguard Worker// copyright notice, this list of conditions and the following disclaimer
12*1b3f573fSAndroid Build Coastguard Worker// in the documentation and/or other materials provided with the
13*1b3f573fSAndroid Build Coastguard Worker// distribution.
14*1b3f573fSAndroid Build Coastguard Worker//     * Neither the name of Google Inc. nor the names of its
15*1b3f573fSAndroid Build Coastguard Worker// contributors may be used to endorse or promote products derived from
16*1b3f573fSAndroid Build Coastguard Worker// this software without specific prior written permission.
17*1b3f573fSAndroid Build Coastguard Worker//
18*1b3f573fSAndroid Build Coastguard Worker// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19*1b3f573fSAndroid Build Coastguard Worker// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20*1b3f573fSAndroid Build Coastguard Worker// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21*1b3f573fSAndroid Build Coastguard Worker// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22*1b3f573fSAndroid Build Coastguard Worker// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23*1b3f573fSAndroid Build Coastguard Worker// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24*1b3f573fSAndroid Build Coastguard Worker// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25*1b3f573fSAndroid Build Coastguard Worker// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26*1b3f573fSAndroid Build Coastguard Worker// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27*1b3f573fSAndroid Build Coastguard Worker// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28*1b3f573fSAndroid Build Coastguard Worker// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29*1b3f573fSAndroid Build Coastguard Worker
30*1b3f573fSAndroid Build Coastguard Workersyntax = "proto2";
31*1b3f573fSAndroid Build Coastguard Worker
32*1b3f573fSAndroid Build Coastguard Workerpackage protobuf_unittest;
33*1b3f573fSAndroid Build Coastguard Worker
34*1b3f573fSAndroid Build Coastguard Workermessage Message2 {
35*1b3f573fSAndroid Build Coastguard Worker  enum Enum {
36*1b3f573fSAndroid Build Coastguard Worker    FOO = 0;
37*1b3f573fSAndroid Build Coastguard Worker    BAR = 1;
38*1b3f573fSAndroid Build Coastguard Worker    BAZ = 2;
39*1b3f573fSAndroid Build Coastguard Worker    EXTRA_2 = 20;
40*1b3f573fSAndroid Build Coastguard Worker  }
41*1b3f573fSAndroid Build Coastguard Worker
42*1b3f573fSAndroid Build Coastguard Worker  optional    int32 optional_int32    =  1;
43*1b3f573fSAndroid Build Coastguard Worker  optional    int64 optional_int64    =  2;
44*1b3f573fSAndroid Build Coastguard Worker  optional   uint32 optional_uint32   =  3;
45*1b3f573fSAndroid Build Coastguard Worker  optional   uint64 optional_uint64   =  4;
46*1b3f573fSAndroid Build Coastguard Worker  optional   sint32 optional_sint32   =  5;
47*1b3f573fSAndroid Build Coastguard Worker  optional   sint64 optional_sint64   =  6;
48*1b3f573fSAndroid Build Coastguard Worker  optional  fixed32 optional_fixed32  =  7;
49*1b3f573fSAndroid Build Coastguard Worker  optional  fixed64 optional_fixed64  =  8;
50*1b3f573fSAndroid Build Coastguard Worker  optional sfixed32 optional_sfixed32 =  9;
51*1b3f573fSAndroid Build Coastguard Worker  optional sfixed64 optional_sfixed64 = 10;
52*1b3f573fSAndroid Build Coastguard Worker  optional    float optional_float    = 11;
53*1b3f573fSAndroid Build Coastguard Worker  optional   double optional_double   = 12;
54*1b3f573fSAndroid Build Coastguard Worker  optional     bool optional_bool     = 13;
55*1b3f573fSAndroid Build Coastguard Worker  optional   string optional_string   = 14;
56*1b3f573fSAndroid Build Coastguard Worker  optional    bytes optional_bytes    = 15;
57*1b3f573fSAndroid Build Coastguard Worker  optional group OptionalGroup = 16 {
58*1b3f573fSAndroid Build Coastguard Worker    optional int32 a = 17;
59*1b3f573fSAndroid Build Coastguard Worker  }
60*1b3f573fSAndroid Build Coastguard Worker  optional Message2  optional_message = 18;
61*1b3f573fSAndroid Build Coastguard Worker  optional Enum         optional_enum = 19;
62*1b3f573fSAndroid Build Coastguard Worker
63*1b3f573fSAndroid Build Coastguard Worker  repeated    int32 repeated_int32    = 31;
64*1b3f573fSAndroid Build Coastguard Worker  repeated    int64 repeated_int64    = 32;
65*1b3f573fSAndroid Build Coastguard Worker  repeated   uint32 repeated_uint32   = 33;
66*1b3f573fSAndroid Build Coastguard Worker  repeated   uint64 repeated_uint64   = 34;
67*1b3f573fSAndroid Build Coastguard Worker  repeated   sint32 repeated_sint32   = 35;
68*1b3f573fSAndroid Build Coastguard Worker  repeated   sint64 repeated_sint64   = 36;
69*1b3f573fSAndroid Build Coastguard Worker  repeated  fixed32 repeated_fixed32  = 37;
70*1b3f573fSAndroid Build Coastguard Worker  repeated  fixed64 repeated_fixed64  = 38;
71*1b3f573fSAndroid Build Coastguard Worker  repeated sfixed32 repeated_sfixed32 = 39;
72*1b3f573fSAndroid Build Coastguard Worker  repeated sfixed64 repeated_sfixed64 = 40;
73*1b3f573fSAndroid Build Coastguard Worker  repeated    float repeated_float    = 41;
74*1b3f573fSAndroid Build Coastguard Worker  repeated   double repeated_double   = 42;
75*1b3f573fSAndroid Build Coastguard Worker  repeated     bool repeated_bool     = 43;
76*1b3f573fSAndroid Build Coastguard Worker  repeated   string repeated_string   = 44;
77*1b3f573fSAndroid Build Coastguard Worker  repeated    bytes repeated_bytes    = 45;
78*1b3f573fSAndroid Build Coastguard Worker  repeated group RepeatedGroup = 46 {
79*1b3f573fSAndroid Build Coastguard Worker    optional int32 a = 47;
80*1b3f573fSAndroid Build Coastguard Worker  }
81*1b3f573fSAndroid Build Coastguard Worker  repeated Message2 repeated_message  = 48;
82*1b3f573fSAndroid Build Coastguard Worker  repeated Enum     repeated_enum     = 49;
83*1b3f573fSAndroid Build Coastguard Worker
84*1b3f573fSAndroid Build Coastguard Worker  oneof o {
85*1b3f573fSAndroid Build Coastguard Worker       int32 oneof_int32    = 51 [default = 100];
86*1b3f573fSAndroid Build Coastguard Worker       int64 oneof_int64    = 52 [default = 101];
87*1b3f573fSAndroid Build Coastguard Worker      uint32 oneof_uint32   = 53 [default = 102];
88*1b3f573fSAndroid Build Coastguard Worker      uint64 oneof_uint64   = 54 [default = 103];
89*1b3f573fSAndroid Build Coastguard Worker      sint32 oneof_sint32   = 55 [default = 104];
90*1b3f573fSAndroid Build Coastguard Worker      sint64 oneof_sint64   = 56 [default = 105];
91*1b3f573fSAndroid Build Coastguard Worker     fixed32 oneof_fixed32  = 57 [default = 106];
92*1b3f573fSAndroid Build Coastguard Worker     fixed64 oneof_fixed64  = 58 [default = 107];
93*1b3f573fSAndroid Build Coastguard Worker    sfixed32 oneof_sfixed32 = 59 [default = 108];
94*1b3f573fSAndroid Build Coastguard Worker    sfixed64 oneof_sfixed64 = 60 [default = 109];
95*1b3f573fSAndroid Build Coastguard Worker       float oneof_float    = 61 [default = 110];
96*1b3f573fSAndroid Build Coastguard Worker      double oneof_double   = 62 [default = 111];
97*1b3f573fSAndroid Build Coastguard Worker        bool oneof_bool     = 63 [default = true];
98*1b3f573fSAndroid Build Coastguard Worker      string oneof_string   = 64 [default = "string"];
99*1b3f573fSAndroid Build Coastguard Worker       bytes oneof_bytes    = 65 [default = "data"];
100*1b3f573fSAndroid Build Coastguard Worker       group OneofGroup     = 66 {
101*1b3f573fSAndroid Build Coastguard Worker         optional int32 a = 67;
102*1b3f573fSAndroid Build Coastguard Worker         optional int32 b = 167;
103*1b3f573fSAndroid Build Coastguard Worker       }
104*1b3f573fSAndroid Build Coastguard Worker     Message2 oneof_message = 68;
105*1b3f573fSAndroid Build Coastguard Worker     Enum        oneof_enum = 69 [default = BAZ];
106*1b3f573fSAndroid Build Coastguard Worker  }
107*1b3f573fSAndroid Build Coastguard Worker
108*1b3f573fSAndroid Build Coastguard Worker  // Some token map cases, too many combinations to list them all.
109*1b3f573fSAndroid Build Coastguard Worker  map<int32   , int32   > map_int32_int32       = 70;
110*1b3f573fSAndroid Build Coastguard Worker  map<int64   , int64   > map_int64_int64       = 71;
111*1b3f573fSAndroid Build Coastguard Worker  map<uint32  , uint32  > map_uint32_uint32     = 72;
112*1b3f573fSAndroid Build Coastguard Worker  map<uint64  , uint64  > map_uint64_uint64     = 73;
113*1b3f573fSAndroid Build Coastguard Worker  map<sint32  , sint32  > map_sint32_sint32     = 74;
114*1b3f573fSAndroid Build Coastguard Worker  map<sint64  , sint64  > map_sint64_sint64     = 75;
115*1b3f573fSAndroid Build Coastguard Worker  map<fixed32 , fixed32 > map_fixed32_fixed32   = 76;
116*1b3f573fSAndroid Build Coastguard Worker  map<fixed64 , fixed64 > map_fixed64_fixed64   = 77;
117*1b3f573fSAndroid Build Coastguard Worker  map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 78;
118*1b3f573fSAndroid Build Coastguard Worker  map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 79;
119*1b3f573fSAndroid Build Coastguard Worker  map<int32   , float   > map_int32_float       = 80;
120*1b3f573fSAndroid Build Coastguard Worker  map<int32   , double  > map_int32_double      = 81;
121*1b3f573fSAndroid Build Coastguard Worker  map<bool    , bool    > map_bool_bool         = 82;
122*1b3f573fSAndroid Build Coastguard Worker  map<string  , string  > map_string_string     = 83;
123*1b3f573fSAndroid Build Coastguard Worker  map<string  , bytes   > map_string_bytes      = 84;
124*1b3f573fSAndroid Build Coastguard Worker  map<string  , Message2> map_string_message    = 85;
125*1b3f573fSAndroid Build Coastguard Worker  map<int32   , bytes   > map_int32_bytes       = 86;
126*1b3f573fSAndroid Build Coastguard Worker  map<int32   , Enum    > map_int32_enum        = 87;
127*1b3f573fSAndroid Build Coastguard Worker  map<int32   , Message2> map_int32_message     = 88;
128*1b3f573fSAndroid Build Coastguard Worker}
129