OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkOnce.h" | 8 #include "SkOnce.h" |
| 9 #include "SkRunnable.h" |
9 #include "SkTaskGroup.h" | 10 #include "SkTaskGroup.h" |
10 #include "Test.h" | 11 #include "Test.h" |
11 | 12 |
12 static void add_five(int* x) { | 13 static void add_five(int* x) { |
13 *x += 5; | 14 *x += 5; |
14 } | 15 } |
15 | 16 |
16 DEF_TEST(SkOnce_Singlethreaded, r) { | 17 DEF_TEST(SkOnce_Singlethreaded, r) { |
17 int x = 0; | 18 int x = 0; |
18 | 19 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 static int gX = 0; | 72 static int gX = 0; |
72 static void inc_gX() { gX++; } | 73 static void inc_gX() { gX++; } |
73 | 74 |
74 DEF_TEST(SkOnce_NoArg, r) { | 75 DEF_TEST(SkOnce_NoArg, r) { |
75 SK_DECLARE_STATIC_ONCE(once); | 76 SK_DECLARE_STATIC_ONCE(once); |
76 SkOnce(&once, inc_gX); | 77 SkOnce(&once, inc_gX); |
77 SkOnce(&once, inc_gX); | 78 SkOnce(&once, inc_gX); |
78 SkOnce(&once, inc_gX); | 79 SkOnce(&once, inc_gX); |
79 REPORTER_ASSERT(r, 1 == gX); | 80 REPORTER_ASSERT(r, 1 == gX); |
80 } | 81 } |
OLD | NEW |