mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
38 lines
689 B
C++
38 lines
689 B
C++
|
#include <cstdlib>
|
||
|
#include <stdexcept>
|
||
|
#include <Thrift.h>
|
||
|
#include <transport/TFDTransport.h>
|
||
|
using facebook::thrift::transport::TTransportException;
|
||
|
using facebook::thrift::transport::TFDTransport;
|
||
|
|
||
|
class DummyException : std::exception {
|
||
|
};
|
||
|
|
||
|
int main() {
|
||
|
{
|
||
|
TFDTransport t(256, TFDTransport::NO_CLOSE_ON_DESTROY);
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
{
|
||
|
TFDTransport t(256, TFDTransport::CLOSE_ON_DESTROY);
|
||
|
}
|
||
|
std::abort();
|
||
|
} catch (TTransportException) {
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
{
|
||
|
TFDTransport t(256, TFDTransport::CLOSE_ON_DESTROY);
|
||
|
throw DummyException();
|
||
|
}
|
||
|
std::abort();
|
||
|
} catch (TTransportException&) {
|
||
|
abort();
|
||
|
} catch (DummyException&) {
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
|
||
|
}
|