OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkRandom.h" | 9 #include "SkRandom.h" |
10 #include "SkRefCnt.h" | 10 #include "SkRefCnt.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 tmp[0] = &obj0; | 64 tmp[0] = &obj0; |
65 tmp[1] = &obj1; | 65 tmp[1] = &obj1; |
66 REPORTER_ASSERT(reporter, 2 == obj0.getRefCnt()); | 66 REPORTER_ASSERT(reporter, 2 == obj0.getRefCnt()); |
67 REPORTER_ASSERT(reporter, 2 == obj1.getRefCnt()); | 67 REPORTER_ASSERT(reporter, 2 == obj1.getRefCnt()); |
68 | 68 |
69 // test out reset with data in the array (and a new allocation) | 69 // test out reset with data in the array (and a new allocation) |
70 tmp.reset(0); | 70 tmp.reset(0); |
71 REPORTER_ASSERT(reporter, 0 == tmp.count()); | 71 REPORTER_ASSERT(reporter, 0 == tmp.count()); |
72 REPORTER_ASSERT(reporter, 1 == obj0.getRefCnt()); | 72 REPORTER_ASSERT(reporter, 1 == obj0.getRefCnt()); |
73 REPORTER_ASSERT(reporter, 1 == obj1.getRefCnt()); | 73 REPORTER_ASSERT(reporter, 1 == obj1.getRefCnt()); |
74 | 74 |
75 tmp.reset(2); // this should use the preexisting allocation | 75 tmp.reset(2); // this should use the preexisting allocation |
76 REPORTER_ASSERT(reporter, 2 == tmp.count()); | 76 REPORTER_ASSERT(reporter, 2 == tmp.count()); |
77 tmp[0] = &obj0; | 77 tmp[0] = &obj0; |
78 tmp[1] = &obj1; | 78 tmp[1] = &obj1; |
79 } | 79 } |
80 | 80 |
81 // test out destructor with data in the array (and using existing allocation
) | 81 // test out destructor with data in the array (and using existing allocation
) |
82 REPORTER_ASSERT(reporter, 1 == obj0.getRefCnt()); | 82 REPORTER_ASSERT(reporter, 1 == obj0.getRefCnt()); |
83 REPORTER_ASSERT(reporter, 1 == obj1.getRefCnt()); | 83 REPORTER_ASSERT(reporter, 1 == obj1.getRefCnt()); |
84 | 84 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 } | 217 } |
218 | 218 |
219 test_utf16(reporter); | 219 test_utf16(reporter); |
220 test_search(reporter); | 220 test_search(reporter); |
221 test_autounref(reporter); | 221 test_autounref(reporter); |
222 test_autostarray(reporter); | 222 test_autostarray(reporter); |
223 } | 223 } |
224 | 224 |
225 #include "TestClassDef.h" | 225 #include "TestClassDef.h" |
226 DEFINE_TESTCLASS("Utils", UtfTestClass, TestUTF) | 226 DEFINE_TESTCLASS("Utils", UtfTestClass, TestUTF) |
OLD | NEW |