Skip to content

Commit

Permalink
added unique pointer for connection (#4718)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav2699 authored and ami-GS committed Jan 8, 2025
1 parent 622a725 commit cf3e7c3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/test/lib/DataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3627,9 +3627,9 @@ 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 @@ -3810,10 +3810,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 cf3e7c3

Please sign in to comment.