Revert "Remove ability for Release code to call getRefCnt() or getWeakRefCnt()."
This reverts commit 4ae94ffce5ecf1b71cb5e295b68bf4ec9e697443.
BUG=skia:
Review URL: https://codereview.chromium.org/382523002
diff --git a/tests/RefDictTest.cpp b/tests/RefDictTest.cpp
index 5b9987e..1e18a68 100644
--- a/tests/RefDictTest.cpp
+++ b/tests/RefDictTest.cpp
@@ -6,7 +6,6 @@
*/
#include "SkRefDict.h"
-#include "RefCntIs.h"
#include "Test.h"
class TestRC : public SkRefCnt {
@@ -26,50 +25,50 @@
dict.set("foo", &data0);
REPORTER_ASSERT(reporter, &data0 == dict.find("foo"));
- REPORTER_ASSERT(reporter, RefCntIs(data0, 2));
+ REPORTER_ASSERT(reporter, 2 == data0.getRefCnt());
dict.set("foo", &data0);
REPORTER_ASSERT(reporter, &data0 == dict.find("foo"));
- REPORTER_ASSERT(reporter, RefCntIs(data0, 2));
+ REPORTER_ASSERT(reporter, 2 == data0.getRefCnt());
dict.set("foo", &data1);
REPORTER_ASSERT(reporter, &data1 == dict.find("foo"));
- REPORTER_ASSERT(reporter, RefCntIs(data0, 1));
- REPORTER_ASSERT(reporter, RefCntIs(data1, 2));
+ REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, 2 == data1.getRefCnt());
dict.set("foo", NULL);
REPORTER_ASSERT(reporter, NULL == dict.find("foo"));
- REPORTER_ASSERT(reporter, RefCntIs(data0, 1));
- REPORTER_ASSERT(reporter, RefCntIs(data1, 1));
+ REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, 1 == data1.getRefCnt());
dict.set("foo", &data0);
dict.set("bar", &data1);
REPORTER_ASSERT(reporter, &data0 == dict.find("foo"));
REPORTER_ASSERT(reporter, &data1 == dict.find("bar"));
- REPORTER_ASSERT(reporter, RefCntIs(data0, 2));
- REPORTER_ASSERT(reporter, RefCntIs(data1, 2));
+ REPORTER_ASSERT(reporter, 2 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, 2 == data1.getRefCnt());
dict.set("foo", &data1);
REPORTER_ASSERT(reporter, &data1 == dict.find("foo"));
REPORTER_ASSERT(reporter, &data1 == dict.find("bar"));
- REPORTER_ASSERT(reporter, RefCntIs(data0, 1));
- REPORTER_ASSERT(reporter, RefCntIs(data1, 3));
+ REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, 3 == data1.getRefCnt());
dict.removeAll();
REPORTER_ASSERT(reporter, NULL == dict.find("foo"));
REPORTER_ASSERT(reporter, NULL == dict.find("bar"));
- REPORTER_ASSERT(reporter, RefCntIs(data0, 1));
- REPORTER_ASSERT(reporter, RefCntIs(data1, 1));
+ REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, 1 == data1.getRefCnt());
{
SkRefDict d;
REPORTER_ASSERT(reporter, NULL == d.find("foo"));
- REPORTER_ASSERT(reporter, RefCntIs(data0, 1));
+ REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
d.set("foo", &data0);
REPORTER_ASSERT(reporter, &data0 == d.find("foo"));
- REPORTER_ASSERT(reporter, RefCntIs(data0, 2));
+ REPORTER_ASSERT(reporter, 2 == data0.getRefCnt());
// let d go out of scope still with a ref on data0
}
// be sure d's destructor lowered data0's owner count back to 1
- REPORTER_ASSERT(reporter, RefCntIs(data0, 1));
+ REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
}