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

Unified Diff: tests/OncePtrTest.cpp

Issue 1939503002: remove non-static uses of SkOncePtr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: leave it Created 4 years, 8 months 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/image/SkSurface.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/OncePtrTest.cpp
diff --git a/tests/OncePtrTest.cpp b/tests/OncePtrTest.cpp
index d01cee09fe913932de27ce52a017d25821b50582..0aacdf53ee3daec61ff7145ea5925916c6377266 100644
--- a/tests/OncePtrTest.cpp
+++ b/tests/OncePtrTest.cpp
@@ -9,9 +9,9 @@
#include "SkOncePtr.h"
#include "SkTaskGroup.h"
-DEF_TEST(OncePtr, r) {
- SkOncePtr<int> once;
+SK_DECLARE_STATIC_ONCE_PTR(int, once);
+DEF_TEST(OncePtr, r) {
static SkAtomic<int> calls(0);
auto create = [&] {
calls.fetch_add(1);
@@ -24,20 +24,3 @@ DEF_TEST(OncePtr, r) {
});
REPORTER_ASSERT(r, calls.load() == 1);
}
-
-/* TODO(mtklein): next CL
-
-SK_DECLARE_STATIC_ONCE(once_noptr);
-DEF_TEST(OnceNoPtr, r) {
- static SkAtomic<int> calls(0);
-
- SkAtomic<int> force_a_race(sk_num_cores());
- SkTaskGroup().batch(sk_num_cores()*4, [&](size_t) {
- force_a_race.fetch_add(-1);
- while (force_a_race.load() > 0);
-
- SkOnce(&once_noptr, [&] { calls.fetch_add(1); });
- });
- REPORTER_ASSERT(r, calls.load() == 1);
-}
-*/
« no previous file with comments | « src/image/SkSurface.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698