]> asedeno.scripts.mit.edu Git - cl-protobufs.git/blob - tests/testproto1.proto
asdf-support: simplify do-process-import calling
[cl-protobufs.git] / tests / testproto1.proto
1 // Copyright 2010, Google Inc.
2 // All rights reserved.
3
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7
8 //     * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 //     * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
13 // distribution.
14 //     * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
17
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30 syntax = "proto2";      // for compatibility with internal Google compiler
31
32 package protobuf_unittest;
33
34 // dummy message to include in other messages.
35 message Test1Msg {
36   optional int32 foo = 1;
37 }
38
39 message Test1Proto {
40
41   // test enums
42   enum EnumCode {
43     FOO = 0;
44     BAR = 1;
45     BAZ = 2;
46   }
47
48   // required vs. optional
49   required int64 o_a = 1;
50   optional int64 o_b = 2;
51
52   // all the types (non-repeated)
53   optional int32 u_int32 = 3;
54   optional int64 u_int64 = 4;
55   optional uint64 u_uint64 = 5;
56   optional fixed32 u_fixed32 = 6;
57   optional fixed64 u_fixed64 = 7;
58   optional bool u_bool = 8;
59   optional float u_float = 27;
60   optional double u_double = 28;
61   optional string u_string = 9;
62   optional string u_vardata = 10;
63   optional Test1Msg u_msg = 11;
64
65   // all the types (repeated)
66   repeated int32 r_int32 = 12;
67   repeated int64 r_int64 = 13;
68   repeated uint64 r_uint64 = 14;
69   repeated fixed32 r_fixed32 = 15;
70   repeated fixed64 r_fixed64 = 16;
71   repeated bool r_bool = 17;
72   repeated float r_float = 29;
73   repeated double r_double = 30;
74   repeated string r_string = 18;
75   repeated string r_vardata = 19;
76   repeated Test1Msg r_msg = 20;
77
78   // non-repeated group
79   repeated group TestGroup1 = 21 {
80     optional int32 a = 22;
81   };
82
83   // repeated group
84   repeated group TestGroup2 = 23 {
85     optional int32 b = 24;
86   };
87
88   // default settings
89   optional int32 d_int32 = 25 [default=12];
90   optional string d_string = 26 [default="foo"];
91   optional bool d_bool = 31 [default=true];
92   optional int32 dd_int32 = 32 [ default =  12 ];
93   optional string dd_string = 33 [ default =  " f oo " ];
94   optional bool dd_bool = 34 [ default = true ];
95 }