mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-08-08 09:42:06 +03:00
Enable more tests for Windows
Summary: Enable more tests for Windows Reviewed By: mjoras Differential Revision: D39595126 fbshipit-source-id: 702d243ff7fbb5ffdb18af2dd1d13c184599ef75
This commit is contained in:
committed by
Facebook GitHub Bot
parent
64bb5c731e
commit
bad5e085ba
@@ -401,14 +401,9 @@ class MockLegacyObserver : public LegacyObserver {
|
|||||||
bool timeoutLoss) {
|
bool timeoutLoss) {
|
||||||
return AllOf(
|
return AllOf(
|
||||||
testing::Field(
|
testing::Field(
|
||||||
&SocketObserverInterface::LostPacket::lostByReorderThreshold,
|
&LostPacket::lostByReorderThreshold, testing::Eq(reorderLoss)),
|
||||||
testing::Eq(reorderLoss)),
|
testing::Field(&LostPacket::lostByTimeout, testing::Eq(timeoutLoss)),
|
||||||
testing::Field(
|
testing::Field(&LostPacket::packet, getLossPacketNum(packetNum)));
|
||||||
&SocketObserverInterface::LostPacket::lostByTimeout,
|
|
||||||
testing::Eq(timeoutLoss)),
|
|
||||||
testing::Field(
|
|
||||||
&SocketObserverInterface::LostPacket::packet,
|
|
||||||
getLossPacketNum(packetNum)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static auto getStreamEventMatcher(
|
static auto getStreamEventMatcher(
|
||||||
|
@@ -627,8 +627,8 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
QuicTransportImplTestBase,
|
QuicTransportImplTestBase,
|
||||||
QuicTransportImplTestBase,
|
QuicTransportImplTestBase,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
DelayedStreamNotifsTestParam{.notifyOnNewStreamsExplicitly = false},
|
DelayedStreamNotifsTestParam{false},
|
||||||
DelayedStreamNotifsTestParam{.notifyOnNewStreamsExplicitly = true}));
|
DelayedStreamNotifsTestParam{true}));
|
||||||
|
|
||||||
TEST_P(QuicTransportImplTestBase, AckTimeoutExpiredWillResetTimeoutFlag) {
|
TEST_P(QuicTransportImplTestBase, AckTimeoutExpiredWillResetTimeoutFlag) {
|
||||||
transport->invokeAckTimeout();
|
transport->invokeAckTimeout();
|
||||||
@@ -1662,14 +1662,10 @@ TEST_P(QuicTransportImplTestBase, ByteEventCallbacksManagementSingleStream) {
|
|||||||
auto stream = transport->createBidirectionalStream().value();
|
auto stream = transport->createBidirectionalStream().value();
|
||||||
uint64_t offset1 = 10, offset2 = 20;
|
uint64_t offset1 = 10, offset2 = 20;
|
||||||
|
|
||||||
ByteEvent txEvent1 = {
|
ByteEvent txEvent1 = ByteEvent{stream, offset1, ByteEvent::Type::TX};
|
||||||
.id = stream, .offset = offset1, .type = ByteEvent::Type::TX};
|
ByteEvent txEvent2 = ByteEvent{stream, offset2, ByteEvent::Type::TX};
|
||||||
ByteEvent txEvent2 = {
|
ByteEvent ackEvent1 = ByteEvent{stream, offset1, ByteEvent::Type::ACK};
|
||||||
.id = stream, .offset = offset2, .type = ByteEvent::Type::TX};
|
ByteEvent ackEvent2 = ByteEvent{stream, offset2, ByteEvent::Type::ACK};
|
||||||
ByteEvent ackEvent1 = {
|
|
||||||
.id = stream, .offset = offset1, .type = ByteEvent::Type::ACK};
|
|
||||||
ByteEvent ackEvent2 = {
|
|
||||||
.id = stream, .offset = offset2, .type = ByteEvent::Type::ACK};
|
|
||||||
|
|
||||||
// Register 2 TX and 2 ACK events for the same stream at 2 different offsets
|
// Register 2 TX and 2 ACK events for the same stream at 2 different offsets
|
||||||
transport->registerTxCallback(
|
transport->registerTxCallback(
|
||||||
@@ -1750,14 +1746,10 @@ TEST_P(
|
|||||||
auto stream1 = transport->createBidirectionalStream().value();
|
auto stream1 = transport->createBidirectionalStream().value();
|
||||||
auto stream2 = transport->createBidirectionalStream().value();
|
auto stream2 = transport->createBidirectionalStream().value();
|
||||||
|
|
||||||
ByteEvent txEvent1 = {
|
ByteEvent txEvent1 = ByteEvent{stream1, 10, ByteEvent::Type::TX};
|
||||||
.id = stream1, .offset = 10, .type = ByteEvent::Type::TX};
|
ByteEvent txEvent2 = ByteEvent{stream2, 20, ByteEvent::Type::TX};
|
||||||
ByteEvent txEvent2 = {
|
ByteEvent ackEvent1 = ByteEvent{stream1, 10, ByteEvent::Type::ACK};
|
||||||
.id = stream2, .offset = 20, .type = ByteEvent::Type::TX};
|
ByteEvent ackEvent2 = ByteEvent{stream2, 20, ByteEvent::Type::ACK};
|
||||||
ByteEvent ackEvent1 = {
|
|
||||||
.id = stream1, .offset = 10, .type = ByteEvent::Type::ACK};
|
|
||||||
ByteEvent ackEvent2 = {
|
|
||||||
.id = stream2, .offset = 20, .type = ByteEvent::Type::ACK};
|
|
||||||
|
|
||||||
EXPECT_THAT(byteEventCallback.getByteEventTracker(), IsEmpty());
|
EXPECT_THAT(byteEventCallback.getByteEventTracker(), IsEmpty());
|
||||||
// Register 2 TX and 2 ACK events for 2 separate streams.
|
// Register 2 TX and 2 ACK events for 2 separate streams.
|
||||||
@@ -4130,8 +4122,7 @@ class QuicTransportImplTestWithGroups : public QuicTransportImplTestBase {};
|
|||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
QuicTransportImplTestWithGroups,
|
QuicTransportImplTestWithGroups,
|
||||||
QuicTransportImplTestWithGroups,
|
QuicTransportImplTestWithGroups,
|
||||||
::testing::Values(DelayedStreamNotifsTestParam{
|
::testing::Values(DelayedStreamNotifsTestParam{true}));
|
||||||
.notifyOnNewStreamsExplicitly = true}));
|
|
||||||
|
|
||||||
TEST_P(QuicTransportImplTestWithGroups, ReadCallbackWithGroupsDataAvailable) {
|
TEST_P(QuicTransportImplTestWithGroups, ReadCallbackWithGroupsDataAvailable) {
|
||||||
auto transportSettings = transport->getTransportSettings();
|
auto transportSettings = transport->getTransportSettings();
|
||||||
|
@@ -1170,11 +1170,11 @@ TYPED_TEST(
|
|||||||
transport,
|
transport,
|
||||||
AllOf(
|
AllOf(
|
||||||
// should not be equal to an empty event
|
// should not be equal to an empty event
|
||||||
testing::Ne(SocketObserverInterface::CloseStartedEvent{
|
testing::Ne(
|
||||||
.maybeCloseReason = folly::none}),
|
SocketObserverInterface::CloseStartedEvent{folly::none}),
|
||||||
// should be equal to a populated event with default error
|
// should be equal to a populated event with default error
|
||||||
testing::Eq(SocketObserverInterface::CloseStartedEvent{
|
testing::Eq(
|
||||||
.maybeCloseReason = defaultError}))));
|
SocketObserverInterface::CloseStartedEvent{defaultError}))));
|
||||||
EXPECT_CALL(*observer, closing(transport, _));
|
EXPECT_CALL(*observer, closing(transport, _));
|
||||||
transport->close(folly::none);
|
transport->close(folly::none);
|
||||||
Mock::VerifyAndClearExpectations(observer.get());
|
Mock::VerifyAndClearExpectations(observer.get());
|
||||||
@@ -1210,11 +1210,11 @@ TYPED_TEST(
|
|||||||
transport,
|
transport,
|
||||||
AllOf(
|
AllOf(
|
||||||
// should not be equal to an empty event
|
// should not be equal to an empty event
|
||||||
testing::Ne(SocketObserverInterface::CloseStartedEvent{
|
testing::Ne(
|
||||||
.maybeCloseReason = folly::none}),
|
SocketObserverInterface::CloseStartedEvent{folly::none}),
|
||||||
// should be equal to a populated event with default error
|
// should be equal to a populated event with default error
|
||||||
testing::Eq(SocketObserverInterface::CloseStartedEvent{
|
testing::Eq(
|
||||||
.maybeCloseReason = defaultError}))));
|
SocketObserverInterface::CloseStartedEvent{defaultError}))));
|
||||||
transport->close(folly::none);
|
transport->close(folly::none);
|
||||||
|
|
||||||
// wait for the drain
|
// wait for the drain
|
||||||
@@ -1257,11 +1257,11 @@ TYPED_TEST(
|
|||||||
transport,
|
transport,
|
||||||
AllOf(
|
AllOf(
|
||||||
// should not be equal to an empty event
|
// should not be equal to an empty event
|
||||||
testing::Ne(SocketObserverInterface::CloseStartedEvent{
|
testing::Ne(
|
||||||
.maybeCloseReason = folly::none}),
|
SocketObserverInterface::CloseStartedEvent{folly::none}),
|
||||||
// should be equal to a populated event with default error
|
// should be equal to a populated event with default error
|
||||||
testing::Eq(SocketObserverInterface::CloseStartedEvent{
|
testing::Eq(
|
||||||
.maybeCloseReason = defaultError}))));
|
SocketObserverInterface::CloseStartedEvent{defaultError}))));
|
||||||
transport->close(folly::none);
|
transport->close(folly::none);
|
||||||
Mock::VerifyAndClearExpectations(observer.get());
|
Mock::VerifyAndClearExpectations(observer.get());
|
||||||
|
|
||||||
@@ -1298,11 +1298,11 @@ TYPED_TEST(
|
|||||||
transport,
|
transport,
|
||||||
AllOf(
|
AllOf(
|
||||||
// should not be equal to an empty event
|
// should not be equal to an empty event
|
||||||
testing::Ne(SocketObserverInterface::CloseStartedEvent{
|
testing::Ne(
|
||||||
.maybeCloseReason = folly::none}),
|
SocketObserverInterface::CloseStartedEvent{folly::none}),
|
||||||
// should be equal to a populated event with default error
|
// should be equal to a populated event with default error
|
||||||
testing::Eq(SocketObserverInterface::CloseStartedEvent{
|
testing::Eq(
|
||||||
.maybeCloseReason = testError}))));
|
SocketObserverInterface::CloseStartedEvent{testError}))));
|
||||||
EXPECT_CALL(*observer, closing(transport, _));
|
EXPECT_CALL(*observer, closing(transport, _));
|
||||||
transport->close(testError);
|
transport->close(testError);
|
||||||
Mock::VerifyAndClearExpectations(observer.get());
|
Mock::VerifyAndClearExpectations(observer.get());
|
||||||
@@ -1340,11 +1340,11 @@ TYPED_TEST(
|
|||||||
transport,
|
transport,
|
||||||
AllOf(
|
AllOf(
|
||||||
// should not be equal to an empty event
|
// should not be equal to an empty event
|
||||||
testing::Ne(SocketObserverInterface::CloseStartedEvent{
|
testing::Ne(
|
||||||
.maybeCloseReason = folly::none}),
|
SocketObserverInterface::CloseStartedEvent{folly::none}),
|
||||||
// should be equal to a populated event with default error
|
// should be equal to a populated event with default error
|
||||||
testing::Eq(SocketObserverInterface::CloseStartedEvent{
|
testing::Eq(
|
||||||
.maybeCloseReason = testError}))));
|
SocketObserverInterface::CloseStartedEvent{testError}))));
|
||||||
EXPECT_CALL(*observer, closing(transport, _));
|
EXPECT_CALL(*observer, closing(transport, _));
|
||||||
transport->close(testError);
|
transport->close(testError);
|
||||||
Mock::VerifyAndClearExpectations(observer.get());
|
Mock::VerifyAndClearExpectations(observer.get());
|
||||||
@@ -2056,7 +2056,8 @@ TYPED_TEST(
|
|||||||
testing::Gt(strLength)));
|
testing::Gt(strLength)));
|
||||||
EXPECT_CALL(*obs1, packetsWritten(_, _)).Times(0);
|
EXPECT_CALL(*obs1, packetsWritten(_, _)).Times(0);
|
||||||
EXPECT_CALL(*obs2, packetsWritten(transport, packetsWrittenMatcher))
|
EXPECT_CALL(*obs2, packetsWritten(transport, packetsWrittenMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2067,7 +2068,8 @@ TYPED_TEST(
|
|||||||
EXPECT_EQ(bytesWritten, event.numBytesWritten);
|
EXPECT_EQ(bytesWritten, event.numBytesWritten);
|
||||||
});
|
});
|
||||||
EXPECT_CALL(*obs3, packetsWritten(transport, packetsWrittenMatcher))
|
EXPECT_CALL(*obs3, packetsWritten(transport, packetsWrittenMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2095,7 +2097,8 @@ TYPED_TEST(
|
|||||||
|
|
||||||
EXPECT_CALL(*obs1, appRateLimited(_, _)).Times(0);
|
EXPECT_CALL(*obs1, appRateLimited(_, _)).Times(0);
|
||||||
EXPECT_CALL(*obs2, appRateLimited(transport, appRateLimitedMatcher))
|
EXPECT_CALL(*obs2, appRateLimited(transport, appRateLimitedMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2105,7 +2108,8 @@ TYPED_TEST(
|
|||||||
event.maybeWritableBytes);
|
event.maybeWritableBytes);
|
||||||
});
|
});
|
||||||
EXPECT_CALL(*obs3, appRateLimited(transport, appRateLimitedMatcher))
|
EXPECT_CALL(*obs3, appRateLimited(transport, appRateLimitedMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2233,7 +2237,8 @@ TYPED_TEST(
|
|||||||
testing::AllOf(testing::Gt(bufLength), testing::Gt(cwndInBytes))));
|
testing::AllOf(testing::Gt(bufLength), testing::Gt(cwndInBytes))));
|
||||||
EXPECT_CALL(*obs1, packetsWritten(_, _)).Times(0);
|
EXPECT_CALL(*obs1, packetsWritten(_, _)).Times(0);
|
||||||
EXPECT_CALL(*obs2, packetsWritten(transport, packetsWrittenMatcher))
|
EXPECT_CALL(*obs2, packetsWritten(transport, packetsWrittenMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2244,7 +2249,8 @@ TYPED_TEST(
|
|||||||
EXPECT_EQ(bytesWritten, event.numBytesWritten);
|
EXPECT_EQ(bytesWritten, event.numBytesWritten);
|
||||||
});
|
});
|
||||||
EXPECT_CALL(*obs3, packetsWritten(transport, packetsWrittenMatcher))
|
EXPECT_CALL(*obs3, packetsWritten(transport, packetsWrittenMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2377,7 +2383,8 @@ TYPED_TEST(
|
|||||||
testing::Ge(cwndInBytes))); // full CWND written
|
testing::Ge(cwndInBytes))); // full CWND written
|
||||||
EXPECT_CALL(*obs1, packetsWritten(_, _)).Times(0);
|
EXPECT_CALL(*obs1, packetsWritten(_, _)).Times(0);
|
||||||
EXPECT_CALL(*obs2, packetsWritten(transport, packetsWrittenMatcher))
|
EXPECT_CALL(*obs2, packetsWritten(transport, packetsWrittenMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2388,7 +2395,8 @@ TYPED_TEST(
|
|||||||
EXPECT_EQ(bytesWritten, event.numBytesWritten);
|
EXPECT_EQ(bytesWritten, event.numBytesWritten);
|
||||||
});
|
});
|
||||||
EXPECT_CALL(*obs3, packetsWritten(transport, packetsWrittenMatcher))
|
EXPECT_CALL(*obs3, packetsWritten(transport, packetsWrittenMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2444,7 +2452,8 @@ TYPED_TEST(
|
|||||||
testing::Lt(cwndInBytes)));
|
testing::Lt(cwndInBytes)));
|
||||||
EXPECT_CALL(*obs1, packetsWritten(_, _)).Times(0);
|
EXPECT_CALL(*obs1, packetsWritten(_, _)).Times(0);
|
||||||
EXPECT_CALL(*obs2, packetsWritten(transport, packetsWrittenMatcher))
|
EXPECT_CALL(*obs2, packetsWritten(transport, packetsWrittenMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2455,7 +2464,8 @@ TYPED_TEST(
|
|||||||
EXPECT_EQ(bytesWritten, event.numBytesWritten);
|
EXPECT_EQ(bytesWritten, event.numBytesWritten);
|
||||||
});
|
});
|
||||||
EXPECT_CALL(*obs3, packetsWritten(transport, packetsWrittenMatcher))
|
EXPECT_CALL(*obs3, packetsWritten(transport, packetsWrittenMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2482,7 +2492,8 @@ TYPED_TEST(
|
|||||||
testing::Lt(folly::Optional<uint64_t>(cwndInBytes))));
|
testing::Lt(folly::Optional<uint64_t>(cwndInBytes))));
|
||||||
EXPECT_CALL(*obs1, appRateLimited(_, _)).Times(0);
|
EXPECT_CALL(*obs1, appRateLimited(_, _)).Times(0);
|
||||||
EXPECT_CALL(*obs2, appRateLimited(transport, appRateLimitedMatcher))
|
EXPECT_CALL(*obs2, appRateLimited(transport, appRateLimitedMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
@@ -2492,7 +2503,8 @@ TYPED_TEST(
|
|||||||
event.maybeWritableBytes);
|
event.maybeWritableBytes);
|
||||||
});
|
});
|
||||||
EXPECT_CALL(*obs3, appRateLimited(transport, appRateLimitedMatcher))
|
EXPECT_CALL(*obs3, appRateLimited(transport, appRateLimitedMatcher))
|
||||||
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo()](
|
.WillOnce([oldTInfo = this->getTransport()->getTransportInfo(),
|
||||||
|
cwndInBytes = cwndInBytes](
|
||||||
const auto& socket, const auto& event) {
|
const auto& socket, const auto& event) {
|
||||||
const auto bytesWritten =
|
const auto bytesWritten =
|
||||||
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
socket->getTransportInfo().bytesSent - oldTInfo.bytesSent;
|
||||||
|
@@ -67,36 +67,36 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
Packet8DecodeTests,
|
Packet8DecodeTests,
|
||||||
Packet8DecodeTest,
|
Packet8DecodeTest,
|
||||||
Values(
|
Values(
|
||||||
(Packet8DecodeData){0xaa82f30e, 0x94, 0xaa82f294},
|
Packet8DecodeData{0xaa82f30e, 0x94, 0xaa82f294},
|
||||||
(Packet8DecodeData){0xaa82f3fe, 0xff, 0xaa82f3ff},
|
Packet8DecodeData{0xaa82f3fe, 0xff, 0xaa82f3ff},
|
||||||
(Packet8DecodeData){0xaa82ffff, 0x01, 0xaa830001},
|
Packet8DecodeData{0xaa82ffff, 0x01, 0xaa830001},
|
||||||
(Packet8DecodeData){0xaa82fffe, 0x01, 0xaa830001}));
|
Packet8DecodeData{0xaa82fffe, 0x01, 0xaa830001}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Packet16DecodeTests,
|
Packet16DecodeTests,
|
||||||
Packet16DecodeTest,
|
Packet16DecodeTest,
|
||||||
Values(
|
Values(
|
||||||
(Packet16DecodeData){0xaa82f30e, 0x1f94, 0xaa831f94},
|
Packet16DecodeData{0xaa82f30e, 0x1f94, 0xaa831f94},
|
||||||
(Packet16DecodeData){0x10000, 0x9000, 0x9000},
|
Packet16DecodeData{0x10000, 0x9000, 0x9000},
|
||||||
(Packet16DecodeData){0x10000, 0x8000, 0x18000},
|
Packet16DecodeData{0x10000, 0x8000, 0x18000},
|
||||||
(Packet16DecodeData){0xffff, 0x8000, 0x18000},
|
Packet16DecodeData{0xffff, 0x8000, 0x18000},
|
||||||
(Packet16DecodeData){0xf20000, 0xffff, 0xf1ffff},
|
Packet16DecodeData{0xf20000, 0xffff, 0xf1ffff},
|
||||||
(Packet16DecodeData){0x0fff00f, 0x0000, 0x1000000},
|
Packet16DecodeData{0x0fff00f, 0x0000, 0x1000000},
|
||||||
(Packet16DecodeData){0x001f, 0x010f, 0x010f},
|
Packet16DecodeData{0x001f, 0x010f, 0x010f},
|
||||||
(Packet16DecodeData){0x001f, 0x000f, 0x000f},
|
Packet16DecodeData{0x001f, 0x000f, 0x000f},
|
||||||
(Packet16DecodeData){0x0001, 0x0fff, 0x0fff},
|
Packet16DecodeData{0x0001, 0x0fff, 0x0fff},
|
||||||
(Packet16DecodeData){0x0001, 0x0002, 0x0002},
|
Packet16DecodeData{0x0001, 0x0002, 0x0002},
|
||||||
(Packet16DecodeData){0x10000, 0x0001, 0x10001},
|
Packet16DecodeData{0x10000, 0x0001, 0x10001},
|
||||||
(Packet16DecodeData){0xaa82f30e, 0x9b3, 0xaa8309b3},
|
Packet16DecodeData{0xaa82f30e, 0x9b3, 0xaa8309b3},
|
||||||
(Packet16DecodeData){0xa82f30ea, 0x9b32, 0xa82f9b32}));
|
Packet16DecodeData{0xa82f30ea, 0x9b32, 0xa82f9b32}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
Packet32DecodeTests,
|
Packet32DecodeTests,
|
||||||
Packet32DecodeTest,
|
Packet32DecodeTest,
|
||||||
Values(
|
Values(
|
||||||
(Packet32DecodeData){0xaa82f30e, 0x0094f30e, 0x10094f30e},
|
Packet32DecodeData{0xaa82f30e, 0x0094f30e, 0x10094f30e},
|
||||||
(Packet32DecodeData){0xbcaa82f30e, 0x00000000, 0xbd00000000},
|
Packet32DecodeData{0xbcaa82f30e, 0x00000000, 0xbd00000000},
|
||||||
(Packet32DecodeData){0xbcaa82f30e, 0xaa82f30f, 0xbcaa82f30f}));
|
Packet32DecodeData{0xbcaa82f30e, 0xaa82f30f, 0xbcaa82f30f}));
|
||||||
|
|
||||||
class EncodingTest : public Test {};
|
class EncodingTest : public Test {};
|
||||||
|
|
||||||
|
@@ -1422,6 +1422,7 @@ TEST_F(QLoggerTest, NonPrettyStream) {
|
|||||||
EXPECT_EQ((bool)getline(file, s), false);
|
EXPECT_EQ((bool)getline(file, s), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
TEST_F(QLoggerTest, CompressedStream) {
|
TEST_F(QLoggerTest, CompressedStream) {
|
||||||
folly::dynamic expected = folly::parseJson(expectedJsonStr1);
|
folly::dynamic expected = folly::parseJson(expectedJsonStr1);
|
||||||
|
|
||||||
@@ -1509,6 +1510,7 @@ TEST_F(QLoggerTest, CompressedNonStream) {
|
|||||||
EXPECT_EQ(expected["summary"], parsed["summary"]);
|
EXPECT_EQ(expected["summary"], parsed["summary"]);
|
||||||
EXPECT_EQ(expected["traces"], parsed["traces"]);
|
EXPECT_EQ(expected["traces"], parsed["traces"]);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_F(QLoggerTest, NoThrowOnStreamingWithNonExistentDirectory) {
|
TEST_F(QLoggerTest, NoThrowOnStreamingWithNonExistentDirectory) {
|
||||||
auto headerIn =
|
auto headerIn =
|
||||||
|
@@ -63,6 +63,17 @@ class SocketObserverInterface {
|
|||||||
friend auto operator<=>(
|
friend auto operator<=>(
|
||||||
const CloseStartedEvent&,
|
const CloseStartedEvent&,
|
||||||
const CloseStartedEvent&) = default;
|
const CloseStartedEvent&) = default;
|
||||||
|
#elif _WIN32
|
||||||
|
friend auto operator!=(
|
||||||
|
const CloseStartedEvent& right,
|
||||||
|
const CloseStartedEvent& left) {
|
||||||
|
return right.maybeCloseReason != left.maybeCloseReason;
|
||||||
|
}
|
||||||
|
friend auto operator==(
|
||||||
|
const CloseStartedEvent& right,
|
||||||
|
const CloseStartedEvent& left) {
|
||||||
|
return right.maybeCloseReason == left.maybeCloseReason;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include <quic/state/PacketEvent.h>
|
#include <quic/state/PacketEvent.h>
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <folly/portability/GTest.h>
|
||||||
|
|
||||||
namespace quic {
|
namespace quic {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
@@ -21,8 +21,8 @@ namespace quic {
|
|||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
struct StreamManagerTestParam {
|
struct StreamManagerTestParam {
|
||||||
bool notifyOnNewStreamsExplicitly;
|
bool notifyOnNewStreamsExplicitly{false};
|
||||||
bool isUnidirectional;
|
bool isUnidirectional{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
class QuicStreamManagerTest
|
class QuicStreamManagerTest
|
||||||
@@ -707,8 +707,8 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
QuicStreamManagerTest,
|
QuicStreamManagerTest,
|
||||||
QuicStreamManagerTest,
|
QuicStreamManagerTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
StreamManagerTestParam{.notifyOnNewStreamsExplicitly = false},
|
StreamManagerTestParam{false},
|
||||||
StreamManagerTestParam{.notifyOnNewStreamsExplicitly = true}));
|
StreamManagerTestParam{true}));
|
||||||
|
|
||||||
class QuicStreamManagerGroupsTest : public QuicStreamManagerTest {
|
class QuicStreamManagerGroupsTest : public QuicStreamManagerTest {
|
||||||
public:
|
public:
|
||||||
@@ -874,12 +874,8 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
QuicStreamManagerGroupsTest,
|
QuicStreamManagerGroupsTest,
|
||||||
QuicStreamManagerGroupsTest,
|
QuicStreamManagerGroupsTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
StreamManagerTestParam{
|
StreamManagerTestParam{true, false},
|
||||||
.notifyOnNewStreamsExplicitly = true,
|
StreamManagerTestParam{true, true}));
|
||||||
.isUnidirectional = false},
|
|
||||||
StreamManagerTestParam{
|
|
||||||
.notifyOnNewStreamsExplicitly = true,
|
|
||||||
.isUnidirectional = true}));
|
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace quic
|
} // namespace quic
|
||||||
|
Reference in New Issue
Block a user