aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/gprpp/ref_counted_ptr_test.cc
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2018-02-06 07:58:17 -0800
committerGravatar Mark D. Roth <roth@google.com>2018-02-06 07:58:17 -0800
commit08d9f3df3038a88d7ae69aa9e65da29e296946d2 (patch)
treed5c58f8a6f5ec4ee33283815821cafd854a24bf7 /test/core/gprpp/ref_counted_ptr_test.cc
parent007f1197ac6376cd6a77dca141966ba3aceec9aa (diff)
Change Ref() methods to return a RefCountedPtr<>.
Diffstat (limited to 'test/core/gprpp/ref_counted_ptr_test.cc')
-rw-r--r--test/core/gprpp/ref_counted_ptr_test.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/core/gprpp/ref_counted_ptr_test.cc b/test/core/gprpp/ref_counted_ptr_test.cc
index f1f13f3183..2e398a7722 100644
--- a/test/core/gprpp/ref_counted_ptr_test.cc
+++ b/test/core/gprpp/ref_counted_ptr_test.cc
@@ -30,7 +30,7 @@ namespace grpc_core {
namespace testing {
namespace {
-class Foo : public RefCounted {
+class Foo : public RefCounted<Foo> {
public:
Foo() : value_(0) {}
@@ -163,14 +163,15 @@ TEST(MakeRefCounted, Args) {
TraceFlag foo_tracer(true, "foo");
-class FooWithTracing : public RefCountedWithTracing {
+class FooWithTracing : public RefCountedWithTracing<FooWithTracing> {
public:
FooWithTracing() : RefCountedWithTracing(&foo_tracer) {}
};
TEST(RefCountedPtr, RefCountedWithTracing) {
RefCountedPtr<FooWithTracing> foo(New<FooWithTracing>());
- foo->Ref(DEBUG_LOCATION, "foo");
+ RefCountedPtr<FooWithTracing> foo2 = foo->Ref(DEBUG_LOCATION, "foo");
+ foo2.release();
foo->Unref(DEBUG_LOCATION, "foo");
}