diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-16 14:58:06 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-16 14:58:06 +0000 |
commit | a22e2117e44efa4298dd0eb6df304a8166c8e9c3 (patch) | |
tree | 727738c19786a7c5caf1e09ccfe431b652d8b302 /tests | |
parent | 1f47f4f7325971dd53991e2bb02da94fa7c6d962 (diff) |
Extended Inst counting to find "unknown" leaked object (SkTMaskGamma)
http://codereview.appspot.com/6453127/
git-svn-id: http://skia.googlecode.com/svn/trunk@5123 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/AAClipTest.cpp | 3 | ||||
-rw-r--r-- | tests/RefDictTest.cpp | 6 | ||||
-rw-r--r-- | tests/Test.cpp | 2 | ||||
-rw-r--r-- | tests/Test.h | 1 | ||||
-rw-r--r-- | tests/UtilsTest.cpp | 6 |
5 files changed, 18 insertions, 0 deletions
diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp index bf52b01acd..c5e82ba647 100644 --- a/tests/AAClipTest.cpp +++ b/tests/AAClipTest.cpp @@ -337,6 +337,9 @@ static bool operator==(const SkRasterClip& a, const SkRasterClip& b) { SkMask ma, mb; copyToMask(a, &ma); copyToMask(b, &mb); + SkAutoMaskFreeImage aCleanUp(ma.fImage); + SkAutoMaskFreeImage bCleanUp(mb.fImage); + return ma == mb; } diff --git a/tests/RefDictTest.cpp b/tests/RefDictTest.cpp index 83d1aefae1..38a990a439 100644 --- a/tests/RefDictTest.cpp +++ b/tests/RefDictTest.cpp @@ -9,8 +9,14 @@ #include "SkRefDict.h" class TestRC : public SkRefCnt { +public: + SK_DECLARE_INST_COUNT(TestRC) +private: + typedef SkRefCnt INHERITED; }; +SK_DEFINE_INST_COUNT(TestRC) + static void TestRefDict(skiatest::Reporter* reporter) { TestRC data0, data1; SkRefDict dict; diff --git a/tests/Test.cpp b/tests/Test.cpp index 0441ab0fa7..deb83483c2 100644 --- a/tests/Test.cpp +++ b/tests/Test.cpp @@ -16,6 +16,8 @@ class GrContext; #endif +SK_DEFINE_INST_COUNT(skiatest::Reporter) + using namespace skiatest; Reporter::Reporter() { diff --git a/tests/Test.h b/tests/Test.h index 4ca1971782..2396d6f964 100644 --- a/tests/Test.h +++ b/tests/Test.h @@ -21,6 +21,7 @@ namespace skiatest { class Reporter : public SkRefCnt { public: + SK_DECLARE_INST_COUNT(Reporter) Reporter(); enum Result { diff --git a/tests/UtilsTest.cpp b/tests/UtilsTest.cpp index f1b1ea9139..1c2f870d1f 100644 --- a/tests/UtilsTest.cpp +++ b/tests/UtilsTest.cpp @@ -14,13 +14,19 @@ class RefClass : public SkRefCnt { public: + SK_DECLARE_INST_COUNT(RefClass) + RefClass(int n) : fN(n) {} int get() const { return fN; } private: int fN; + + typedef SkRefCnt INHERITED; }; +SK_DEFINE_INST_COUNT(RefClass) + static void test_refptr(skiatest::Reporter* reporter) { RefClass* r0 = new RefClass(0); |