proxygen
TestUtils.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
11 
13 
14 using namespace folly;
15 
16 namespace proxygen {
17 
19 const SocketAddress localAddr{"127.0.0.1", 80};
20 const SocketAddress peerAddr{"127.0.0.1", 12345};
21 
24  evb,
25  std::chrono::milliseconds(folly::HHWheelTimer::DEFAULT_TICK_INTERVAL),
27  std::chrono::milliseconds(500)));
28  return t;
29 }
30 
33  evb,
34  std::chrono::milliseconds(folly::HHWheelTimer::DEFAULT_TICK_INTERVAL),
36  std::chrono::milliseconds(500)));
37  return t;
38 }
39 
41  auto transport = new testing::NiceMock<MockAsyncTransport>();
42  EXPECT_CALL(*transport, getEventBase())
43  .WillRepeatedly(testing::Return(evb));
44  return transport;
45 }
46 
47 }
folly::HHWheelTimer::UniquePtr makeInternalTimeoutSet(EventBase *evb)
Definition: TestUtils.cpp:22
const SocketAddress peerAddr
Definition: TestUtils.cpp:20
EventBase * getEventBase()
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
const wangle::TransportInfo mockTransportInfo
Definition: TestUtils.cpp:18
static int DEFAULT_TICK_INTERVAL
Definition: HHWheelTimer.h:163
static UniquePtr newTimer(Args &&...args)
Definition: HHWheelTimer.h:61
folly::HHWheelTimer::UniquePtr makeTimeoutSet(EventBase *evb)
Definition: TestUtils.cpp:31
std::unique_ptr< HHWheelTimer, Destructor > UniquePtr
Definition: HHWheelTimer.h:57
const SocketAddress localAddr
Definition: TestUtils.cpp:19
testing::NiceMock< MockAsyncTransport > * newMockTransport(EventBase *evb)
Definition: TestUtils.cpp:40
#define EXPECT_CALL(obj, call)
internal::ReturnAction< R > Return(R value)