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

Unified Diff: tests/RefCntTest.cpp

Issue 719113004: Followup: remove unnecessary SkTRefArray (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: count 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 | « src/core/SkTRefArray.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RefCntTest.cpp
diff --git a/tests/RefCntTest.cpp b/tests/RefCntTest.cpp
index bd4f348fba8e84e20266e417c37f4955f547b280..cf6ca3e0f268f5fea6aa7bd07fe53c75458216c5 100644
--- a/tests/RefCntTest.cpp
+++ b/tests/RefCntTest.cpp
@@ -6,7 +6,6 @@
*/
#include "SkRefCnt.h"
-#include "SkTRefArray.h"
#include "SkThreadUtils.h"
#include "SkTypes.h"
#include "SkWeakRefCnt.h"
@@ -27,47 +26,6 @@ public:
int InstCounterClass::gInstCounter;
-static void test_refarray(skiatest::Reporter* reporter) {
- REPORTER_ASSERT(reporter, 0 == InstCounterClass::gInstCounter);
-
- const int N = 10;
- SkTRefArray<InstCounterClass>* array = SkTRefArray<InstCounterClass>::Create(N);
-
- REPORTER_ASSERT(reporter, 1 == array->getRefCnt());
- REPORTER_ASSERT(reporter, N == array->count());
-
- REPORTER_ASSERT(reporter, N == InstCounterClass::gInstCounter);
- array->unref();
- REPORTER_ASSERT(reporter, 0 == InstCounterClass::gInstCounter);
-
- // Now test the copy factory
-
- int i;
- InstCounterClass* src = new InstCounterClass[N];
- REPORTER_ASSERT(reporter, N == InstCounterClass::gInstCounter);
- for (i = 0; i < N; ++i) {
- REPORTER_ASSERT(reporter, i == src[i].fCount);
- }
-
- array = SkTRefArray<InstCounterClass>::Create(src, N);
- REPORTER_ASSERT(reporter, 1 == array->getRefCnt());
- REPORTER_ASSERT(reporter, N == array->count());
-
- REPORTER_ASSERT(reporter, 2*N == InstCounterClass::gInstCounter);
- for (i = 0; i < N; ++i) {
- REPORTER_ASSERT(reporter, i == (*array)[i].fCount);
- }
-
- delete[] src;
- REPORTER_ASSERT(reporter, N == InstCounterClass::gInstCounter);
-
- for (i = 0; i < N; ++i) {
- REPORTER_ASSERT(reporter, i == (*array)[i].fCount);
- }
- array->unref();
- REPORTER_ASSERT(reporter, 0 == InstCounterClass::gInstCounter);
-}
-
static void bounce_ref(void* data) {
SkRefCnt* ref = static_cast<SkRefCnt*>(data);
for (int i = 0; i < 100000; ++i) {
@@ -143,5 +101,4 @@ static void test_weakRefCnt(skiatest::Reporter* reporter) {
DEF_TEST(RefCnt, reporter) {
test_refCnt(reporter);
test_weakRefCnt(reporter);
- test_refarray(reporter);
}
« no previous file with comments | « src/core/SkTRefArray.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698