From: Mingtao Yang Date: Tue, 22 Aug 2017 17:36:32 +0000 (-0700) Subject: Explicitly initialize AsyncSocket in MockAsyncSSLSocket X-Git-Tag: v2017.08.28.00~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=02fe20e3434fd6400ecf2ad92c7e1231b8f17108;p=folly.git Explicitly initialize AsyncSocket in MockAsyncSSLSocket Summary: Even though MockAsyncSSLSocket's initializes AsyncSSLSocket, which should initialize AsyncSocket, this does not actually happen because AsyncSSLSocket virtually inherits from AsyncSocket. Because of this, prior to this diff, the MockAsyncSSLSocket was not properly setting its EventBase. Reviewed By: knekritz Differential Revision: D5676596 fbshipit-source-id: 5f3c0e848179cb5eb4d2dc4921a11e7c04d7c0e0 --- diff --git a/folly/io/async/test/MockAsyncSSLSocket.h b/folly/io/async/test/MockAsyncSSLSocket.h index a627ba46..cff750f8 100644 --- a/folly/io/async/test/MockAsyncSSLSocket.h +++ b/folly/io/async/test/MockAsyncSSLSocket.h @@ -23,11 +23,11 @@ namespace folly { namespace test { class MockAsyncSSLSocket : public AsyncSSLSocket { public: MockAsyncSSLSocket( - const std::shared_ptr& ctx, - EventBase* base, - bool deferSecurityNegotiation = false) : - AsyncSSLSocket(ctx, base, deferSecurityNegotiation) { - } + const std::shared_ptr& ctx, + EventBase* base, + bool deferSecurityNegotiation = false) + : AsyncSocket(base), + AsyncSSLSocket(ctx, base, deferSecurityNegotiation) {} GMOCK_METHOD5_(, noexcept, , connect,