blob: dfc2d277b401cf164fdc7e5c586b3789d152bc4c [file] [log] [blame]
David Reisse4db03d2008-04-08 05:06:59 +00001#include <cstdlib>
2#include <stdexcept>
3#include <Thrift.h>
4#include <transport/TFDTransport.h>
5using facebook::thrift::transport::TTransportException;
6using facebook::thrift::transport::TFDTransport;
7
8class DummyException : std::exception {
9};
10
11int 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}