aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/RefCntTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@google.com>2014-07-09 09:04:07 -0400
committerGravatar Mike Klein <mtklein@google.com>2014-07-09 09:04:07 -0400
commit874a62acef5ec2ecccdbb99ec4d86402a3341e6a (patch)
tree984dbc899480cb2dcaa578c08594266f2f9500cb /tests/RefCntTest.cpp
parent0b544ae222aab1c5d9122a8dfe2800451b31d979 (diff)
Revert "Remove ability for Release code to call getRefCnt() or getWeakRefCnt()."
Diffstat (limited to 'tests/RefCntTest.cpp')
-rw-r--r--tests/RefCntTest.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/RefCntTest.cpp b/tests/RefCntTest.cpp
index 5f2cbe466f..bd4f348fba 100644
--- a/tests/RefCntTest.cpp
+++ b/tests/RefCntTest.cpp
@@ -10,7 +10,6 @@
#include "SkThreadUtils.h"
#include "SkTypes.h"
#include "SkWeakRefCnt.h"
-#include "RefCntIs.h"
#include "Test.h"
class InstCounterClass {
@@ -34,7 +33,7 @@ static void test_refarray(skiatest::Reporter* reporter) {
const int N = 10;
SkTRefArray<InstCounterClass>* array = SkTRefArray<InstCounterClass>::Create(N);
- REPORTER_ASSERT(reporter, RefCntIs(*array, 1));
+ REPORTER_ASSERT(reporter, 1 == array->getRefCnt());
REPORTER_ASSERT(reporter, N == array->count());
REPORTER_ASSERT(reporter, N == InstCounterClass::gInstCounter);
@@ -51,7 +50,7 @@ static void test_refarray(skiatest::Reporter* reporter) {
}
array = SkTRefArray<InstCounterClass>::Create(src, N);
- REPORTER_ASSERT(reporter, RefCntIs(*array, 1));
+ REPORTER_ASSERT(reporter, 1 == array->getRefCnt());
REPORTER_ASSERT(reporter, N == array->count());
REPORTER_ASSERT(reporter, 2*N == InstCounterClass::gInstCounter);
@@ -92,7 +91,7 @@ static void test_refCnt(skiatest::Reporter* reporter) {
thing1.join();
thing2.join();
- REPORTER_ASSERT(reporter, RefCntIs(*ref, 1));
+ REPORTER_ASSERT(reporter, ref->getRefCnt() == 1);
ref->unref();
}
@@ -136,8 +135,8 @@ static void test_weakRefCnt(skiatest::Reporter* reporter) {
thing3.join();
thing4.join();
- REPORTER_ASSERT(reporter, RefCntIs(*ref, 1));
- REPORTER_ASSERT(reporter, WeakRefCntIs(*ref, 1));
+ REPORTER_ASSERT(reporter, ref->getRefCnt() == 1);
+ REPORTER_ASSERT(reporter, ref->getWeakCnt() == 1);
ref->unref();
}