Chromium Code Reviews| Index: tests/OncePtrTest.cpp |
| diff --git a/tests/OncePtrTest.cpp b/tests/OncePtrTest.cpp |
| index b1e4e5d1ae7d3ec238a324201db3bb0d9ae7dd11..547f292ad7bd8830b0564625894e319e54bdb13d 100644 |
| --- a/tests/OncePtrTest.cpp |
| +++ b/tests/OncePtrTest.cpp |
| @@ -6,10 +6,15 @@ |
| */ |
| #include "Test.h" |
| +#include "SkCommonFlags.h" |
| #include "SkOncePtr.h" |
| #include "SkTaskGroup.h" |
| DEF_TEST(OncePtr, r) { |
| + if (FLAGS_threads > 0 && FLAGS_threads < sk_num_cores()) { |
| + return; |
| + } |
| + |
| SkOncePtr<int> once; |
| static SkAtomic<int> calls(0); |
| @@ -24,7 +29,7 @@ DEF_TEST(OncePtr, r) { |
| force_a_race.fetch_add(-1); |
| while (force_a_race.load() > 0); |
| - int* n = once.get(create); |
| + SkAutoTDelete<int> n(once.get(create)); |
|
mtklein
2015/10/26 13:36:37
Pretty sure ~SkOncePtr deletes the pointer and thi
Kimmo Kinnunen
2015/10/27 06:44:41
I see. I didn't think this through, sorry.
|
| REPORTER_ASSERT(r, *n == 5); |
| }); |
| REPORTER_ASSERT(r, calls.load() == 1); |