diff options
author | mtklein <mtklein@chromium.org> | 2015-06-26 11:45:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-26 11:45:03 -0700 |
commit | 2766c00fc0b6a07d46e5f74cdad45da2ef625237 (patch) | |
tree | 152a6169021ef393f5719d511becf9f81fec8c02 /tests | |
parent | 46043ee50fe0532df6213172506fd16324b21e58 (diff) |
remove SkInstCnt
It's been outclassed by Valgrind and leak sanitizer,
and it seems to be causing problems for external folks building Skia.
I'm not sure why our own builds seem unaffected.
Latest thread:
https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0
BUG=skia:
Review URL: https://codereview.chromium.org/1217573002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GrMemoryPoolTest.cpp | 12 | ||||
-rw-r--r-- | tests/LListTest.cpp | 31 | ||||
-rw-r--r-- | tests/RefDictTest.cpp | 2 | ||||
-rw-r--r-- | tests/ResourceCacheTest.cpp | 2 | ||||
-rw-r--r-- | tests/UtilsTest.cpp | 2 | ||||
-rw-r--r-- | tests/skia_test.cpp | 7 |
6 files changed, 4 insertions, 52 deletions
diff --git a/tests/GrMemoryPoolTest.cpp b/tests/GrMemoryPoolTest.cpp index 1ba184b45f..81392ce3d5 100644 --- a/tests/GrMemoryPoolTest.cpp +++ b/tests/GrMemoryPoolTest.cpp @@ -9,7 +9,6 @@ // This is a GPU-backend specific test #if SK_SUPPORT_GPU #include "GrMemoryPool.h" -#include "SkInstCnt.h" #include "SkRandom.h" #include "SkTDArray.h" #include "SkTemplates.h" @@ -44,22 +43,14 @@ public: } } - SK_DECLARE_INST_COUNT(A); - static A* Create(SkRandom* r); static void SetAllocator(size_t preallocSize, size_t minAllocSize) { -#if SK_ENABLE_INST_COUNT - SkASSERT(0 == GetInstanceCount()); -#endif GrMemoryPool* pool = new GrMemoryPool(preallocSize, minAllocSize); gPool.reset(pool); } static void ResetAllocator() { -#if SK_ENABLE_INST_COUNT - SkASSERT(0 == GetInstanceCount()); -#endif gPool.reset(NULL); } @@ -232,9 +223,6 @@ DEF_TEST(GrMemoryPool, reporter) { REPORTER_ASSERT(reporter, rec.fInstance->checkValues(rec.fValue)); delete rec.fInstance; } -#if SK_ENABLE_INST_COUNT - REPORTER_ASSERT(reporter, !A::GetInstanceCount()); -#endif } } } diff --git a/tests/LListTest.cpp b/tests/LListTest.cpp index 34bbb4dcba..3d1921514c 100644 --- a/tests/LListTest.cpp +++ b/tests/LListTest.cpp @@ -5,7 +5,6 @@ * found in the LICENSE file. */ -#include "SkInstCnt.h" #include "SkRandom.h" #include "SkTInternalLList.h" #include "SkTLList.h" @@ -17,15 +16,10 @@ public: } bool operator== (const ListElement& other) { return fID == other.fID; } -#if SK_ENABLE_INST_COUNT - // Make the instance count available publicly. - static int InstanceCount() { return GetInstanceCount(); } -#endif - int fID; private: - SK_DECLARE_INST_COUNT(ListElement); + SK_DECLARE_INTERNAL_LLIST_INTERFACE(ListElement); }; @@ -134,10 +128,6 @@ static void TestTLList(skiatest::Reporter* reporter) { Iter iter3; Iter iter4; -#if SK_ENABLE_INST_COUNT - SkASSERT(0 == ListElement::InstanceCount()); -#endif - REPORTER_ASSERT(reporter, list1.isEmpty()); REPORTER_ASSERT(reporter, NULL == iter1.init(list1, Iter::kHead_IterStart)); REPORTER_ASSERT(reporter, NULL == iter1.init(list1, Iter::kTail_IterStart)); @@ -150,9 +140,6 @@ static void TestTLList(skiatest::Reporter* reporter) { // Create two identical lists, one by appending to head and the other to the tail. list1.addToHead(ListElement(1)); list2.addToTail(ListElement(1)); -#if SK_ENABLE_INST_COUNT - SkASSERT(2 == ListElement::InstanceCount()); -#endif iter1.init(list1, Iter::kHead_IterStart); iter2.init(list1, Iter::kTail_IterStart); REPORTER_ASSERT(reporter, iter1.get()->fID == iter2.get()->fID); @@ -177,10 +164,6 @@ static void TestTLList(skiatest::Reporter* reporter) { iter4.init(list2, Iter::kTail_IterStart); list2.addToHead(ListElement(2)); -#if SK_ENABLE_INST_COUNT - SkASSERT(3 == ListElement::InstanceCount()); -#endif - REPORTER_ASSERT(reporter, iter3.get()->fID == iter1.get()->fID); REPORTER_ASSERT(reporter, iter4.get()->fID == iter1.get()->fID); REPORTER_ASSERT(reporter, 1 == Iter(list2, Iter::kTail_IterStart).get()->fID); @@ -188,16 +171,10 @@ static void TestTLList(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, list1 != list2); list1.addToHead(ListElement(2)); REPORTER_ASSERT(reporter, list1 == list2); -#if SK_ENABLE_INST_COUNT - SkASSERT(4 == ListElement::InstanceCount()); -#endif REPORTER_ASSERT(reporter, !list1.isEmpty()); list1.reset(); list2.reset(); -#if SK_ENABLE_INST_COUNT - SkASSERT(0 == ListElement::InstanceCount()); -#endif REPORTER_ASSERT(reporter, list1.isEmpty() && list2.isEmpty()); // randomly perform insertions and deletions on a list and perform tests @@ -300,14 +277,8 @@ static void TestTLList(skiatest::Reporter* reporter) { --count; } REPORTER_ASSERT(reporter, count == list1.count()); -#if SK_ENABLE_INST_COUNT - SkASSERT(count == ListElement::InstanceCount()); -#endif } list1.reset(); -#if SK_ENABLE_INST_COUNT - SkASSERT(0 == ListElement::InstanceCount()); -#endif } } diff --git a/tests/RefDictTest.cpp b/tests/RefDictTest.cpp index 23e4b114a5..469026ebc9 100644 --- a/tests/RefDictTest.cpp +++ b/tests/RefDictTest.cpp @@ -10,7 +10,7 @@ class TestRC : public SkRefCnt { public: - SK_DECLARE_INST_COUNT(TestRC) + private: typedef SkRefCnt INHERITED; }; diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp index 6f1d40450c..07cd65518e 100644 --- a/tests/ResourceCacheTest.cpp +++ b/tests/ResourceCacheTest.cpp @@ -240,7 +240,7 @@ class TestResource : public GrGpuResource { static const size_t kDefaultSize = 100; enum ScratchConstructor { kScratchConstructor }; public: - SK_DECLARE_INST_COUNT(TestResource); + /** Property that distinctly categorizes the resource. * For example, textures have width, height, ... */ enum SimulatedProperty { kA_SimulatedProperty, kB_SimulatedProperty }; diff --git a/tests/UtilsTest.cpp b/tests/UtilsTest.cpp index 81e6492f3c..6db8104acc 100644 --- a/tests/UtilsTest.cpp +++ b/tests/UtilsTest.cpp @@ -14,7 +14,7 @@ class RefClass : public SkRefCnt { public: - SK_DECLARE_INST_COUNT(RefClass) + RefClass(int n) : fN(n) {} int get() const { return fN; } diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp index 3379e3971d..2c1822d38b 100644 --- a/tests/skia_test.cpp +++ b/tests/skia_test.cpp @@ -10,7 +10,6 @@ #include "Resources.h" #include "SkCommonFlags.h" #include "SkGraphics.h" -#include "SkInstCnt.h" #include "SkOSFile.h" #include "SkRunnable.h" #include "SkTArray.h" @@ -131,12 +130,6 @@ int test_main(); int test_main() { SetupCrashHandler(); -#if SK_ENABLE_INST_COUNT - if (FLAGS_leaks) { - gPrintInstCount = true; - } -#endif - SkAutoGraphics ag; { |