blob: c69e8d94563548a34f44ea8655912263589a75bd [file] [log] [blame]
Feng Xiaof157a562014-11-14 11:50:31 -08001// Protocol Buffers - Google's data interchange format
2// Copyright 2008 Google Inc. All rights reserved.
3// https://developers.google.com/protocol-buffers/
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// * Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11// * Redistributions in binary form must reproduce the above
12// copyright notice, this list of conditions and the following disclaimer
13// in the documentation and/or other materials provided with the
14// distribution.
15// * Neither the name of Google Inc. nor the names of its
16// contributors may be used to endorse or promote products derived from
17// this software without specific prior written permission.
18//
19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31syntax = "proto2";
32
Jisi Liu885b6122015-02-28 14:51:22 -080033option cc_enable_arenas = true;
Feng Xiaof157a562014-11-14 11:50:31 -080034option optimize_for = LITE_RUNTIME;
35
Jisi Liu885b6122015-02-28 14:51:22 -080036import "google/protobuf/unittest_lite.proto";
37
Feng Xiaof157a562014-11-14 11:50:31 -080038package protobuf_unittest;
39
Jisi Liu885b6122015-02-28 14:51:22 -080040message TestMapLite {
41 map<int32 , int32 > map_int32_int32 = 1;
42 map<int64 , int64 > map_int64_int64 = 2;
43 map<uint32 , uint32 > map_uint32_uint32 = 3;
44 map<uint64 , uint64 > map_uint64_uint64 = 4;
45 map<sint32 , sint32 > map_sint32_sint32 = 5;
46 map<sint64 , sint64 > map_sint64_sint64 = 6;
47 map<fixed32 , fixed32 > map_fixed32_fixed32 = 7;
48 map<fixed64 , fixed64 > map_fixed64_fixed64 = 8;
49 map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 9;
50 map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 10;
51 map<int32 , float > map_int32_float = 11;
52 map<int32 , double > map_int32_double = 12;
53 map<bool , bool > map_bool_bool = 13;
54 map<string , string > map_string_string = 14;
55 map<int32 , bytes > map_int32_bytes = 15;
56 map<int32 , MapEnumLite> map_int32_enum = 16;
57 map<int32 , ForeignMessageLite> map_int32_foreign_message = 17;
58 map<int32, int32> teboring = 18;
59}
60
61message TestArenaMapLite {
62 map<int32 , int32 > map_int32_int32 = 1;
63 map<int64 , int64 > map_int64_int64 = 2;
64 map<uint32 , uint32 > map_uint32_uint32 = 3;
65 map<uint64 , uint64 > map_uint64_uint64 = 4;
66 map<sint32 , sint32 > map_sint32_sint32 = 5;
67 map<sint64 , sint64 > map_sint64_sint64 = 6;
68 map<fixed32 , fixed32 > map_fixed32_fixed32 = 7;
69 map<fixed64 , fixed64 > map_fixed64_fixed64 = 8;
70 map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 9;
71 map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 10;
72 map<int32 , float > map_int32_float = 11;
73 map<int32 , double > map_int32_double = 12;
74 map<bool , bool > map_bool_bool = 13;
75 map<int32 , MapEnumLite> map_int32_enum = 14;
76 map<int32 , ForeignMessageArenaLite> map_int32_foreign_message = 15;
77}
78
79// Test embeded message with required fields
80message TestRequiredMessageMapLite {
81 map<int32, TestRequiredLite> map_field = 1;
82}
83
84message TestEnumStartWithNonZeroMapLite {
85 map<int32, Proto2MapEnumStartWithNonZeroLite> map_field = 101;
86}
87
88message TestEnumMapLite {
89 map<int32, Proto2MapEnumLite> known_map_field = 101;
90 map<int32, Proto2MapEnumLite> unknown_map_field = 102;
91}
92
93message TestEnumMapPlusExtraLite {
94 map<int32, Proto2MapEnumPlusExtraLite> known_map_field = 101;
95 map<int32, Proto2MapEnumPlusExtraLite> unknown_map_field = 102;
96}
97
98message TestMessageMapLite {
99 map<int32, TestAllTypesLite> map_int32_message = 1;
100}
101
102enum Proto2MapEnumLite {
103 PROTO2_MAP_ENUM_FOO_LITE = 0;
104 PROTO2_MAP_ENUM_BAR_LITE = 1;
105 PROTO2_MAP_ENUM_BAZ_LITE = 2;
106}
107
108enum Proto2MapEnumPlusExtraLite {
109 E_PROTO2_MAP_ENUM_FOO_LITE = 0;
110 E_PROTO2_MAP_ENUM_BAR_LITE = 1;
111 E_PROTO2_MAP_ENUM_BAZ_LITE = 2;
112 E_PROTO2_MAP_ENUM_EXTRA_LITE = 3;
113}
114
115enum Proto2MapEnumStartWithNonZeroLite {
116 PROTO2_NON_ZERO_MAP_ENUM_FOO_LITE = 1;
117}
118
119enum MapEnumLite {
120 MAP_ENUM_FOO_LITE = 0;
121 MAP_ENUM_BAR_LITE = 1;
122 MAP_ENUM_BAZ_LITE = 2;
123}
124
125message TestRequiredLite {
126 required int32 a = 1;
127 required int32 b = 2;
128 required int32 c = 3;
129}
130
131message ForeignMessageArenaLite {
132 optional int32 c = 1;
Feng Xiaof157a562014-11-14 11:50:31 -0800133}