David Reiss | d779cbe | 2007-08-31 01:42:55 +0000 | [diff] [blame] | 1 | /* |
David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 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 | |
| 20 | /* |
David Reiss | b139f64 | 2009-02-17 20:28:46 +0000 | [diff] [blame] | 21 | ../compiler/cpp/thrift -gen cpp:dense DebugProtoTest.thrift |
| 22 | ../compiler/cpp/thrift -gen cpp:dense DenseLinkingTest.thrift |
David Reiss | d779cbe | 2007-08-31 01:42:55 +0000 | [diff] [blame] | 23 | g++ -Wall -g -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \ |
| 24 | DebugProtoTest.cpp gen-cpp/DebugProtoTest_types.cpp \ |
| 25 | gen-cpp/DenseLinkingTest_types.cpp \ |
| 26 | ../lib/cpp/.libs/libthrift.a -o DebugProtoTest |
| 27 | ./DebugProtoTest |
| 28 | */ |
| 29 | |
| 30 | /* |
| 31 | The idea of this test is that everything is structurally identical to DebugProtoTest. |
| 32 | If I messed up the naming of the reflection local typespecs, |
| 33 | then compiling this should give errors because of doubly defined symbols. |
| 34 | */ |
| 35 | |
David Reiss | 9a08dc6 | 2008-02-27 01:55:17 +0000 | [diff] [blame] | 36 | namespace cpp thrift.test |
Roger Meier | e86428c | 2014-05-30 00:14:50 +0200 | [diff] [blame] | 37 | namespace java thrift.test |
David Reiss | d779cbe | 2007-08-31 01:42:55 +0000 | [diff] [blame] | 38 | |
| 39 | struct OneOfEachZZ { |
| 40 | 1: bool im_true, |
| 41 | 2: bool im_false, |
| 42 | 3: byte a_bite, |
| 43 | 4: i16 integer16, |
| 44 | 5: i32 integer32, |
| 45 | 6: i64 integer64, |
| 46 | 7: double double_precision, |
| 47 | 8: string some_characters, |
| 48 | 9: string zomg_unicode, |
| 49 | 10: bool what_who, |
| 50 | } |
| 51 | |
| 52 | struct BonkZZ { |
| 53 | 1: i32 type, |
| 54 | 2: string message, |
| 55 | } |
| 56 | |
| 57 | struct NestingZZ { |
| 58 | 1: BonkZZ my_bonk, |
| 59 | 2: OneOfEachZZ my_ooe, |
| 60 | } |
| 61 | |
| 62 | struct HolyMoleyZZ { |
| 63 | 1: list<OneOfEachZZ> big, |
| 64 | 2: set<list<string>> contain, |
| 65 | 3: map<string,list<BonkZZ>> bonks, |
| 66 | } |
| 67 | |
| 68 | struct BackwardsZZ { |
| 69 | 2: i32 first_tag2, |
| 70 | 1: i32 second_tag1, |
| 71 | } |
| 72 | |
| 73 | struct EmptyZZ { |
| 74 | } |
| 75 | |
| 76 | struct WrapperZZ { |
| 77 | 1: EmptyZZ foo |
| 78 | } |
| 79 | |
| 80 | struct RandomStuffZZ { |
| 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,WrapperZZ> maps, |
| 87 | 7: i64 bigint, |
| 88 | 8: double triple, |
| 89 | } |
| 90 | |
| 91 | service Srv { |
David Reiss | 689c9ad | 2009-04-02 19:24:02 +0000 | [diff] [blame] | 92 | i32 Janky(1: i32 arg) |
David Reiss | d779cbe | 2007-08-31 01:42:55 +0000 | [diff] [blame] | 93 | } |
Roger Meier | 84d1188 | 2014-07-25 23:26:11 +0200 | [diff] [blame] | 94 | |
| 95 | service UnderscoreSrv { |
| 96 | i64 some_rpc_call(1: string message) |
| 97 | } |
| 98 | |