MCPcopy Create free account
hub / github.com/apache/thrift / GlobalFixture

Method GlobalFixture

lib/cpp/test/SecurityFromBufferTest.cpp:65–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64struct GlobalFixture {
65 GlobalFixture() {
66 using namespace boost::unit_test::framework;
67 for (int i = 0; i < master_test_suite().argc; ++i) {
68 BOOST_TEST_MESSAGE(boost::format("argv[%1%] = \"%2%\"") % i % master_test_suite().argv[i]);
69 }
70
71#ifdef __linux__
72 // OpenSSL calls send() without MSG_NOSIGPIPE so writing to a socket that has
73 // disconnected can cause a SIGPIPE signal...
74 signal(SIGPIPE, SIG_IGN);
75#endif
76
77 TSSLSocketFactory::setManualOpenSSLInitialization(true);
78 apache::thrift::transport::initializeOpenSSL();
79
80 keyDir = boost::filesystem::current_path().parent_path().parent_path().parent_path() / "test" / "keys";
81 if (!boost::filesystem::exists(certFile("server.crt"))) {
82 keyDir = boost::filesystem::path(master_test_suite().argv[master_test_suite().argc - 1]);
83 if (!boost::filesystem::exists(certFile("server.crt"))) {
84 throw std::invalid_argument("The last argument to this test must be the directory containing the test certificate(s).");
85 }
86 }
87 }
88
89 virtual ~GlobalFixture() {
90 apache::thrift::transport::cleanupOpenSSL();

Callers

nothing calls this directly

Calls 2

initializeOpenSSLFunction · 0.85
certFileFunction · 0.70

Tested by

no test coverage detected