aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/channel
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-10-04 21:43:12 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-10-04 21:43:12 -0700
commit9317845a97673b0283aae48471cf86eb12e80adc (patch)
treea5d84517dedf40fb0da899bad22623c4418efebe /test/core/channel
parent600124f84f21bfd0bc58d431799826911071528d (diff)
Use the right new
Diffstat (limited to 'test/core/channel')
-rw-r--r--test/core/channel/channelz_registry_test.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/core/channel/channelz_registry_test.cc b/test/core/channel/channelz_registry_test.cc
index 10a63d4d6e..7a181d018d 100644
--- a/test/core/channel/channelz_registry_test.cc
+++ b/test/core/channel/channelz_registry_test.cc
@@ -76,7 +76,7 @@ TEST_F(ChannelzRegistryTest, UuidsAreIncreasing) {
channelz_channels.reserve(10);
for (int i = 0; i < 10; ++i) {
channelz_channels.push_back(UniquePtr<BaseNode>(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel)));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel)));
}
for (size_t i = 1; i < channelz_channels.size(); ++i) {
EXPECT_LT(channelz_channels[i - 1]->uuid(), channelz_channels[i]->uuid())
@@ -86,7 +86,7 @@ TEST_F(ChannelzRegistryTest, UuidsAreIncreasing) {
TEST_F(ChannelzRegistryTest, RegisterGetTest) {
UniquePtr<BaseNode> channelz_channel(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel));
BaseNode* retrieved = ChannelzRegistry::Get(channelz_channel->uuid());
EXPECT_EQ(channelz_channel.get(), retrieved);
}
@@ -95,7 +95,7 @@ TEST_F(ChannelzRegistryTest, RegisterManyItems) {
std::vector<UniquePtr<BaseNode>> channelz_channels;
for (int i = 0; i < 100; i++) {
channelz_channels.push_back(UniquePtr<BaseNode>(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel)));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel)));
BaseNode* retrieved = ChannelzRegistry::Get(channelz_channels[i]->uuid());
EXPECT_EQ(channelz_channels[i].get(), retrieved);
}
@@ -103,7 +103,7 @@ TEST_F(ChannelzRegistryTest, RegisterManyItems) {
TEST_F(ChannelzRegistryTest, NullIfNotPresentTest) {
UniquePtr<BaseNode> channelz_channel(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel));
// try to pull out a uuid that does not exist.
BaseNode* nonexistant = ChannelzRegistry::Get(channelz_channel->uuid() + 1);
EXPECT_EQ(nonexistant, nullptr);
@@ -122,9 +122,9 @@ TEST_F(ChannelzRegistryTest, TestCompaction) {
odd_channels.reserve(kLoopIterations);
for (int i = 0; i < kLoopIterations; i++) {
even_channels.push_back(UniquePtr<BaseNode>(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel)));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel)));
odd_channels.push_back(UniquePtr<BaseNode>(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel)));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel)));
}
}
// without compaction, there would be exactly kLoopIterations empty slots at
@@ -147,9 +147,9 @@ TEST_F(ChannelzRegistryTest, TestGetAfterCompaction) {
odd_channels.reserve(kLoopIterations);
for (int i = 0; i < kLoopIterations; i++) {
even_channels.push_back(UniquePtr<BaseNode>(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel)));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel)));
odd_channels.push_back(UniquePtr<BaseNode>(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel)));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel)));
odd_uuids.push_back(odd_channels[i]->uuid());
}
}
@@ -174,9 +174,9 @@ TEST_F(ChannelzRegistryTest, TestAddAfterCompaction) {
odd_channels.reserve(kLoopIterations);
for (int i = 0; i < kLoopIterations; i++) {
even_channels.push_back(UniquePtr<BaseNode>(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel)));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel)));
odd_channels.push_back(UniquePtr<BaseNode>(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel)));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel)));
odd_uuids.push_back(odd_channels[i]->uuid());
}
}
@@ -184,7 +184,7 @@ TEST_F(ChannelzRegistryTest, TestAddAfterCompaction) {
more_channels.reserve(kLoopIterations);
for (int i = 0; i < kLoopIterations; i++) {
more_channels.push_back(UniquePtr<BaseNode>(
- new BaseNode(BaseNode::EntityType::kTopLevelChannel)));
+ New<BaseNode>(BaseNode::EntityType::kTopLevelChannel)));
BaseNode* retrieved = ChannelzRegistry::Get(more_channels[i]->uuid());
EXPECT_EQ(more_channels[i].get(), retrieved);
}