• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Protocol Buffers - Google's data interchange format
2// Copyright 2015 Google Inc.  All rights reserved.
3//
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file or at
6// https://developers.google.com/open-source/licenses/bsd
7
8syntax = "proto2";
9
10// Explicit empty prefix, tests some validations code paths also.
11package objc.protobuf.tests;
12
13option objc_class_prefix = "";
14
15message Message2 {
16  enum Enum {
17    FOO = 0;
18    BAR = 1;
19    BAZ = 2;
20    EXTRA_2 = 20;
21  }
22
23  optional    int32 optional_int32    =  1;
24  optional    int64 optional_int64    =  2;
25  optional   uint32 optional_uint32   =  3;
26  optional   uint64 optional_uint64   =  4;
27  optional   sint32 optional_sint32   =  5;
28  optional   sint64 optional_sint64   =  6;
29  optional  fixed32 optional_fixed32  =  7;
30  optional  fixed64 optional_fixed64  =  8;
31  optional sfixed32 optional_sfixed32 =  9;
32  optional sfixed64 optional_sfixed64 = 10;
33  optional    float optional_float    = 11;
34  optional   double optional_double   = 12;
35  optional     bool optional_bool     = 13;
36  optional   string optional_string   = 14;
37  optional    bytes optional_bytes    = 15;
38  optional group OptionalGroup = 16 {
39    optional int32 a = 17;
40  }
41  optional Message2  optional_message = 18;
42  optional Enum         optional_enum = 19;
43
44  repeated    int32 repeated_int32    = 31;
45  repeated    int64 repeated_int64    = 32;
46  repeated   uint32 repeated_uint32   = 33;
47  repeated   uint64 repeated_uint64   = 34;
48  repeated   sint32 repeated_sint32   = 35;
49  repeated   sint64 repeated_sint64   = 36;
50  repeated  fixed32 repeated_fixed32  = 37;
51  repeated  fixed64 repeated_fixed64  = 38;
52  repeated sfixed32 repeated_sfixed32 = 39;
53  repeated sfixed64 repeated_sfixed64 = 40;
54  repeated    float repeated_float    = 41;
55  repeated   double repeated_double   = 42;
56  repeated     bool repeated_bool     = 43;
57  repeated   string repeated_string   = 44;
58  repeated    bytes repeated_bytes    = 45;
59  repeated group RepeatedGroup = 46 {
60    optional int32 a = 47;
61  }
62  repeated Message2 repeated_message  = 48;
63  repeated Enum     repeated_enum     = 49;
64
65  oneof o {
66       int32 oneof_int32    = 51 [default = 100];
67       int64 oneof_int64    = 52 [default = 101];
68      uint32 oneof_uint32   = 53 [default = 102];
69      uint64 oneof_uint64   = 54 [default = 103];
70      sint32 oneof_sint32   = 55 [default = 104];
71      sint64 oneof_sint64   = 56 [default = 105];
72     fixed32 oneof_fixed32  = 57 [default = 106];
73     fixed64 oneof_fixed64  = 58 [default = 107];
74    sfixed32 oneof_sfixed32 = 59 [default = 108];
75    sfixed64 oneof_sfixed64 = 60 [default = 109];
76       float oneof_float    = 61 [default = 110];
77      double oneof_double   = 62 [default = 111];
78        bool oneof_bool     = 63 [default = true];
79      string oneof_string   = 64 [default = "string"];
80       bytes oneof_bytes    = 65 [default = "data"];
81       group OneofGroup     = 66 {
82         optional int32 a = 67;
83         optional int32 b = 167;
84       }
85     Message2 oneof_message = 68;
86     Enum        oneof_enum = 69 [default = BAZ];
87  }
88
89  // Some token map cases, too many combinations to list them all.
90  map<int32   , int32   > map_int32_int32       = 70;
91  map<int64   , int64   > map_int64_int64       = 71;
92  map<uint32  , uint32  > map_uint32_uint32     = 72;
93  map<uint64  , uint64  > map_uint64_uint64     = 73;
94  map<sint32  , sint32  > map_sint32_sint32     = 74;
95  map<sint64  , sint64  > map_sint64_sint64     = 75;
96  map<fixed32 , fixed32 > map_fixed32_fixed32   = 76;
97  map<fixed64 , fixed64 > map_fixed64_fixed64   = 77;
98  map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 78;
99  map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 79;
100  map<int32   , float   > map_int32_float       = 80;
101  map<int32   , double  > map_int32_double      = 81;
102  map<bool    , bool    > map_bool_bool         = 82;
103  map<string  , string  > map_string_string     = 83;
104  map<string  , bytes   > map_string_bytes      = 84;
105  map<string  , Message2> map_string_message    = 85;
106  map<int32   , bytes   > map_int32_bytes       = 86;
107  map<int32   , Enum    > map_int32_enum        = 87;
108  map<int32   , Message2> map_int32_message     = 88;
109}
110