David Reiss | 2a4bfd6 | 2008-04-07 23:45:00 +0000 | [diff] [blame] | 1 | namespace cpp thrift.test.debug |
David Reiss | 3b15ebc | 2008-03-02 06:29:19 +0000 | [diff] [blame] | 2 | namespace java thrift.test |
David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 3 | |
David Reiss | db0ea15 | 2008-02-18 01:49:37 +0000 | [diff] [blame] | 4 | struct Doubles { |
| 5 | 1: double nan, |
| 6 | 2: double inf, |
| 7 | 3: double neginf, |
| 8 | 4: double repeating, |
| 9 | 5: double big, |
| 10 | 6: double small, |
| 11 | 7: double zero, |
| 12 | 8: double negzero, |
| 13 | } |
| 14 | |
David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 15 | struct OneOfEach { |
| 16 | 1: bool im_true, |
| 17 | 2: bool im_false, |
David Reiss | a8efac8 | 2008-12-16 20:28:13 +0000 | [diff] [blame] | 18 | 3: byte a_bite = 200, |
| 19 | 4: i16 integer16 = 33000, |
David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 20 | 5: i32 integer32, |
David Reiss | a8efac8 | 2008-12-16 20:28:13 +0000 | [diff] [blame] | 21 | 6: i64 integer64 = 10000000000, |
David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 22 | 7: double double_precision, |
| 23 | 8: string some_characters, |
| 24 | 9: string zomg_unicode, |
| 25 | 10: bool what_who, |
David Reiss | db0ea15 | 2008-02-18 01:49:37 +0000 | [diff] [blame] | 26 | 11: binary base64, |
David Reiss | a8efac8 | 2008-12-16 20:28:13 +0000 | [diff] [blame] | 27 | 12: list<byte> byte_list = [1, 2, 3], |
| 28 | 13: list<i16> i16_list = [1,2,3], |
| 29 | 14: list<i64> i64_list = [1,2,3] |
David Reiss | 00dcccf | 2007-07-21 01:18:10 +0000 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | struct Bonk { |
| 33 | 1: i32 type, |
| 34 | 2: string message, |
| 35 | } |
| 36 | |
| 37 | struct Nesting { |
| 38 | 1: Bonk my_bonk, |
| 39 | 2: OneOfEach my_ooe, |
| 40 | } |
| 41 | |
| 42 | struct HolyMoley { |
| 43 | 1: list<OneOfEach> big, |
| 44 | 2: set<list<string>> contain, |
| 45 | 3: map<string,list<Bonk>> bonks, |
| 46 | } |
David Reiss | 382fc30 | 2007-08-25 18:01:30 +0000 | [diff] [blame] | 47 | |
| 48 | struct Backwards { |
| 49 | 2: i32 first_tag2, |
| 50 | 1: i32 second_tag1, |
| 51 | } |
| 52 | |
| 53 | struct Empty { |
| 54 | } |
| 55 | |
| 56 | struct Wrapper { |
| 57 | 1: Empty foo |
| 58 | } |
| 59 | |
| 60 | struct RandomStuff { |
| 61 | 1: i32 a, |
| 62 | 2: i32 b, |
| 63 | 3: i32 c, |
| 64 | 4: i32 d, |
| 65 | 5: list<i32> myintlist, |
| 66 | 6: map<i32,Wrapper> maps, |
| 67 | 7: i64 bigint, |
| 68 | 8: double triple, |
| 69 | } |
| 70 | |
David Reiss | 4a8f46c | 2008-03-07 20:12:07 +0000 | [diff] [blame] | 71 | struct Base64 { |
| 72 | 1: i32 a, |
| 73 | 2: binary b1, |
| 74 | 3: binary b2, |
| 75 | 4: binary b3, |
| 76 | 5: binary b4, |
| 77 | 6: binary b5, |
| 78 | 7: binary b6, |
| 79 | } |
| 80 | |
David Reiss | 382fc30 | 2007-08-25 18:01:30 +0000 | [diff] [blame] | 81 | service Srv { |
| 82 | i32 Janky(i32 arg) |
| 83 | } |
David Reiss | 2375312 | 2007-08-27 19:57:34 +0000 | [diff] [blame] | 84 | |
David Reiss | a7fc092 | 2009-02-07 02:37:09 +0000 | [diff] [blame] | 85 | service Inherited extends Srv { |
| 86 | i32 identity(i32 arg) |
| 87 | } |
| 88 | |
David Reiss | 8cee47c | 2009-02-07 02:37:05 +0000 | [diff] [blame] | 89 | service EmptyService {} |
| 90 | |
David Reiss | faebedd | 2007-09-17 23:20:38 +0000 | [diff] [blame] | 91 | // The only purpose of this thing is to increase the size of the generated code |
| 92 | // so that ZlibTest has more highly compressible data to play with. |
| 93 | struct BlowUp { |
| 94 | 1: map<list<i32>,set<map<i32,string>>> b1; |
| 95 | 2: map<list<i32>,set<map<i32,string>>> b2; |
| 96 | 3: map<list<i32>,set<map<i32,string>>> b3; |
| 97 | 4: map<list<i32>,set<map<i32,string>>> b4; |
| 98 | } |
Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame^] | 99 | |
| 100 | struct CompactProtoTestStruct { |
| 101 | // primitive fields |
| 102 | 1: byte a_byte = 127; |
| 103 | 2: i16 a_i16 = 32000; |
| 104 | 3: i32 a_i32 = 1000000000; |
| 105 | 4: i64 a_i64 = 0xffffffffff; |
| 106 | 5: double a_double = 5.6789; |
| 107 | 6: string a_string = "my string"; |
| 108 | 7: binary a_binary; |
| 109 | 8: bool true_field = 1; |
| 110 | 9: bool false_field = 0; |
| 111 | 10: Empty empty_struct_field = {}; |
| 112 | |
| 113 | // primitives in lists |
| 114 | 11: list<byte> byte_list = [-127, -1, 0, 1, 127]; |
| 115 | 12: list<i16> i16_list = [-1, 0, 1, 0x7fff]; |
| 116 | 13: list<i32> i32_list = [-1, 0, 0xff, 0xffff, 0xffffff, 0x7fffffff]; |
| 117 | 14: list<i64> i64_list = [-1, 0, 0xff, 0xffff, 0xffffff, 0xffffffff, 0xffffffffff, 0xffffffffffff, 0xffffffffffffff, 0x7fffffffffffffff]; |
| 118 | 15: list<double> double_list = [0.1, 0.2, 0.3]; |
| 119 | 16: list<string> string_list = ["first", "second", "third"]; |
| 120 | 17: list<binary> binary_list; |
| 121 | 18: list<bool> boolean_list = [1, 1, 1, 0, 0, 0]; |
| 122 | 19: list<Empty> struct_list = [{}, {}]; |
| 123 | |
| 124 | // primitives in sets |
| 125 | 20: set<byte> byte_set = [-127, -1, 0, 1, 127]; |
| 126 | 21: set<i16> i16_set = [-1, 0, 1, 0x7fff]; |
| 127 | 22: set<i32> i32_set = [1, 2, 3]; |
| 128 | 23: set<i64> i64_set = [-1, 0, 0xff, 0xffff, 0xffffff, 0xffffffff, 0xffffffffff, 0xffffffffffff, 0xffffffffffffff, 0x7fffffffffffffff]; |
| 129 | 24: set<double> double_set = [0.1, 0.2, 0.3]; |
| 130 | 25: set<string> string_set = ["first", "second", "third"]; |
| 131 | 26: set<binary> binary_set; |
| 132 | 27: set<bool> boolean_set = [1, 0]; |
| 133 | 28: set<Empty> struct_set = [{}]; |
| 134 | |
| 135 | // maps |
| 136 | // primitives as keys |
| 137 | 29: map<byte, byte> byte_byte_map = {1 : 2}; |
| 138 | 30: map<i16, byte> i16_byte_map = {1 : 1, -1 : 1, 0x7fff : 1}; |
| 139 | 31: map<i32, byte> i32_byte_map = {1 : 1, -1 : 1, 0x7fffffff : 1}; |
| 140 | 32: map<i64, byte> i64_byte_map = {0 : 1, 1 : 1, -1 : 1, 0x7fffffffffffffff : 1}; |
| 141 | 33: map<double, byte> double_byte_map = {-1.1 : 1, 1.1 : 1}; |
| 142 | 34: map<string, byte> string_byte_map = {"first" : 1, "second" : 2, "third" : 3, "" : 0}; |
| 143 | 35: map<binary, byte> binary_byte_map; |
| 144 | 36: map<bool, byte> boolean_byte_map = {1 : 1, 0 : 0}; |
| 145 | // primitives as values |
| 146 | 37: map<byte, i16> byte_i16_map = {1 : 1, 2 : -1, 3 : 0x7fff}; |
| 147 | 38: map<byte, i32> byte_i32_map = {1 : 1, 2 : -1, 3 : 0x7fffffff}; |
| 148 | 39: map<byte, i64> byte_i64_map = {1 : 1, 2 : -1, 3 : 0x7fffffffffffffff}; |
| 149 | 40: map<byte, double> byte_double_map = {1 : 0.1, 2 : -0.1, 3 : 1000000.1}; |
| 150 | 41: map<byte, string> byte_string_map = {1 : "", 2 : "blah", 3 : "loooooooooooooong string"}; |
| 151 | 42: map<byte, binary> byte_binary_map; |
| 152 | 43: map<byte, bool> byte_boolean_map = {1 : 1, 2 : 0}; |
| 153 | // collections as keys |
| 154 | 44: map<list<byte>, byte> list_byte_map = {[1, 2, 3] : 1, [0, 1] : 2, [] : 0}; |
| 155 | 45: map<set<byte>, byte> set_byte_map = {[1, 2, 3] : 1, [0, 1] : 2, [] : 0}; |
| 156 | 46: map<map<byte,byte>, byte> map_byte_map = {{1 : 1} : 1, {2 : 2} : 2, {} : 0}; |
| 157 | // collections as values |
| 158 | 47: map<byte, map<byte,byte>> byte_map_map = {0 : {}, 1 : {1 : 1}, 2 : {1 : 1, 2 : 2}}; |
| 159 | 48: map<byte, set<byte>> byte_set_map = {0 : [], 1 : [1], 2 : [1, 2]}; |
| 160 | 49: map<byte, list<byte>> byte_list_map = {0 : [], 1 : [1], 2 : [1, 2]}; |
| 161 | } |