fix clang_tidy

pull/16159/head
Mark D. Roth 7 years ago
parent 326f82e5e2
commit 3abd620134
  1. 12
      test/core/gprpp/ref_counted_ptr_test.cc

@ -185,10 +185,6 @@ class Subclass : public BaseClass {
Subclass() {} Subclass() {}
}; };
void FunctionTakingBaseClass(RefCountedPtr<BaseClass> p) {}
void FunctionTakingSubclass(RefCountedPtr<Subclass> p) {}
TEST(RefCountedPtr, ConstructFromSubclass) { TEST(RefCountedPtr, ConstructFromSubclass) {
RefCountedPtr<BaseClass> p(New<Subclass>()); RefCountedPtr<BaseClass> p(New<Subclass>());
} }
@ -222,11 +218,19 @@ TEST(RefCountedPtr, EqualityWithSubclass) {
EXPECT_EQ(b, s); EXPECT_EQ(b, s);
} }
void FunctionTakingBaseClass(RefCountedPtr<BaseClass> p) {
p.reset(); // To appease clang-tidy.
}
TEST(RefCountedPtr, CanPassSubclassToFunctionExpectingBaseClass) { TEST(RefCountedPtr, CanPassSubclassToFunctionExpectingBaseClass) {
RefCountedPtr<Subclass> p = MakeRefCounted<Subclass>(); RefCountedPtr<Subclass> p = MakeRefCounted<Subclass>();
FunctionTakingBaseClass(p); FunctionTakingBaseClass(p);
} }
void FunctionTakingSubclass(RefCountedPtr<Subclass> p) {
p.reset(); // To appease clang-tidy.
}
TEST(RefCountedPtr, CanPassSubclassToFunctionExpectingSubclass) { TEST(RefCountedPtr, CanPassSubclassToFunctionExpectingSubclass) {
RefCountedPtr<Subclass> p = MakeRefCounted<Subclass>(); RefCountedPtr<Subclass> p = MakeRefCounted<Subclass>();
FunctionTakingSubclass(p); FunctionTakingSubclass(p);

Loading…
Cancel
Save