24 #include <gtest/gtest.h>
51 return MakeRefCounted<ListenSocketNode>(
"test",
"test");
56 intptr_t uuid = channelz_channel->uuid();
57 EXPECT_GT(uuid, 0) <<
"First uuid chose must be greater than zero. Zero if "
58 "reserved according to "
59 "https://github.com/grpc/proposal/blob/master/"
64 std::vector<RefCountedPtr<BaseNode>> channelz_channels;
65 channelz_channels.reserve(10);
66 for (
int i = 0;
i < 10; ++
i) {
69 for (
size_t i = 1;
i < channelz_channels.size(); ++
i) {
70 EXPECT_LT(channelz_channels[
i - 1]->uuid(), channelz_channels[
i]->uuid())
71 <<
"Uuids must always be increasing";
83 std::vector<RefCountedPtr<BaseNode>> channelz_channels;
84 for (
int i = 0;
i < 100;
i++) {
104 const int kLoopIterations = 100;
106 std::vector<RefCountedPtr<BaseNode>> even_channels;
107 even_channels.reserve(kLoopIterations);
108 std::vector<intptr_t> odd_uuids;
109 odd_uuids.reserve(kLoopIterations);
112 std::vector<RefCountedPtr<BaseNode>> odd_channels;
113 odd_channels.reserve(kLoopIterations);
114 for (
int i = 0;
i < kLoopIterations;
i++) {
117 odd_uuids.push_back(odd_channels[
i]->uuid());
121 for (
int i = 0;
i < kLoopIterations;
i++) {
130 std::vector<RefCountedPtr<BaseNode>> more_channels;
131 more_channels.reserve(kLoopIterations);
132 for (
int i = 0;
i < kLoopIterations;
i++) {
144 int main(
int argc,
char** argv) {