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 "Test.h" | 8 #include "Test.h" |
9 #include "SkRandom.h" | 9 #include "SkRandom.h" |
10 #include "SkTInternalLList.h" | 10 #include "SkTInternalLList.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 cur = iter.init(list, Iter::kHead_IterStart); | 118 cur = iter.init(list, Iter::kHead_IterStart); |
119 for (int i = 0; NULL != cur; ++i, cur = iter.next()) { | 119 for (int i = 0; NULL != cur; ++i, cur = iter.next()) { |
120 REPORTER_ASSERT(reporter, cur->fID == i); | 120 REPORTER_ASSERT(reporter, cur->fID == i); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 static void TestTLList(skiatest::Reporter* reporter) { | 124 static void TestTLList(skiatest::Reporter* reporter) { |
125 typedef SkTLList<ListElement> ElList; | 125 typedef SkTLList<ListElement> ElList; |
126 typedef ElList::Iter Iter; | 126 typedef ElList::Iter Iter; |
127 SkMWCRandom random; | 127 SkRandom random; |
128 | 128 |
129 for (int i = 1; i <= 16; i *= 2) { | 129 for (int i = 1; i <= 16; i *= 2) { |
130 | 130 |
131 ElList list1(i); | 131 ElList list1(i); |
132 ElList list2(i); | 132 ElList list2(i); |
133 Iter iter1; | 133 Iter iter1; |
134 Iter iter2; | 134 Iter iter2; |
135 Iter iter3; | 135 Iter iter3; |
136 Iter iter4; | 136 Iter iter4; |
137 | 137 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 312 } |
313 } | 313 } |
314 | 314 |
315 static void test_llists(skiatest::Reporter* reporter) { | 315 static void test_llists(skiatest::Reporter* reporter) { |
316 TestTInternalLList(reporter); | 316 TestTInternalLList(reporter); |
317 TestTLList(reporter); | 317 TestTLList(reporter); |
318 } | 318 } |
319 | 319 |
320 #include "TestClassDef.h" | 320 #include "TestClassDef.h" |
321 DEFINE_TESTCLASS("LList", TestLListClass, test_llists) | 321 DEFINE_TESTCLASS("LList", TestLListClass, test_llists) |
OLD | NEW |