Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: tests/RefDictTest.cpp

Issue 752263002: make SkRefCnt::getRefCnt() debug-only, remove it from SkNVRefCnt. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: typos Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/RefCntTest.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RefDictTest.cpp
diff --git a/tests/RefDictTest.cpp b/tests/RefDictTest.cpp
index 1e18a6815d0b1ac6047205c61f4b9af75ca97075..23e4b114a5359be6a94538f92cb69295b163b84d 100644
--- a/tests/RefDictTest.cpp
+++ b/tests/RefDictTest.cpp
@@ -25,50 +25,50 @@ DEF_TEST(RefDict, reporter) {
dict.set("foo", &data0);
REPORTER_ASSERT(reporter, &data0 == dict.find("foo"));
- REPORTER_ASSERT(reporter, 2 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, !data0.unique());
dict.set("foo", &data0);
REPORTER_ASSERT(reporter, &data0 == dict.find("foo"));
- REPORTER_ASSERT(reporter, 2 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, !data0.unique());
dict.set("foo", &data1);
REPORTER_ASSERT(reporter, &data1 == dict.find("foo"));
- REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
- REPORTER_ASSERT(reporter, 2 == data1.getRefCnt());
+ REPORTER_ASSERT(reporter, data0.unique());
+ REPORTER_ASSERT(reporter, !data1.unique());
dict.set("foo", NULL);
REPORTER_ASSERT(reporter, NULL == dict.find("foo"));
- REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
- REPORTER_ASSERT(reporter, 1 == data1.getRefCnt());
+ REPORTER_ASSERT(reporter, data0.unique());
+ REPORTER_ASSERT(reporter, data1.unique());
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, 2 == data0.getRefCnt());
- REPORTER_ASSERT(reporter, 2 == data1.getRefCnt());
+ REPORTER_ASSERT(reporter, !data0.unique());
+ REPORTER_ASSERT(reporter, !data1.unique());
dict.set("foo", &data1);
REPORTER_ASSERT(reporter, &data1 == dict.find("foo"));
REPORTER_ASSERT(reporter, &data1 == dict.find("bar"));
- REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
- REPORTER_ASSERT(reporter, 3 == data1.getRefCnt());
+ REPORTER_ASSERT(reporter, data0.unique());
+ REPORTER_ASSERT(reporter, !data1.unique());
dict.removeAll();
REPORTER_ASSERT(reporter, NULL == dict.find("foo"));
REPORTER_ASSERT(reporter, NULL == dict.find("bar"));
- REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
- REPORTER_ASSERT(reporter, 1 == data1.getRefCnt());
+ REPORTER_ASSERT(reporter, data0.unique());
+ REPORTER_ASSERT(reporter, data1.unique());
{
SkRefDict d;
REPORTER_ASSERT(reporter, NULL == d.find("foo"));
- REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, data0.unique());
d.set("foo", &data0);
REPORTER_ASSERT(reporter, &data0 == d.find("foo"));
- REPORTER_ASSERT(reporter, 2 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, !data0.unique());
// 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, 1 == data0.getRefCnt());
+ REPORTER_ASSERT(reporter, data0.unique());
}
« no previous file with comments | « tests/RefCntTest.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698