Use intptr_ts for channel registry test
diff --git a/test/core/channel/channelz_registry_test.cc b/test/core/channel/channelz_registry_test.cc
index 990cd3d..581e867 100644
--- a/test/core/channel/channelz_registry_test.cc
+++ b/test/core/channel/channelz_registry_test.cc
@@ -67,14 +67,16 @@
}
TEST(ChannelzRegistryTest, RegisterGetTest) {
- ChannelNode* channelz_channel = nullptr;
+ // we hackily jam an intptr_t into this pointer to check for equality later
+ ChannelNode* channelz_channel = (ChannelNode*)42;
intptr_t uuid = ChannelzRegistry::RegisterChannelNode(channelz_channel);
ChannelNode* retrieved = ChannelzRegistry::GetChannelNode(uuid);
EXPECT_EQ(channelz_channel, retrieved);
}
TEST(ChannelzRegistryTest, RegisterManyItems) {
- ChannelNode* channelz_channel = nullptr;
+ // we hackily jam an intptr_t into this pointer to check for equality later
+ ChannelNode* channelz_channel = (ChannelNode*)42;
for (int i = 0; i < 100; i++) {
intptr_t uuid = ChannelzRegistry::RegisterChannelNode(channelz_channel);
ChannelNode* retrieved = ChannelzRegistry::GetChannelNode(uuid);
@@ -83,7 +85,8 @@
}
TEST(ChannelzRegistryTest, NullIfNotPresentTest) {
- ChannelNode* channelz_channel = nullptr;
+ // we hackily jam an intptr_t into this pointer to check for equality later
+ ChannelNode* channelz_channel = (ChannelNode*)42;
intptr_t uuid = ChannelzRegistry::RegisterChannelNode(channelz_channel);
// try to pull out a uuid that does not exist.
ChannelNode* nonexistant = ChannelzRegistry::GetChannelNode(uuid + 1);