David Reiss | e4db03d | 2008-04-08 05:06:59 +0000 | [diff] [blame] | 1 | #include <cstdlib> |
| 2 | #include <stdexcept> |
| 3 | #include <Thrift.h> |
| 4 | #include <transport/TFDTransport.h> |
| 5 | using facebook::thrift::transport::TTransportException; |
| 6 | using facebook::thrift::transport::TFDTransport; |
| 7 | |
| 8 | class DummyException : std::exception { |
| 9 | }; |
| 10 | |
| 11 | int main() { |
| 12 | { |
| 13 | TFDTransport t(256, TFDTransport::NO_CLOSE_ON_DESTROY); |
| 14 | } |
| 15 | |
| 16 | try { |
| 17 | { |
| 18 | TFDTransport t(256, TFDTransport::CLOSE_ON_DESTROY); |
| 19 | } |
| 20 | std::abort(); |
| 21 | } catch (TTransportException) { |
| 22 | } |
| 23 | |
| 24 | try { |
| 25 | { |
| 26 | TFDTransport t(256, TFDTransport::CLOSE_ON_DESTROY); |
| 27 | throw DummyException(); |
| 28 | } |
| 29 | std::abort(); |
| 30 | } catch (TTransportException&) { |
| 31 | abort(); |
| 32 | } catch (DummyException&) { |
| 33 | } |
| 34 | |
| 35 | return 0; |
| 36 | |
| 37 | } |