aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2018-06-07 22:17:14 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-06-14 14:58:09 -0400
commit58e0cbf9fb67186ee67be5bb71aba36e9cfebe7f (patch)
tree36a6e9fc3beb37ab4030d50375bebf7e6673c1a1 /test/core
parent33b77eee7890b7e8a00b256eb501d476feae09db (diff)
Enable the performance-* clang-tidy checks
Diffstat (limited to 'test/core')
-rw-r--r--test/core/channel/channel_trace_test.cc7
-rw-r--r--test/core/channel/channelz_registry_test.cc1
-rw-r--r--test/core/gprpp/ref_counted_ptr_test.cc4
3 files changed, 7 insertions, 5 deletions
diff --git a/test/core/channel/channel_trace_test.cc b/test/core/channel/channel_trace_test.cc
index 64de05bc0a..d99a32d91d 100644
--- a/test/core/channel/channel_trace_test.cc
+++ b/test/core/channel/channel_trace_test.cc
@@ -77,13 +77,13 @@ void ValidateChannelTraceData(grpc_json* json,
ValidateJsonArraySize(json, "events", actual_num_events_expected);
}
-void AddSimpleTrace(RefCountedPtr<ChannelTrace> tracer) {
+void AddSimpleTrace(const RefCountedPtr<ChannelTrace>& tracer) {
tracer->AddTraceEvent(ChannelTrace::Severity::Info,
grpc_slice_from_static_string("simple trace"));
}
// checks for the existence of all the required members of the tracer.
-void ValidateChannelTrace(RefCountedPtr<ChannelTrace> tracer,
+void ValidateChannelTrace(const RefCountedPtr<ChannelTrace>& tracer,
size_t expected_num_event_logged, size_t max_nodes) {
if (!max_nodes) return;
char* json_str = tracer->RenderTrace();
@@ -95,7 +95,8 @@ void ValidateChannelTrace(RefCountedPtr<ChannelTrace> tracer,
gpr_free(json_str);
}
-void ValidateTraceDataMatchedUuidLookup(RefCountedPtr<ChannelTrace> tracer) {
+void ValidateTraceDataMatchedUuidLookup(
+ const RefCountedPtr<ChannelTrace>& tracer) {
intptr_t uuid = tracer->GetUuid();
if (uuid == -1) return; // Doesn't make sense to lookup if tracing disabled
char* tracer_json_str = tracer->RenderTrace();
diff --git a/test/core/channel/channelz_registry_test.cc b/test/core/channel/channelz_registry_test.cc
index 37696dc0e8..eb6305eb4e 100644
--- a/test/core/channel/channelz_registry_test.cc
+++ b/test/core/channel/channelz_registry_test.cc
@@ -54,6 +54,7 @@ TEST(ChannelzRegistryTest, UuidStartsAboveZeroTest) {
TEST(ChannelzRegistryTest, UuidsAreIncreasing) {
int object_to_register;
std::vector<intptr_t> uuids;
+ uuids.reserve(10);
for (int i = 0; i < 10; ++i) {
// reregister the same object. It's ok since we are just testing uuids
uuids.push_back(ChannelzRegistry::Register(&object_to_register));
diff --git a/test/core/gprpp/ref_counted_ptr_test.cc b/test/core/gprpp/ref_counted_ptr_test.cc
index c810345166..aa30b72282 100644
--- a/test/core/gprpp/ref_counted_ptr_test.cc
+++ b/test/core/gprpp/ref_counted_ptr_test.cc
@@ -66,14 +66,14 @@ TEST(RefCountedPtr, MoveAssignment) {
TEST(RefCountedPtr, CopyConstructor) {
RefCountedPtr<Foo> foo(New<Foo>());
- RefCountedPtr<Foo> foo2(foo);
+ const RefCountedPtr<Foo>& foo2(foo);
EXPECT_NE(nullptr, foo.get());
EXPECT_EQ(foo.get(), foo2.get());
}
TEST(RefCountedPtr, CopyAssignment) {
RefCountedPtr<Foo> foo(New<Foo>());
- RefCountedPtr<Foo> foo2 = foo;
+ const RefCountedPtr<Foo>& foo2 = foo;
EXPECT_NE(nullptr, foo.get());
EXPECT_EQ(foo.get(), foo2.get());
}