mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-08-08 09:42:06 +03:00
Use MockAsyncUDPSocket for Quic inplace batch writer tests
Summary: To make sure the writer maker function actually return the Inplace writer Reviewed By: lnicco Differential Revision: D21613419 fbshipit-source-id: da7e59b43785b13fd91cc1a737db87af7dfb1c8f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8441a0dc7e
commit
ddf49f4d26
@@ -351,9 +351,8 @@ TEST_P(QuicBatchWriterTest, TestBatchingSendmmsgGSOBatcBigSmallPacket) {
|
|||||||
TEST_P(QuicBatchWriterTest, InplaceWriterNeedsFlush) {
|
TEST_P(QuicBatchWriterTest, InplaceWriterNeedsFlush) {
|
||||||
bool useThreadLocal = GetParam();
|
bool useThreadLocal = GetParam();
|
||||||
folly::EventBase evb;
|
folly::EventBase evb;
|
||||||
folly::AsyncUDPSocket sock(&evb);
|
folly::test::MockAsyncUDPSocket sock(&evb);
|
||||||
sock.setReuseAddr(false);
|
EXPECT_CALL(sock, getGSO()).WillRepeatedly(Return(1));
|
||||||
sock.bind(folly::SocketAddress("127.0.0.1", 0));
|
|
||||||
uint32_t batchSize = 20;
|
uint32_t batchSize = 20;
|
||||||
auto bufAccessor =
|
auto bufAccessor =
|
||||||
std::make_unique<SimpleBufAccessor>(conn_.udpSendPacketLen * batchSize);
|
std::make_unique<SimpleBufAccessor>(conn_.udpSendPacketLen * batchSize);
|
||||||
@@ -379,9 +378,8 @@ TEST_P(QuicBatchWriterTest, InplaceWriterNeedsFlush) {
|
|||||||
TEST_P(QuicBatchWriterTest, InplaceWriterAppendLimit) {
|
TEST_P(QuicBatchWriterTest, InplaceWriterAppendLimit) {
|
||||||
bool useThreadLocal = GetParam();
|
bool useThreadLocal = GetParam();
|
||||||
folly::EventBase evb;
|
folly::EventBase evb;
|
||||||
folly::AsyncUDPSocket sock(&evb);
|
folly::test::MockAsyncUDPSocket sock(&evb);
|
||||||
sock.setReuseAddr(false);
|
EXPECT_CALL(sock, getGSO()).WillRepeatedly(Return(1));
|
||||||
sock.bind(folly::SocketAddress("127.0.0.1", 0));
|
|
||||||
uint32_t batchSize = 20;
|
uint32_t batchSize = 20;
|
||||||
auto bufAccessor =
|
auto bufAccessor =
|
||||||
std::make_unique<SimpleBufAccessor>(conn_.udpSendPacketLen * batchSize);
|
std::make_unique<SimpleBufAccessor>(conn_.udpSendPacketLen * batchSize);
|
||||||
@@ -415,9 +413,8 @@ TEST_P(QuicBatchWriterTest, InplaceWriterAppendLimit) {
|
|||||||
TEST_P(QuicBatchWriterTest, InplaceWriterAppendSmaller) {
|
TEST_P(QuicBatchWriterTest, InplaceWriterAppendSmaller) {
|
||||||
bool useThreadLocal = GetParam();
|
bool useThreadLocal = GetParam();
|
||||||
folly::EventBase evb;
|
folly::EventBase evb;
|
||||||
folly::AsyncUDPSocket sock(&evb);
|
folly::test::MockAsyncUDPSocket sock(&evb);
|
||||||
sock.setReuseAddr(false);
|
EXPECT_CALL(sock, getGSO()).WillRepeatedly(Return(1));
|
||||||
sock.bind(folly::SocketAddress("127.0.0.1", 0));
|
|
||||||
uint32_t batchSize = 20;
|
uint32_t batchSize = 20;
|
||||||
auto bufAccessor =
|
auto bufAccessor =
|
||||||
std::make_unique<SimpleBufAccessor>(conn_.udpSendPacketLen * batchSize);
|
std::make_unique<SimpleBufAccessor>(conn_.udpSendPacketLen * batchSize);
|
||||||
|
Reference in New Issue
Block a user