Index: tests/RefCntTest.cpp |
diff --git a/tests/RefCntTest.cpp b/tests/RefCntTest.cpp |
index 2932913c3da418ac60d5f5aa5ffddcd90bf2de2d..a9b461f352584b66b17421da3e40ec4be446dc78 100644 |
--- a/tests/RefCntTest.cpp |
+++ b/tests/RefCntTest.cpp |
@@ -385,3 +385,16 @@ DEF_TEST(sk_sp_reset, r) { |
sp.reset(rc); // this should transfer our ownership over to sp |
REPORTER_ASSERT(r, rc->unique()); |
} |
+ |
+DEF_TEST(sk_sp_ref, r) { |
+ SkRefCnt* rc = new SkRefCnt; |
+ REPORTER_ASSERT(r, rc->unique()); |
+ |
+ { |
+ sk_sp<SkRefCnt> sp = sk_ref_sp(rc); |
+ REPORTER_ASSERT(r, !rc->unique()); |
+ } |
+ |
+ REPORTER_ASSERT(r, rc->unique()); |
+ rc->unref(); |
+} |