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

Method GlobalFixture

lib/cpp/test/SecurityTest.cpp:56–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

initializeOpenSSLFunction · 0.85
certFileFunction · 0.70

Tested by

no test coverage detected