OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkRefCnt.h" | 8 #include "SkRefCnt.h" |
9 #include "SkThreadUtils.h" | 9 #include "SkThreadUtils.h" |
10 #include "SkTypes.h" | 10 #include "SkTypes.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 SkASSERT(thing2.start()); | 64 SkASSERT(thing2.start()); |
65 SkASSERT(thing3.start()); | 65 SkASSERT(thing3.start()); |
66 SkASSERT(thing4.start()); | 66 SkASSERT(thing4.start()); |
67 | 67 |
68 thing1.join(); | 68 thing1.join(); |
69 thing2.join(); | 69 thing2.join(); |
70 thing3.join(); | 70 thing3.join(); |
71 thing4.join(); | 71 thing4.join(); |
72 | 72 |
73 REPORTER_ASSERT(reporter, ref->unique()); | 73 REPORTER_ASSERT(reporter, ref->unique()); |
74 REPORTER_ASSERT(reporter, ref->getWeakCnt() == 1); | 74 SkDEBUGCODE(REPORTER_ASSERT(reporter, ref->getWeakCnt() == 1)); |
75 ref->unref(); | 75 ref->unref(); |
76 } | 76 } |
77 | 77 |
78 DEF_TEST(RefCnt, reporter) { | 78 DEF_TEST(RefCnt, reporter) { |
79 test_refCnt(reporter); | 79 test_refCnt(reporter); |
80 test_weakRefCnt(reporter); | 80 test_weakRefCnt(reporter); |
81 } | 81 } |
82 | 82 |
83 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 83 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
84 | 84 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 REPORTER_ASSERT(r, rc->unique()); | 391 REPORTER_ASSERT(r, rc->unique()); |
392 | 392 |
393 { | 393 { |
394 sk_sp<SkRefCnt> sp = sk_ref_sp(rc); | 394 sk_sp<SkRefCnt> sp = sk_ref_sp(rc); |
395 REPORTER_ASSERT(r, !rc->unique()); | 395 REPORTER_ASSERT(r, !rc->unique()); |
396 } | 396 } |
397 | 397 |
398 REPORTER_ASSERT(r, rc->unique()); | 398 REPORTER_ASSERT(r, rc->unique()); |
399 rc->unref(); | 399 rc->unref(); |
400 } | 400 } |
OLD | NEW |