From 02fe20e3434fd6400ecf2ad92c7e1231b8f17108 Mon Sep 17 00:00:00 2001 From: Mingtao Yang Date: Tue, 22 Aug 2017 10:36:32 -0700 Subject: [PATCH] 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 --- folly/io/async/test/MockAsyncSSLSocket.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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, -- 2.34.1