Skip to content

Commit

Permalink
Update PathProbeHelper instantiation to use std::nothrow and fix QUIC…
Browse files Browse the repository at this point in the history
…_MAX_IOCTL_FUNC_CODE
  • Loading branch information
masa-koz committed Jan 18, 2025
1 parent 6d53d03 commit 5730945
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/test/MsQuicTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -1390,4 +1390,4 @@ typedef struct {
QUIC_CTL_CODE(128, METHOD_BUFFERED, FILE_WRITE_DATA)
// QUIC_RUN_MIGRATION

#define QUIC_MAX_IOCTL_FUNC_CODE 129
#define QUIC_MAX_IOCTL_FUNC_CODE 128
8 changes: 4 additions & 4 deletions src/test/lib/PathTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ QuicTestProbePath(
TEST_QUIC_SUCCEEDED(Connection.GetLocalAddr(SecondLocalAddr));
SecondLocalAddr.IncrementPort();

PathProbeHelper *ProbeHelper = new PathProbeHelper(SecondLocalAddr.GetPort(), DropPacketCount, DropPacketCount);
PathProbeHelper *ProbeHelper = new(std::nothrow) PathProbeHelper(SecondLocalAddr.GetPort(), DropPacketCount, DropPacketCount);

QUIC_STATUS Status = QUIC_STATUS_SUCCESS;
uint32_t Try = 0;
Expand All @@ -186,7 +186,7 @@ QuicTestProbePath(
if (Status != QUIC_STATUS_SUCCESS) {
delete ProbeHelper;
SecondLocalAddr.IncrementPort();
ProbeHelper = new PathProbeHelper(SecondLocalAddr.GetPort(), DropPacketCount, DropPacketCount);
ProbeHelper = new(std::nothrow) PathProbeHelper(SecondLocalAddr.GetPort(), DropPacketCount, DropPacketCount);
}
} while (Status == QUIC_STATUS_ADDRESS_IN_USE && ++Try <= 3);
TEST_EQUAL(Status, QUIC_STATUS_SUCCESS);
Expand Down Expand Up @@ -256,7 +256,7 @@ QuicTestMigration(
TEST_QUIC_SUCCEEDED(Connection.GetLocalAddr(SecondLocalAddr));
SecondLocalAddr.IncrementPort();

PathProbeHelper* ProbeHelper = new PathProbeHelper(SecondLocalAddr.GetPort());
PathProbeHelper* ProbeHelper = new(std::nothrow) PathProbeHelper(SecondLocalAddr.GetPort());

if (Type == MigrateWithProbe || Type == DeleteAndMigrate) {
QUIC_STATUS Status = QUIC_STATUS_SUCCESS;
Expand All @@ -270,7 +270,7 @@ QuicTestMigration(
if (Status != QUIC_STATUS_SUCCESS) {
delete ProbeHelper;
SecondLocalAddr.IncrementPort();
ProbeHelper = new PathProbeHelper(SecondLocalAddr.GetPort());
ProbeHelper = new(std::nothrow) PathProbeHelper(SecondLocalAddr.GetPort());
}
} while (Status == QUIC_STATUS_ADDRESS_IN_USE && ++Try <= 3);
TEST_QUIC_SUCCEEDED(Status);
Expand Down

0 comments on commit 5730945

Please sign in to comment.