| 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. | 
| Todd Lipcon | 53ae9f3 | 2009-12-07 00:42:38 +0000 | [diff] [blame] | 18 | * | 
|  | 19 | * Contains some contributions under the Thrift Software License. | 
|  | 20 | * Please see doc/old-thrift-license.txt in the Thrift distribution for | 
|  | 21 | * details. | 
| David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 22 | */ | 
|  | 23 |  | 
| Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 24 | namespace c_glib TTest | 
| David Reiss | 771f8c7 | 2008-02-27 01:55:25 +0000 | [diff] [blame] | 25 | namespace java thrift.test | 
| David Reiss | 9a08dc6 | 2008-02-27 01:55:17 +0000 | [diff] [blame] | 26 | namespace cpp thrift.test | 
| David Reiss | 6a4b82c | 2008-03-27 21:42:16 +0000 | [diff] [blame] | 27 | namespace rb Thrift.Test | 
| David Reiss | 07ef3a9 | 2008-03-27 21:42:39 +0000 | [diff] [blame] | 28 | namespace perl ThriftTest | 
| David Reiss | 9d65bf0 | 2008-03-27 21:41:37 +0000 | [diff] [blame] | 29 | namespace csharp Thrift.Test | 
| T Jake Luciani | 322caa2 | 2010-02-15 03:24:55 +0000 | [diff] [blame] | 30 | namespace js ThriftTest | 
| Bryan Duxbury | 4d8a9cd | 2010-08-30 17:09:58 +0000 | [diff] [blame] | 31 | namespace st ThriftTest | 
| Anthony F. Molinaro | 0b4936d | 2010-09-27 04:43:39 +0000 | [diff] [blame] | 32 | namespace py ThriftTest | 
| Roger Meier | 50e4349 | 2010-10-08 17:46:06 +0000 | [diff] [blame] | 33 | namespace py.twisted ThriftTest | 
| Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 34 | namespace go ThriftTest | 
| Bryan Duxbury | 1d373bc | 2011-03-02 18:13:30 +0000 | [diff] [blame] | 35 | namespace php ThriftTest | 
| Jake Farrell | 7ae13e1 | 2011-10-18 14:35:26 +0000 | [diff] [blame] | 36 | namespace delphi Thrift.Test | 
| Jake Farrell | 9689d89 | 2011-12-06 01:07:17 +0000 | [diff] [blame] | 37 | namespace cocoa ThriftTest | 
| Henrique Mendonça | 8ad13a3 | 2013-05-16 21:26:20 +0200 | [diff] [blame] | 38 |  | 
|  | 39 | // Presence of namespaces and sub-namespaces for which there is | 
|  | 40 | // no generator should compile with warnings only | 
|  | 41 | namespace noexist ThriftTest | 
|  | 42 | namespace cpp.noexist ThriftTest | 
|  | 43 |  | 
| David Reiss | fb790d7 | 2010-09-02 16:41:45 +0000 | [diff] [blame] | 44 | namespace * thrift.test | 
| Marc Slemko | 1785985 | 2006-08-15 00:21:31 +0000 | [diff] [blame] | 45 |  | 
| Bryan Duxbury | 9af23d9 | 2009-11-19 17:26:38 +0000 | [diff] [blame] | 46 | /** | 
|  | 47 | * Docstring! | 
|  | 48 | */ | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 49 | enum Numberz | 
|  | 50 | { | 
|  | 51 | ONE = 1, | 
|  | 52 | TWO, | 
|  | 53 | THREE, | 
|  | 54 | FIVE = 5, | 
|  | 55 | SIX, | 
|  | 56 | EIGHT = 8 | 
|  | 57 | } | 
|  | 58 |  | 
| Bryan Duxbury | 9f0a786 | 2010-09-12 14:38:36 +0000 | [diff] [blame] | 59 | const Numberz myNumberz = Numberz.ONE; | 
|  | 60 | // the following is expected to fail: | 
|  | 61 | // const Numberz urNumberz = ONE; | 
|  | 62 |  | 
| Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 63 | typedef i64 UserId | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 64 |  | 
| Mark Slee | e129a2d | 2007-02-21 05:17:48 +0000 | [diff] [blame] | 65 | struct Bonk | 
|  | 66 | { | 
|  | 67 | 1: string message, | 
|  | 68 | 2: i32 type | 
|  | 69 | } | 
|  | 70 |  | 
| Jens Geyer | 11430df | 2013-07-26 00:23:00 +0200 | [diff] [blame] | 71 | typedef map<string,Bonk> MapType | 
|  | 72 |  | 
| Kevin Clark | 9a863ee | 2009-03-24 16:04:36 +0000 | [diff] [blame] | 73 | struct Bools { | 
|  | 74 | 1: bool im_true, | 
|  | 75 | 2: bool im_false, | 
|  | 76 | } | 
|  | 77 |  | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 78 | struct Xtruct | 
|  | 79 | { | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 80 | 1:  string string_thing, | 
|  | 81 | 4:  byte   byte_thing, | 
|  | 82 | 9:  i32    i32_thing, | 
|  | 83 | 11: i64    i64_thing | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 84 | } | 
|  | 85 |  | 
|  | 86 | struct Xtruct2 | 
|  | 87 | { | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 88 | 1: byte   byte_thing, | 
|  | 89 | 2: Xtruct struct_thing, | 
|  | 90 | 3: i32    i32_thing | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 91 | } | 
|  | 92 |  | 
| David Reiss | 233ace5 | 2009-03-30 20:46:47 +0000 | [diff] [blame] | 93 | struct Xtruct3 | 
|  | 94 | { | 
|  | 95 | 1:  string string_thing, | 
|  | 96 | 4:  i32    changed, | 
|  | 97 | 9:  i32    i32_thing, | 
|  | 98 | 11: i64    i64_thing | 
|  | 99 | } | 
|  | 100 |  | 
|  | 101 |  | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 102 | struct Insanity | 
|  | 103 | { | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 104 | 1: map<Numberz, UserId> userMap, | 
|  | 105 | 2: list<Xtruct> xtructs | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 106 | } | 
|  | 107 |  | 
| Bryan Duxbury | 986d705 | 2009-01-29 01:51:08 +0000 | [diff] [blame] | 108 | struct CrazyNesting { | 
|  | 109 | 1: string string_field, | 
|  | 110 | 2: optional set<Insanity> set_field, | 
| Bryan Duxbury | b3d0aa0 | 2010-10-06 20:00:03 +0000 | [diff] [blame] | 111 | 3: required list< map<set<i32>,map<i32,set<list<map<Insanity,string>>>>>> list_field, | 
|  | 112 | 4: binary binary_field | 
| Bryan Duxbury | 986d705 | 2009-01-29 01:51:08 +0000 | [diff] [blame] | 113 | } | 
|  | 114 |  | 
| Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 115 | exception Xception { | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 116 | 1: i32 errorCode, | 
|  | 117 | 2: string message | 
| Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 118 | } | 
|  | 119 |  | 
| Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 120 | exception Xception2 { | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 121 | 1: i32 errorCode, | 
|  | 122 | 2: Xtruct struct_thing | 
| Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 123 | } | 
| Mark Slee | 27ed6ec | 2007-08-16 01:26:31 +0000 | [diff] [blame] | 124 |  | 
| Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame] | 125 | struct EmptyStruct {} | 
|  | 126 |  | 
| Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 127 | struct OneField { | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 128 | 1: EmptyStruct field | 
| Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 129 | } | 
| Marc Slemko | 5b126d6 | 2006-08-11 23:03:42 +0000 | [diff] [blame] | 130 |  | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 131 | service ThriftTest | 
|  | 132 | { | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 133 | /** | 
|  | 134 | * Prints "testVoid()" and returns nothing. | 
|  | 135 | */ | 
| Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 136 | void         testVoid(), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 137 |  | 
|  | 138 | /** | 
|  | 139 | * Prints 'testString("%s")' with thing as '%s' | 
|  | 140 | * @param string thing - the string to print | 
|  | 141 | * @return string - returns the string 'thing' | 
|  | 142 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 143 | string       testString(1: string thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 144 |  | 
|  | 145 | /** | 
|  | 146 | * Prints 'testByte("%d")' with thing as '%d' | 
|  | 147 | * @param byte thing - the byte to print | 
|  | 148 | * @return byte - returns the byte 'thing' | 
|  | 149 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 150 | byte         testByte(1: byte thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 151 |  | 
|  | 152 | /** | 
|  | 153 | * Prints 'testI32("%d")' with thing as '%d' | 
|  | 154 | * @param i32 thing - the i32 to print | 
|  | 155 | * @return i32 - returns the i32 'thing' | 
|  | 156 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 157 | i32          testI32(1: i32 thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 158 |  | 
|  | 159 | /** | 
|  | 160 | * Prints 'testI64("%d")' with thing as '%d' | 
|  | 161 | * @param i64 thing - the i64 to print | 
|  | 162 | * @return i64 - returns the i64 'thing' | 
|  | 163 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 164 | i64          testI64(1: i64 thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 165 |  | 
|  | 166 | /** | 
|  | 167 | * Prints 'testDouble("%f")' with thing as '%f' | 
|  | 168 | * @param double thing - the double to print | 
|  | 169 | * @return double - returns the double 'thing' | 
|  | 170 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 171 | double       testDouble(1: double thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 172 |  | 
|  | 173 | /** | 
|  | 174 | * Prints 'testStruct("{%s}")' where thing has been formatted into a string of comma seperated values | 
|  | 175 | * @param Xtruct thing - the Xtruct to print | 
|  | 176 | * @return Xtruct - returns the Xtruct 'thing' | 
|  | 177 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 178 | Xtruct       testStruct(1: Xtruct thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 179 |  | 
|  | 180 | /** | 
|  | 181 | * Prints 'testNest("{%s}")' where thing has been formatted into a string of the nested struct | 
|  | 182 | * @param Xtruct2 thing - the Xtruct2 to print | 
|  | 183 | * @return Xtruct2 - returns the Xtruct2 'thing' | 
|  | 184 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 185 | Xtruct2      testNest(1: Xtruct2 thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 186 |  | 
|  | 187 | /** | 
|  | 188 | * Prints 'testMap("{%s")' where thing has been formatted into a string of  'key => value' pairs | 
|  | 189 | *  seperated by commas and new lines | 
|  | 190 | * @param map<i32,i32> thing - the map<i32,i32> to print | 
|  | 191 | * @return map<i32,i32> - returns the map<i32,i32> 'thing' | 
|  | 192 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 193 | map<i32,i32> testMap(1: map<i32,i32> thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 194 |  | 
|  | 195 | /** | 
|  | 196 | * Prints 'testStringMap("{%s}")' where thing has been formatted into a string of  'key => value' pairs | 
|  | 197 | *  seperated by commas and new lines | 
|  | 198 | * @param map<string,string> thing - the map<string,string> to print | 
|  | 199 | * @return map<string,string> - returns the map<string,string> 'thing' | 
|  | 200 | */ | 
| Roger Meier | 9d8e8f8 | 2011-06-14 19:38:27 +0000 | [diff] [blame] | 201 | map<string,string> testStringMap(1: map<string,string> thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 202 |  | 
|  | 203 | /** | 
|  | 204 | * Prints 'testSet("{%s}")' where thing has been formatted into a string of  values | 
|  | 205 | *  seperated by commas and new lines | 
|  | 206 | * @param set<i32> thing - the set<i32> to print | 
|  | 207 | * @return set<i32> - returns the set<i32> 'thing' | 
|  | 208 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 209 | set<i32>     testSet(1: set<i32> thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 210 |  | 
|  | 211 | /** | 
|  | 212 | * Prints 'testList("{%s}")' where thing has been formatted into a string of  values | 
|  | 213 | *  seperated by commas and new lines | 
|  | 214 | * @param list<i32> thing - the list<i32> to print | 
|  | 215 | * @return list<i32> - returns the list<i32> 'thing' | 
|  | 216 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 217 | list<i32>    testList(1: list<i32> thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 218 |  | 
|  | 219 | /** | 
|  | 220 | * Prints 'testEnum("%d")' where thing has been formatted into it's numeric value | 
|  | 221 | * @param Numberz thing - the Numberz to print | 
|  | 222 | * @return Numberz - returns the Numberz 'thing' | 
|  | 223 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 224 | Numberz      testEnum(1: Numberz thing), | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 225 |  | 
|  | 226 | /** | 
|  | 227 | * Prints 'testTypedef("%d")' with thing as '%d' | 
|  | 228 | * @param UserId thing - the UserId to print | 
|  | 229 | * @return UserId - returns the UserId 'thing' | 
|  | 230 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 231 | UserId       testTypedef(1: UserId thing), | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 232 |  | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 233 | /** | 
|  | 234 | * Prints 'testMapMap("%d")' with hello as '%d' | 
|  | 235 | * @param i32 hello - the i32 to print | 
|  | 236 | * @return map<i32,map<i32,i32>> - returns a dictionary with these values: | 
|  | 237 | *   {-4 => {-4 => -4, -3 => -3, -2 => -2, -1 => -1, }, 4 => {1 => 1, 2 => 2, 3 => 3, 4 => 4, }, } | 
|  | 238 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 239 | map<i32,map<i32,i32>> testMapMap(1: i32 hello), | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 240 |  | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 241 | /** | 
|  | 242 | * So you think you've got this all worked, out eh? | 
|  | 243 | * | 
|  | 244 | * Creates a the returned map with these values and prints it out: | 
|  | 245 | *   { 1 => { 2 => argument, | 
|  | 246 | *            3 => argument, | 
|  | 247 | *          }, | 
|  | 248 | *     2 => { 6 => <empty Insanity struct>, }, | 
|  | 249 | *   } | 
|  | 250 | * @return map<UserId, map<Numberz,Insanity>> - a map with the above values | 
|  | 251 | */ | 
| Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 252 | map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument), | 
| Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 253 |  | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 254 | /** | 
|  | 255 | * Prints 'testMulti()' | 
|  | 256 | * @param byte arg0 - | 
|  | 257 | * @param i32 arg1 - | 
|  | 258 | * @param i64 arg2 - | 
|  | 259 | * @param map<i16, string> arg3 - | 
|  | 260 | * @param Numberz arg4 - | 
|  | 261 | * @param UserId arg5 - | 
|  | 262 | * @return Xtruct - returns an Xtruct with string_thing = "Hello2, byte_thing = arg0, i32_thing = arg1 | 
|  | 263 | *    and i64_thing = arg2 | 
|  | 264 | */ | 
| David Reiss | 689c9ad | 2009-04-02 19:24:02 +0000 | [diff] [blame] | 265 | Xtruct testMulti(1: byte arg0, 2: i32 arg1, 3: i64 arg2, 4: map<i16, string> arg3, 5: Numberz arg4, 6: UserId arg5), | 
| Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 266 |  | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 267 | /** | 
|  | 268 | * Print 'testException(%s)' with arg as '%s' | 
|  | 269 | * @param string arg - a string indication what type of exception to throw | 
|  | 270 | * if arg == "Xception" throw Xception with errorCode = 1001 and message = arg | 
|  | 271 | * elsen if arg == "TException" throw TException | 
|  | 272 | * else do not throw anything | 
|  | 273 | */ | 
| David Reiss | 689c9ad | 2009-04-02 19:24:02 +0000 | [diff] [blame] | 274 | void testException(1: string arg) throws(1: Xception err1), | 
| Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 275 |  | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 276 | /** | 
|  | 277 | * Print 'testMultiException(%s, %s)' with arg0 as '%s' and arg1 as '%s' | 
|  | 278 | * @param string arg - a string indication what type of exception to throw | 
|  | 279 | * if arg0 == "Xception" throw Xception with errorCode = 1001 and message = "This is an Xception" | 
|  | 280 | * elsen if arg0 == "Xception2" throw Xception2 with errorCode = 2002 and message = "This is an Xception2" | 
|  | 281 | * else do not throw anything | 
|  | 282 | * @return Xtruct - an Xtruct with string_thing = arg1 | 
|  | 283 | */ | 
| David Reiss | 689c9ad | 2009-04-02 19:24:02 +0000 | [diff] [blame] | 284 | Xtruct testMultiException(1: string arg0, 2: string arg1) throws(1: Xception err1, 2: Xception2 err2) | 
| David Reiss | 2ab6fe8 | 2008-02-18 02:11:44 +0000 | [diff] [blame] | 285 |  | 
| Roger Meier | 1f8b48f | 2012-05-02 22:56:47 +0000 | [diff] [blame] | 286 | /** | 
|  | 287 | * Print 'testOneway(%d): Sleeping...' with secondsToSleep as '%d' | 
|  | 288 | * sleep 'secondsToSleep' | 
|  | 289 | * Print 'testOneway(%d): done sleeping!' with secondsToSleep as '%d' | 
|  | 290 | * @param i32 secondsToSleep - the number of seconds to sleep | 
|  | 291 | */ | 
| David Reiss | cecbed8 | 2009-03-24 20:02:22 +0000 | [diff] [blame] | 292 | oneway void testOneway(1:i32 secondsToSleep) | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 293 | } | 
| Mark Slee | dafa3cf | 2006-09-02 23:56:49 +0000 | [diff] [blame] | 294 |  | 
|  | 295 | service SecondService | 
|  | 296 | { | 
|  | 297 | void blahBlah() | 
|  | 298 | } | 
| David Reiss | 9ff3b9d | 2008-02-15 01:10:23 +0000 | [diff] [blame] | 299 |  | 
|  | 300 | struct VersioningTestV1 { | 
|  | 301 | 1: i32 begin_in_both, | 
| David Reiss | a528f54 | 2009-03-24 22:48:40 +0000 | [diff] [blame] | 302 | 3: string old_string, | 
| David Reiss | 9ff3b9d | 2008-02-15 01:10:23 +0000 | [diff] [blame] | 303 | 12: i32 end_in_both | 
|  | 304 | } | 
|  | 305 |  | 
|  | 306 | struct VersioningTestV2 { | 
|  | 307 | 1: i32 begin_in_both, | 
|  | 308 |  | 
|  | 309 | 2: i32 newint, | 
|  | 310 | 3: byte newbyte, | 
|  | 311 | 4: i16 newshort, | 
|  | 312 | 5: i64 newlong, | 
|  | 313 | 6: double newdouble | 
|  | 314 | 7: Bonk newstruct, | 
|  | 315 | 8: list<i32> newlist, | 
|  | 316 | 9: set<i32> newset, | 
|  | 317 | 10: map<i32, i32> newmap, | 
|  | 318 | 11: string newstring, | 
|  | 319 | 12: i32 end_in_both | 
| David Reiss | 9a08dc6 | 2008-02-27 01:55:17 +0000 | [diff] [blame] | 320 | } | 
| David Reiss | 2a4bfd6 | 2008-04-07 23:45:00 +0000 | [diff] [blame] | 321 |  | 
|  | 322 | struct ListTypeVersioningV1 { | 
|  | 323 | 1: list<i32> myints; | 
|  | 324 | 2: string hello; | 
|  | 325 | } | 
|  | 326 |  | 
|  | 327 | struct ListTypeVersioningV2 { | 
|  | 328 | 1: list<string> strings; | 
|  | 329 | 2: string hello; | 
| Bryan Duxbury | 986d705 | 2009-01-29 01:51:08 +0000 | [diff] [blame] | 330 | } | 
| Bryan Duxbury | 206c0dc | 2010-10-19 23:00:27 +0000 | [diff] [blame] | 331 |  | 
|  | 332 | struct GuessProtocolStruct { | 
|  | 333 | 7: map<string,string> map_field, | 
|  | 334 | } | 
| Bryan Duxbury | df4cffd | 2011-03-15 17:16:09 +0000 | [diff] [blame] | 335 |  | 
|  | 336 | struct LargeDeltas { | 
|  | 337 | 1: Bools b1, | 
|  | 338 | 10: Bools b10, | 
|  | 339 | 100: Bools b100, | 
|  | 340 | 500: bool check_true, | 
|  | 341 | 1000: Bools b1000, | 
|  | 342 | 1500: bool check_false, | 
|  | 343 | 2000: VersioningTestV2 vertwo2000, | 
|  | 344 | 2500: set<string> a_set2500, | 
|  | 345 | 3000: VersioningTestV2 vertwo3000, | 
|  | 346 | 4000: list<i32> big_numbers | 
|  | 347 | } | 
| Roger Meier | f4eec7a | 2011-09-11 18:16:21 +0000 | [diff] [blame] | 348 |  | 
|  | 349 | struct NestedListsI32x2 { | 
|  | 350 | 1: list<list<i32>> integerlist | 
|  | 351 | } | 
|  | 352 | struct NestedListsI32x3 { | 
|  | 353 | 1: list<list<list<i32>>> integerlist | 
|  | 354 | } | 
|  | 355 | struct NestedMixedx2 { | 
|  | 356 | 1: list<set<i32>> int_set_list | 
|  | 357 | 2: map<i32,set<string>> map_int_strset | 
|  | 358 | 3: list<map<i32,set<string>>> map_int_strset_list | 
|  | 359 | } | 
|  | 360 | struct ListBonks { | 
|  | 361 | 1: list<Bonk> bonk | 
|  | 362 | } | 
|  | 363 | struct NestedListsBonk { | 
|  | 364 | 1: list<list<list<Bonk>>> bonk | 
|  | 365 | } | 
| Bryan Duxbury | 6c928f3 | 2011-10-13 21:32:52 +0000 | [diff] [blame] | 366 |  | 
|  | 367 | struct BoolTest { | 
|  | 368 | 1: optional bool b = true; | 
|  | 369 | 2: optional string s = "true"; | 
|  | 370 | } | 
| Bryan Duxbury | a3df547 | 2011-12-27 22:26:59 +0000 | [diff] [blame] | 371 |  | 
|  | 372 | struct StructA { | 
|  | 373 | 1: required string s; | 
|  | 374 | } | 
|  | 375 |  | 
|  | 376 | struct StructB { | 
|  | 377 | 1: optional StructA aa; | 
|  | 378 | 2: required StructA ab; | 
| Henrique Mendonça | 8ad13a3 | 2013-05-16 21:26:20 +0200 | [diff] [blame] | 379 | } |