From 9317845a97673b0283aae48471cf86eb12e80adc Mon Sep 17 00:00:00 2001 From: ncteisen Date: Thu, 4 Oct 2018 21:43:12 -0700 Subject: Use the right new --- test/core/channel/channelz_registry_test.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'test/core/channel') 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( - new BaseNode(BaseNode::EntityType::kTopLevelChannel))); + New(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 channelz_channel( - new BaseNode(BaseNode::EntityType::kTopLevelChannel)); + New(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> channelz_channels; for (int i = 0; i < 100; i++) { channelz_channels.push_back(UniquePtr( - new BaseNode(BaseNode::EntityType::kTopLevelChannel))); + New(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 channelz_channel( - new BaseNode(BaseNode::EntityType::kTopLevelChannel)); + New(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( - new BaseNode(BaseNode::EntityType::kTopLevelChannel))); + New(BaseNode::EntityType::kTopLevelChannel))); odd_channels.push_back(UniquePtr( - new BaseNode(BaseNode::EntityType::kTopLevelChannel))); + New(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( - new BaseNode(BaseNode::EntityType::kTopLevelChannel))); + New(BaseNode::EntityType::kTopLevelChannel))); odd_channels.push_back(UniquePtr( - new BaseNode(BaseNode::EntityType::kTopLevelChannel))); + New(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( - new BaseNode(BaseNode::EntityType::kTopLevelChannel))); + New(BaseNode::EntityType::kTopLevelChannel))); odd_channels.push_back(UniquePtr( - new BaseNode(BaseNode::EntityType::kTopLevelChannel))); + New(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( - new BaseNode(BaseNode::EntityType::kTopLevelChannel))); + New(BaseNode::EntityType::kTopLevelChannel))); BaseNode* retrieved = ChannelzRegistry::Get(more_channels[i]->uuid()); EXPECT_EQ(more_channels[i].get(), retrieved); } -- cgit v1.2.3