Skip to content

Commit

Permalink
added unique pointer for connection
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav2699 committed Dec 19, 2024
1 parent a03d5c2 commit 677938a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/test/lib/DataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3627,9 +3627,10 @@ void QuicTestConnectionPriority()
const uint8_t NumConnections = 8;

{
MsQuicConnection *Connections[NumConnections] = {0};
UniquePtr<MsQuicConnection> Connections[NumConnections];

for (uint8_t i = 0; i < NumConnections; ++i) {
Connections[i] = new(std::nothrow) MsQuicConnection(Registration);
Connections[i].reset(new(std::nothrow) MsQuicConnection(Registration));
TEST_QUIC_SUCCEEDED(Connections[i]->GetInitStatus());
TEST_QUIC_SUCCEEDED(Connections[i]->Start(ClientConfiguration, ServerLocalAddr.GetFamily(), QUIC_TEST_LOOPBACK_FOR_AF(ServerLocalAddr.GetFamily()), ServerLocalAddr.GetPort()));
TEST_TRUE(Connections[i]->HandshakeCompleteEvent.WaitTimeout(TestWaitTimeout));
Expand Down Expand Up @@ -3824,10 +3825,6 @@ void QuicTestConnectionPriority()
TEST_TRUE(memcmp(Context.StartOrder, ExpectedStartOrder, sizeof(ExpectedStartOrder)) == 0);
TEST_TRUE(memcmp(Context.SendOrder, ExpectedSendOrder, sizeof(ExpectedSendOrder)) == 0);
}

for (uint8_t i = 0; i < NumConnections; ++i) {
delete Connections[i];
}
}
}

Expand Down

0 comments on commit 677938a

Please sign in to comment.