diff options
author | Ben Wagner <bungeman@google.com> | 2018-07-16 17:46:10 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-16 22:23:49 +0000 |
commit | f35a1c1b24ba4a44d40425ab20348ea813c7bfd7 (patch) | |
tree | c3aa374f9eb90034e6b0b40f2183fddd887c14ad /tests | |
parent | bfc63c1ea41047fc5e299ebf2086309eaa8e79ce (diff) |
Remove SkRefDict.
It is unused. Remove it.
Change-Id: If62a93a58d21bfccd6df112e92a709bff4d11c97
Reviewed-on: https://skia-review.googlesource.com/141566
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/RefDictTest.cpp | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/tests/RefDictTest.cpp b/tests/RefDictTest.cpp deleted file mode 100644 index f3ba657182..0000000000 --- a/tests/RefDictTest.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkRefDict.h" -#include "Test.h" - -class TestRC : public SkRefCnt { -public: - -private: - typedef SkRefCnt INHERITED; -}; - -DEF_TEST(RefDict, reporter) { - TestRC data0, data1; - SkRefDict dict; - - REPORTER_ASSERT(reporter, nullptr == dict.find(nullptr)); - REPORTER_ASSERT(reporter, nullptr == dict.find("foo")); - REPORTER_ASSERT(reporter, nullptr == dict.find("bar")); - - dict.set("foo", &data0); - REPORTER_ASSERT(reporter, &data0 == dict.find("foo")); - REPORTER_ASSERT(reporter, !data0.unique()); - - dict.set("foo", &data0); - REPORTER_ASSERT(reporter, &data0 == dict.find("foo")); - REPORTER_ASSERT(reporter, !data0.unique()); - - dict.set("foo", &data1); - REPORTER_ASSERT(reporter, &data1 == dict.find("foo")); - REPORTER_ASSERT(reporter, data0.unique()); - REPORTER_ASSERT(reporter, !data1.unique()); - - dict.set("foo", nullptr); - REPORTER_ASSERT(reporter, nullptr == dict.find("foo")); - 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, !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, data0.unique()); - REPORTER_ASSERT(reporter, !data1.unique()); - - dict.removeAll(); - REPORTER_ASSERT(reporter, nullptr == dict.find("foo")); - REPORTER_ASSERT(reporter, nullptr == dict.find("bar")); - REPORTER_ASSERT(reporter, data0.unique()); - REPORTER_ASSERT(reporter, data1.unique()); - - { - SkRefDict d; - REPORTER_ASSERT(reporter, nullptr == d.find("foo")); - REPORTER_ASSERT(reporter, data0.unique()); - d.set("foo", &data0); - REPORTER_ASSERT(reporter, &data0 == d.find("foo")); - 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, data0.unique()); -} |