1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-06 22:22:38 +03:00

Remove unused variables in quic/api/test/QuicTransportFunctionsTest.cpp

Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: luciang

Differential Revision: D42465115

fbshipit-source-id: 0379c82451b1902c185bc3b083c7ee68264b8977
This commit is contained in:
Richard Barnes
2023-01-11 16:48:34 -08:00
committed by Facebook GitHub Bot
parent 8467525a56
commit 182b8c0ea0

View File

@@ -1002,9 +1002,6 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionPureAckCounter) {
EXPECT_EQ(0, conn->outstandings.packetCount[PacketNumberSpace::Handshake]);
auto packet = buildEmptyPacket(*conn, PacketNumberSpace::Handshake);
auto packetEncodedSize =
packet.header ? packet.header->computeChainDataLength() : 0;
packetEncodedSize += packet.body ? packet.body->computeChainDataLength() : 0;
WriteAckFrame ackFrame;
ackFrame.ackBlocks.emplace_back(0, 100);
@@ -1019,10 +1016,6 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionPureAckCounter) {
false /* isDSRPacket */);
auto nonHandshake = buildEmptyPacket(*conn, PacketNumberSpace::Handshake);
packetEncodedSize =
nonHandshake.header ? nonHandshake.header->computeChainDataLength() : 0;
packetEncodedSize +=
nonHandshake.body ? nonHandshake.body->computeChainDataLength() : 0;
auto stream1 = conn->streamManager->createNextBidirectionalStream().value();
writeDataToQuicStream(*stream1, nullptr, true);
@@ -1060,9 +1053,6 @@ TEST_F(QuicTransportFunctionsTest, TestPaddingPureAckPacketIsStillPureAck) {
auto conn = createConn();
conn->qLogger = std::make_shared<quic::FileQLogger>(VantagePoint::Client);
auto packet = buildEmptyPacket(*conn, PacketNumberSpace::Handshake);
auto packetEncodedSize =
packet.header ? packet.header->computeChainDataLength() : 0;
packetEncodedSize += packet.body ? packet.body->computeChainDataLength() : 0;
WriteAckFrame ackFrame;
ackFrame.ackBlocks.emplace_back(0, 100);
@@ -1302,9 +1292,6 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionForOneRttCryptoData) {
// Packet with CryptoFrame in AppData pn space
auto packet = buildEmptyPacket(*conn, PacketNumberSpace::AppData, true);
auto packetEncodedSize =
packet.header ? packet.header->computeChainDataLength() : 0;
packetEncodedSize += packet.body ? packet.body->computeChainDataLength() : 0;
packet.packet.frames.push_back(WriteCryptoFrame(0, 0));
updateConnection(
@@ -1320,10 +1307,6 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionForOneRttCryptoData) {
EXPECT_EQ(1, conn->outstandings.packets.size());
auto nonHandshake = buildEmptyPacket(*conn, PacketNumberSpace::AppData);
packetEncodedSize =
nonHandshake.header ? nonHandshake.header->computeChainDataLength() : 0;
packetEncodedSize +=
nonHandshake.body ? nonHandshake.body->computeChainDataLength() : 0;
auto stream1 = conn->streamManager->createNextBidirectionalStream().value();
writeDataToQuicStream(*stream1, nullptr, true);