1 // Copyright 2010, Google Inc.
2 // All rights reserved.
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
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
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.
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.
30 syntax = "proto2"; // for compatibility with internal Google compiler
32 package protobuf_unittest;
34 message TimeProtocol {
35 repeated group G = 1 {
36 required int32 V1 = 2;
37 required int32 V2 = 3;
39 repeated string DebugString = 4;
43 optional int32 foo = 1;
44 optional int32 bar = 2;
47 message TestProtocol {
48 required string Zero = 63;
49 required string One = 1;
50 optional int64 Two = 2 [default=19];
51 repeated group Four = 4 {
52 required int64 Five = 5;
53 required uint64 Six = 64;
54 optional TimeProtocol TP = 112;
55 repeated group SevenG = 65 {
56 optional bool Four = 66 [default=false];
57 optional group Twelve = 67 {
58 optional bool Thirteen = 68;
61 enum NestedEnum {DELETE_ME_TO_CRASH_SWIG = 0;};
63 optional group Seven = 7 {
64 required int64 Eight = 8;
65 required bool Nine = 9;
66 optional bool Ten = 10 [default=true];
68 repeated TimeProtocol TP2 = 113;
69 repeated int64 Test1 = 301;
70 repeated int32 Test2 = 302;
71 repeated float Test3 = 303;
72 repeated double Test4 = 304;
73 repeated string Test5 = 305;
75 required fixed64 FixedValue = 310;
76 required fixed32 FixedValue2 = 311;
77 optional string OptString = 299 [default="opt"];
82 ENUM_TWO_REALLY_LONG_NAME = 2;
85 optional TestMessage Eleven = 312;
90 optional AnotherEnum Twelve = 313;
91 optional group Thirteen = 314 {
92 required AnotherEnum Fourteen = 315;
95 // Please keep this empty group at the end. I've caught quite a few
96 // bugs this way: empty group is a degenerate case, but empty group
97 // not followed by anything is even more so!
98 repeated group Test6 = 306 {