| David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 1 | /* | 
|  | 2 | * Licensed to the Apache Software Foundation (ASF) under one | 
|  | 3 | * or more contributor license agreements. See the NOTICE file | 
|  | 4 | * distributed with this work for additional information | 
|  | 5 | * regarding copyright ownership. The ASF licenses this file | 
|  | 6 | * to you under the Apache License, Version 2.0 (the | 
|  | 7 | * "License"); you may not use this file except in compliance | 
|  | 8 | * with the License. You may obtain a copy of the License at | 
|  | 9 | * | 
|  | 10 | *   http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 11 | * | 
|  | 12 | * Unless required by applicable law or agreed to in writing, | 
|  | 13 | * software distributed under the License is distributed on an | 
|  | 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 
|  | 15 | * KIND, either express or implied. See the License for the | 
|  | 16 | * specific language governing permissions and limitations | 
|  | 17 | * under the License. | 
|  | 18 | */ | 
|  | 19 |  | 
| Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 20 | namespace c_glib TTest | 
| David Reiss | 2a4bfd6 | 2008-04-07 23:45:00 +0000 | [diff] [blame] | 21 | namespace cpp thrift.test.debug | 
| David Reiss | 3b15ebc | 2008-03-02 06:29:19 +0000 | [diff] [blame] | 22 | namespace java thrift.test | 
| David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 23 |  | 
| David Reiss | db0ea15 | 2008-02-18 01:49:37 +0000 | [diff] [blame] | 24 | struct Doubles { | 
|  | 25 | 1: double nan, | 
|  | 26 | 2: double inf, | 
|  | 27 | 3: double neginf, | 
|  | 28 | 4: double repeating, | 
|  | 29 | 5: double big, | 
| Roger Meier | 22888ce | 2014-02-09 11:31:02 +0100 | [diff] [blame] | 30 | 6: double tiny, | 
| David Reiss | db0ea15 | 2008-02-18 01:49:37 +0000 | [diff] [blame] | 31 | 7: double zero, | 
|  | 32 | 8: double negzero, | 
|  | 33 | } | 
|  | 34 |  | 
| David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 35 | struct OneOfEach { | 
|  | 36 | 1: bool im_true, | 
|  | 37 | 2: bool im_false, | 
| Christian Lavoie | cbf87cb | 2010-11-28 14:34:26 +0000 | [diff] [blame] | 38 | 3: byte a_bite = 0x7f, | 
|  | 39 | 4: i16 integer16 = 0x7fff, | 
| David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 40 | 5: i32 integer32, | 
| David Reiss | a8efac8 | 2008-12-16 20:28:13 +0000 | [diff] [blame] | 41 | 6: i64 integer64 = 10000000000, | 
| David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 42 | 7: double double_precision, | 
|  | 43 | 8: string some_characters, | 
|  | 44 | 9: string zomg_unicode, | 
|  | 45 | 10: bool what_who, | 
| David Reiss | db0ea15 | 2008-02-18 01:49:37 +0000 | [diff] [blame] | 46 | 11: binary base64, | 
| David Reiss | a8efac8 | 2008-12-16 20:28:13 +0000 | [diff] [blame] | 47 | 12: list<byte> byte_list = [1, 2, 3], | 
|  | 48 | 13: list<i16> i16_list = [1,2,3], | 
|  | 49 | 14: list<i64> i64_list = [1,2,3] | 
| David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 50 | } | 
|  | 51 |  | 
|  | 52 | struct Bonk { | 
|  | 53 | 1: i32 type, | 
|  | 54 | 2: string message, | 
|  | 55 | } | 
|  | 56 |  | 
|  | 57 | struct Nesting { | 
|  | 58 | 1: Bonk my_bonk, | 
|  | 59 | 2: OneOfEach my_ooe, | 
|  | 60 | } | 
|  | 61 |  | 
|  | 62 | struct HolyMoley { | 
|  | 63 | 1: list<OneOfEach> big, | 
|  | 64 | 2: set<list<string>> contain, | 
|  | 65 | 3: map<string,list<Bonk>> bonks, | 
|  | 66 | } | 
| David Reiss | 382fc30 | 2007-08-25 18:01:30 +0000 | [diff] [blame] | 67 |  | 
|  | 68 | struct Backwards { | 
|  | 69 | 2: i32 first_tag2, | 
|  | 70 | 1: i32 second_tag1, | 
|  | 71 | } | 
|  | 72 |  | 
|  | 73 | struct Empty { | 
|  | 74 | } | 
|  | 75 |  | 
|  | 76 | struct Wrapper { | 
|  | 77 | 1: Empty foo | 
|  | 78 | } | 
|  | 79 |  | 
|  | 80 | struct RandomStuff { | 
|  | 81 | 1: i32 a, | 
|  | 82 | 2: i32 b, | 
|  | 83 | 3: i32 c, | 
|  | 84 | 4: i32 d, | 
|  | 85 | 5: list<i32> myintlist, | 
|  | 86 | 6: map<i32,Wrapper> maps, | 
|  | 87 | 7: i64 bigint, | 
|  | 88 | 8: double triple, | 
|  | 89 | } | 
|  | 90 |  | 
| David Reiss | 4a8f46c | 2008-03-07 20:12:07 +0000 | [diff] [blame] | 91 | struct Base64 { | 
|  | 92 | 1: i32 a, | 
|  | 93 | 2: binary b1, | 
|  | 94 | 3: binary b2, | 
|  | 95 | 4: binary b3, | 
|  | 96 | 5: binary b4, | 
|  | 97 | 6: binary b5, | 
|  | 98 | 7: binary b6, | 
|  | 99 | } | 
|  | 100 |  | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 101 | struct CompactProtoTestStruct { | 
|  | 102 | // primitive fields | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 103 | 1: byte   a_byte; | 
|  | 104 | 2: i16    a_i16; | 
|  | 105 | 3: i32    a_i32; | 
|  | 106 | 4: i64    a_i64; | 
|  | 107 | 5: double a_double; | 
|  | 108 | 6: string a_string; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 109 | 7: binary a_binary; | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 110 | 8: bool   true_field; | 
|  | 111 | 9: bool   false_field; | 
|  | 112 | 10: Empty empty_struct_field; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 113 |  | 
|  | 114 | // primitives in lists | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 115 | 11: list<byte>    byte_list; | 
|  | 116 | 12: list<i16>     i16_list; | 
|  | 117 | 13: list<i32>     i32_list; | 
|  | 118 | 14: list<i64>     i64_list; | 
|  | 119 | 15: list<double>  double_list; | 
|  | 120 | 16: list<string>  string_list; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 121 | 17: list<binary>  binary_list; | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 122 | 18: list<bool>    boolean_list; | 
|  | 123 | 19: list<Empty>   struct_list; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 124 |  | 
|  | 125 | // primitives in sets | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 126 | 20: set<byte>     byte_set; | 
|  | 127 | 21: set<i16>      i16_set; | 
|  | 128 | 22: set<i32>      i32_set; | 
|  | 129 | 23: set<i64>      i64_set; | 
|  | 130 | 24: set<double>   double_set; | 
|  | 131 | 25: set<string>   string_set; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 132 | 26: set<binary>   binary_set; | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 133 | 27: set<bool>     boolean_set; | 
|  | 134 | 28: set<Empty>    struct_set; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 135 |  | 
|  | 136 | // maps | 
|  | 137 | // primitives as keys | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 138 | 29: map<byte, byte>             byte_byte_map; | 
|  | 139 | 30: map<i16, byte>              i16_byte_map; | 
|  | 140 | 31: map<i32, byte>              i32_byte_map; | 
|  | 141 | 32: map<i64, byte>              i64_byte_map; | 
|  | 142 | 33: map<double, byte>           double_byte_map; | 
|  | 143 | 34: map<string, byte>           string_byte_map; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 144 | 35: map<binary, byte>           binary_byte_map; | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 145 | 36: map<bool, byte>             boolean_byte_map; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 146 | // primitives as values | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 147 | 37: map<byte, i16>              byte_i16_map; | 
|  | 148 | 38: map<byte, i32>              byte_i32_map; | 
|  | 149 | 39: map<byte, i64>              byte_i64_map; | 
|  | 150 | 40: map<byte, double>           byte_double_map; | 
|  | 151 | 41: map<byte, string>           byte_string_map; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 152 | 42: map<byte, binary>           byte_binary_map; | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 153 | 43: map<byte, bool>             byte_boolean_map; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 154 | // collections as keys | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 155 | 44: map<list<byte>, byte>       list_byte_map; | 
|  | 156 | 45: map<set<byte>, byte>        set_byte_map; | 
|  | 157 | 46: map<map<byte,byte>, byte>   map_byte_map; | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 158 | // collections as values | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 159 | 47: map<byte, map<byte,byte>>   byte_map_map; | 
|  | 160 | 48: map<byte, set<byte>>        byte_set_map; | 
|  | 161 | 49: map<byte, list<byte>>       byte_list_map; | 
|  | 162 | } | 
|  | 163 |  | 
| Bryan Duxbury | e80a194 | 2011-09-20 18:45:56 +0000 | [diff] [blame] | 164 | // To be used to test the serialization of an empty map | 
|  | 165 | struct SingleMapTestStruct { | 
|  | 166 | 1: required map<i32, i32>       i32_map; | 
|  | 167 | } | 
| David Reiss | fe5b77d | 2009-04-07 20:51:48 +0000 | [diff] [blame] | 168 |  | 
|  | 169 | const CompactProtoTestStruct COMPACT_TEST = { | 
|  | 170 | 'a_byte'             : 127, | 
|  | 171 | 'a_i16'              : 32000, | 
|  | 172 | 'a_i32'              : 1000000000, | 
|  | 173 | 'a_i64'              : 0xffffffffff, | 
|  | 174 | 'a_double'           : 5.6789, | 
|  | 175 | 'a_string'           : "my string", | 
|  | 176 | //'a_binary,' | 
|  | 177 | 'true_field'         : 1, | 
|  | 178 | 'false_field'        : 0, | 
|  | 179 | 'empty_struct_field' : {}, | 
|  | 180 | 'byte_list'          : [-127, -1, 0, 1, 127], | 
|  | 181 | 'i16_list'           : [-1, 0, 1, 0x7fff], | 
|  | 182 | 'i32_list'           : [-1, 0, 0xff, 0xffff, 0xffffff, 0x7fffffff], | 
|  | 183 | 'i64_list'           : [-1, 0, 0xff, 0xffff, 0xffffff, 0xffffffff, 0xffffffffff, 0xffffffffffff, 0xffffffffffffff, 0x7fffffffffffffff], | 
|  | 184 | 'double_list'        : [0.1, 0.2, 0.3], | 
|  | 185 | 'string_list'        : ["first", "second", "third"], | 
|  | 186 | //'binary_list,' | 
|  | 187 | 'boolean_list'       : [1, 1, 1, 0, 0, 0], | 
|  | 188 | 'struct_list'        : [{}, {}], | 
|  | 189 | 'byte_set'           : [-127, -1, 0, 1, 127], | 
|  | 190 | 'i16_set'            : [-1, 0, 1, 0x7fff], | 
|  | 191 | 'i32_set'            : [1, 2, 3], | 
|  | 192 | 'i64_set'            : [-1, 0, 0xff, 0xffff, 0xffffff, 0xffffffff, 0xffffffffff, 0xffffffffffff, 0xffffffffffffff, 0x7fffffffffffffff], | 
|  | 193 | 'double_set'         : [0.1, 0.2, 0.3], | 
|  | 194 | 'string_set'         : ["first", "second", "third"], | 
|  | 195 | //'binary_set,' | 
|  | 196 | 'boolean_set'        : [1, 0], | 
|  | 197 | 'struct_set'         : [{}], | 
|  | 198 | 'byte_byte_map'      : {1 : 2}, | 
|  | 199 | 'i16_byte_map'       : {1 : 1, -1 : 1, 0x7fff : 1}, | 
|  | 200 | 'i32_byte_map'       : {1 : 1, -1 : 1, 0x7fffffff : 1}, | 
|  | 201 | 'i64_byte_map'       : {0 : 1,  1 : 1, -1 : 1, 0x7fffffffffffffff : 1}, | 
|  | 202 | 'double_byte_map'    : {-1.1 : 1, 1.1 : 1}, | 
|  | 203 | 'string_byte_map'    : {"first" : 1, "second" : 2, "third" : 3, "" : 0}, | 
|  | 204 | //'binary_byte_map,' | 
|  | 205 | 'boolean_byte_map'   : {1 : 1, 0 : 0}, | 
|  | 206 | 'byte_i16_map'       : {1 : 1, 2 : -1, 3 : 0x7fff}, | 
|  | 207 | 'byte_i32_map'       : {1 : 1, 2 : -1, 3 : 0x7fffffff}, | 
|  | 208 | 'byte_i64_map'       : {1 : 1, 2 : -1, 3 : 0x7fffffffffffffff}, | 
|  | 209 | 'byte_double_map'    : {1 : 0.1, 2 : -0.1, 3 : 1000000.1}, | 
|  | 210 | 'byte_string_map'    : {1 : "", 2 : "blah", 3 : "loooooooooooooong string"}, | 
|  | 211 | //'byte_binary_map,' | 
|  | 212 | 'byte_boolean_map'   : {1 : 1, 2 : 0}, | 
|  | 213 | 'list_byte_map'      : {[1, 2, 3] : 1, [0, 1] : 2, [] : 0}, | 
|  | 214 | 'set_byte_map'       : {[1, 2, 3] : 1, [0, 1] : 2, [] : 0}, | 
|  | 215 | 'map_byte_map'       : {{1 : 1} : 1, {2 : 2} : 2, {} : 0}, | 
|  | 216 | 'byte_map_map'       : {0 : {}, 1 : {1 : 1}, 2 : {1 : 1, 2 : 2}}, | 
|  | 217 | 'byte_set_map'       : {0 : [], 1 : [1], 2 : [1, 2]}, | 
|  | 218 | 'byte_list_map'      : {0 : [], 1 : [1], 2 : [1, 2]}, | 
| Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 219 | } | 
| Bryan Duxbury | 5b8b484 | 2009-04-01 20:10:15 +0000 | [diff] [blame] | 220 |  | 
|  | 221 |  | 
| Bryan Duxbury | 2d80470 | 2009-12-18 19:41:11 +0000 | [diff] [blame] | 222 | const i32 MYCONST = 2 | 
| Bryan Duxbury | 5b8b484 | 2009-04-01 20:10:15 +0000 | [diff] [blame] | 223 |  | 
| Bryan Duxbury | 986d50f | 2009-12-31 18:18:00 +0000 | [diff] [blame] | 224 |  | 
|  | 225 | exception ExceptionWithAMap { | 
|  | 226 | 1: string blah; | 
|  | 227 | 2: map<string, string> map_field; | 
|  | 228 | } | 
|  | 229 |  | 
|  | 230 | service ServiceForExceptionWithAMap { | 
|  | 231 | void methodThatThrowsAnException() throws (1: ExceptionWithAMap xwamap); | 
|  | 232 | } | 
|  | 233 |  | 
| Bryan Duxbury | 5b8b484 | 2009-04-01 20:10:15 +0000 | [diff] [blame] | 234 | service Srv { | 
| David Reiss | 689c9ad | 2009-04-02 19:24:02 +0000 | [diff] [blame] | 235 | i32 Janky(1: i32 arg); | 
| Bryan Duxbury | d58ccec | 2010-05-26 16:34:48 +0000 | [diff] [blame] | 236 |  | 
| Bryan Duxbury | 5b8b484 | 2009-04-01 20:10:15 +0000 | [diff] [blame] | 237 | // return type only methods | 
| Bryan Duxbury | d58ccec | 2010-05-26 16:34:48 +0000 | [diff] [blame] | 238 |  | 
| Bryan Duxbury | 5b8b484 | 2009-04-01 20:10:15 +0000 | [diff] [blame] | 239 | void voidMethod(); | 
|  | 240 | i32 primitiveMethod(); | 
|  | 241 | CompactProtoTestStruct structMethod(); | 
| Bryan Duxbury | d58ccec | 2010-05-26 16:34:48 +0000 | [diff] [blame] | 242 |  | 
| Bryan Duxbury | 2d80470 | 2009-12-18 19:41:11 +0000 | [diff] [blame] | 243 | void methodWithDefaultArgs(1: i32 something = MYCONST); | 
| Bryan Duxbury | d58ccec | 2010-05-26 16:34:48 +0000 | [diff] [blame] | 244 |  | 
|  | 245 | oneway void onewayMethod(); | 
| Bryan Duxbury | 5b8b484 | 2009-04-01 20:10:15 +0000 | [diff] [blame] | 246 | } | 
|  | 247 |  | 
|  | 248 | service Inherited extends Srv { | 
| David Reiss | 689c9ad | 2009-04-02 19:24:02 +0000 | [diff] [blame] | 249 | i32 identity(1: i32 arg) | 
| Bryan Duxbury | 5b8b484 | 2009-04-01 20:10:15 +0000 | [diff] [blame] | 250 | } | 
|  | 251 |  | 
|  | 252 | service EmptyService {} | 
|  | 253 |  | 
|  | 254 | // The only purpose of this thing is to increase the size of the generated code | 
|  | 255 | // so that ZlibTest has more highly compressible data to play with. | 
|  | 256 | struct BlowUp { | 
|  | 257 | 1: map<list<i32>,set<map<i32,string>>> b1; | 
|  | 258 | 2: map<list<i32>,set<map<i32,string>>> b2; | 
|  | 259 | 3: map<list<i32>,set<map<i32,string>>> b3; | 
|  | 260 | 4: map<list<i32>,set<map<i32,string>>> b4; | 
|  | 261 | } | 
|  | 262 |  | 
| Bryan Duxbury | ff219ac | 2009-04-10 21:51:00 +0000 | [diff] [blame] | 263 |  | 
|  | 264 | struct ReverseOrderStruct { | 
|  | 265 | 4: string first; | 
|  | 266 | 3: i16 second; | 
|  | 267 | 2: i32 third; | 
|  | 268 | 1: i64 fourth; | 
|  | 269 | } | 
|  | 270 |  | 
|  | 271 | service ReverseOrderService { | 
|  | 272 | void myMethod(4: string first, 3: i16 second, 2: i32 third, 1: i64 fourth); | 
| Bryan Duxbury | ab3666e | 2009-09-01 23:03:47 +0000 | [diff] [blame] | 273 | } | 
|  | 274 |  | 
| Bryan Duxbury | 9af23d9 | 2009-11-19 17:26:38 +0000 | [diff] [blame] | 275 | enum SomeEnum { | 
| Bryan Duxbury | 2d80470 | 2009-12-18 19:41:11 +0000 | [diff] [blame] | 276 | ONE = 1 | 
|  | 277 | TWO = 2 | 
|  | 278 | } | 
|  | 279 |  | 
| Bryan Duxbury | d4235e0 | 2010-09-13 16:28:53 +0000 | [diff] [blame] | 280 | /** This is a docstring on a constant! */ | 
| Bryan Duxbury | 6e05e25 | 2010-09-12 15:22:49 +0000 | [diff] [blame] | 281 | const SomeEnum MY_SOME_ENUM = SomeEnum.ONE | 
| Bryan Duxbury | 2d80470 | 2009-12-18 19:41:11 +0000 | [diff] [blame] | 282 |  | 
|  | 283 | const SomeEnum MY_SOME_ENUM_1 = 1 | 
|  | 284 | /*const SomeEnum MY_SOME_ENUM_2 = 7*/ | 
|  | 285 |  | 
|  | 286 | const map<SomeEnum,SomeEnum> MY_ENUM_MAP = { | 
| Bryan Duxbury | 6e05e25 | 2010-09-12 15:22:49 +0000 | [diff] [blame] | 287 | SomeEnum.ONE : SomeEnum.TWO | 
| Bryan Duxbury | 2d80470 | 2009-12-18 19:41:11 +0000 | [diff] [blame] | 288 | } | 
|  | 289 |  | 
|  | 290 | struct StructWithSomeEnum { | 
|  | 291 | 1: SomeEnum blah; | 
|  | 292 | } | 
|  | 293 |  | 
|  | 294 | const map<SomeEnum,StructWithSomeEnum> EXTRA_CRAZY_MAP = { | 
| Bryan Duxbury | 6e05e25 | 2010-09-12 15:22:49 +0000 | [diff] [blame] | 295 | SomeEnum.ONE : {"blah" : SomeEnum.TWO} | 
| Bryan Duxbury | 9af23d9 | 2009-11-19 17:26:38 +0000 | [diff] [blame] | 296 | } | 
|  | 297 |  | 
| Bryan Duxbury | ab3666e | 2009-09-01 23:03:47 +0000 | [diff] [blame] | 298 | union TestUnion { | 
|  | 299 | /** | 
|  | 300 | * A doc string | 
|  | 301 | */ | 
|  | 302 | 1: string string_field; | 
|  | 303 | 2: i32 i32_field; | 
|  | 304 | 3: OneOfEach struct_field; | 
|  | 305 | 4: list<RandomStuff> struct_list; | 
|  | 306 | 5: i32 other_i32_field; | 
| Bryan Duxbury | 9af23d9 | 2009-11-19 17:26:38 +0000 | [diff] [blame] | 307 | 6: SomeEnum enum_field; | 
| Bryan Duxbury | 162b3ac | 2010-06-23 21:17:48 +0000 | [diff] [blame] | 308 | 7: set<i32> i32_set; | 
|  | 309 | 8: map<i32, i32> i32_map; | 
| Bryan Duxbury | ab3666e | 2009-09-01 23:03:47 +0000 | [diff] [blame] | 310 | } | 
|  | 311 |  | 
| Bryan Duxbury | c2ec7ca | 2009-12-31 18:59:15 +0000 | [diff] [blame] | 312 | union TestUnionMinusStringField { | 
|  | 313 | 2: i32 i32_field; | 
|  | 314 | 3: OneOfEach struct_field; | 
|  | 315 | 4: list<RandomStuff> struct_list; | 
|  | 316 | 5: i32 other_i32_field; | 
|  | 317 | 6: SomeEnum enum_field; | 
| Bryan Duxbury | 162b3ac | 2010-06-23 21:17:48 +0000 | [diff] [blame] | 318 | 7: set<i32> i32_set; | 
|  | 319 | 8: map<i32, i32> i32_map; | 
| Bryan Duxbury | c2ec7ca | 2009-12-31 18:59:15 +0000 | [diff] [blame] | 320 | } | 
|  | 321 |  | 
| Bryan Duxbury | e2e4ea1 | 2009-11-11 21:01:35 +0000 | [diff] [blame] | 322 | union ComparableUnion { | 
|  | 323 | 1: string string_field; | 
|  | 324 | 2: binary binary_field; | 
|  | 325 | } | 
|  | 326 |  | 
| Bryan Duxbury | ab3666e | 2009-09-01 23:03:47 +0000 | [diff] [blame] | 327 | struct StructWithAUnion { | 
|  | 328 | 1: TestUnion test_union; | 
| Bryan Duxbury | 51f2880 | 2009-10-01 20:53:45 +0000 | [diff] [blame] | 329 | } | 
|  | 330 |  | 
|  | 331 | struct PrimitiveThenStruct { | 
|  | 332 | 1: i32 blah; | 
|  | 333 | 2: i32 blah2; | 
|  | 334 | 3: Backwards bw; | 
| Bryan Duxbury | 2845b16 | 2009-11-09 15:55:22 +0000 | [diff] [blame] | 335 | } | 
|  | 336 |  | 
|  | 337 | typedef map<i32,i32> SomeMap | 
|  | 338 |  | 
|  | 339 | struct StructWithASomemap { | 
|  | 340 | 1: required SomeMap somemap_field; | 
| Bryan Duxbury | 986d50f | 2009-12-31 18:18:00 +0000 | [diff] [blame] | 341 | } | 
| Bryan Duxbury | 35565a4 | 2010-01-06 23:12:09 +0000 | [diff] [blame] | 342 |  | 
|  | 343 | struct BigFieldIdStruct { | 
|  | 344 | 1: string field1; | 
|  | 345 | 45: string field2; | 
|  | 346 | } | 
|  | 347 |  | 
|  | 348 | struct BreaksRubyCompactProtocol { | 
|  | 349 | 1: string field1; | 
|  | 350 | 2: BigFieldIdStruct field2; | 
|  | 351 | 3: i32 field3; | 
| Bryan Duxbury | 162b3ac | 2010-06-23 21:17:48 +0000 | [diff] [blame] | 352 | } | 
|  | 353 |  | 
| Bryan Duxbury | 40d51a2 | 2011-09-26 21:29:15 +0000 | [diff] [blame] | 354 | struct TupleProtocolTestStruct { | 
|  | 355 | optional i32 field1; | 
|  | 356 | optional i32 field2; | 
|  | 357 | optional i32 field3; | 
|  | 358 | optional i32 field4; | 
|  | 359 | optional i32 field5; | 
|  | 360 | optional i32 field6; | 
|  | 361 | optional i32 field7; | 
|  | 362 | optional i32 field8; | 
|  | 363 | optional i32 field9; | 
|  | 364 | optional i32 field10; | 
|  | 365 | optional i32 field11; | 
|  | 366 | optional i32 field12; | 
|  | 367 | } |