Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: tests/LListTest.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/KtxTest.cpp ('k') | tests/LayerRasterizerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkRandom.h" 8 #include "SkRandom.h"
9 #include "SkTInternalLList.h" 9 #include "SkTInternalLList.h"
10 #include "SkTLList.h" 10 #include "SkTLList.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 check_list(list, reporter, false, 1, false, false, true, false, elements); 85 check_list(list, reporter, false, 1, false, false, true, false, elements);
86 86
87 // remove last element 87 // remove last element
88 list.remove(&elements[2]); 88 list.remove(&elements[2]);
89 89
90 // list should be empty again 90 // list should be empty again
91 check_list(list, reporter, true, 0, false, false, false, false, elements); 91 check_list(list, reporter, true, 0, false, false, false, false, elements);
92 92
93 // test out methods that add to the middle of the list. 93 // test out methods that add to the middle of the list.
94 list.addAfter(&elements[1], NULL); 94 list.addAfter(&elements[1], nullptr);
95 check_list(list, reporter, false, 1, false, true, false, false, elements); 95 check_list(list, reporter, false, 1, false, true, false, false, elements);
96 96
97 list.remove(&elements[1]); 97 list.remove(&elements[1]);
98 98
99 list.addBefore(&elements[1], NULL); 99 list.addBefore(&elements[1], nullptr);
100 check_list(list, reporter, false, 1, false, true, false, false, elements); 100 check_list(list, reporter, false, 1, false, true, false, false, elements);
101 101
102 list.addBefore(&elements[0], &elements[1]); 102 list.addBefore(&elements[0], &elements[1]);
103 check_list(list, reporter, false, 2, true, true, false, false, elements); 103 check_list(list, reporter, false, 2, true, true, false, false, elements);
104 104
105 list.addAfter(&elements[3], &elements[1]); 105 list.addAfter(&elements[3], &elements[1]);
106 check_list(list, reporter, false, 3, true, true, false, true, elements); 106 check_list(list, reporter, false, 3, true, true, false, true, elements);
107 107
108 list.addBefore(&elements[2], &elements[3]); 108 list.addBefore(&elements[2], &elements[3]);
109 check_list(list, reporter, false, 4, true, true, true, true, elements); 109 check_list(list, reporter, false, 4, true, true, true, true, elements);
(...skipping 12 matching lines...) Expand all
122 for (int i = 1; i <= 16; i *= 2) { 122 for (int i = 1; i <= 16; i *= 2) {
123 123
124 ElList list1(i); 124 ElList list1(i);
125 ElList list2(i); 125 ElList list2(i);
126 Iter iter1; 126 Iter iter1;
127 Iter iter2; 127 Iter iter2;
128 Iter iter3; 128 Iter iter3;
129 Iter iter4; 129 Iter iter4;
130 130
131 REPORTER_ASSERT(reporter, list1.isEmpty()); 131 REPORTER_ASSERT(reporter, list1.isEmpty());
132 REPORTER_ASSERT(reporter, NULL == iter1.init(list1, Iter::kHead_IterStar t)); 132 REPORTER_ASSERT(reporter, nullptr == iter1.init(list1, Iter::kHead_IterS tart));
133 REPORTER_ASSERT(reporter, NULL == iter1.init(list1, Iter::kTail_IterStar t)); 133 REPORTER_ASSERT(reporter, nullptr == iter1.init(list1, Iter::kTail_IterS tart));
134 // Try popping an empty list 134 // Try popping an empty list
135 list1.popHead(); 135 list1.popHead();
136 list1.popTail(); 136 list1.popTail();
137 REPORTER_ASSERT(reporter, list1.isEmpty()); 137 REPORTER_ASSERT(reporter, list1.isEmpty());
138 REPORTER_ASSERT(reporter, list1 == list2); 138 REPORTER_ASSERT(reporter, list1 == list2);
139 139
140 // Create two identical lists, one by appending to head and the other to the tail. 140 // Create two identical lists, one by appending to head and the other to the tail.
141 list1.addToHead(ListElement(1)); 141 list1.addToHead(ListElement(1));
142 list2.addToTail(ListElement(1)); 142 list2.addToTail(ListElement(1));
143 iter1.init(list1, Iter::kHead_IterStart); 143 iter1.init(list1, Iter::kHead_IterStart);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 Iter next = iter; 264 Iter next = iter;
265 prev.prev(); 265 prev.prev();
266 next.next(); 266 next.next();
267 list1.remove(iter.get()); 267 list1.remove(iter.get());
268 268
269 // make sure the remembered next/prev iters still work 269 // make sure the remembered next/prev iters still work
270 Iter pn = prev; pn.next(); 270 Iter pn = prev; pn.next();
271 Iter np = next; np.prev(); 271 Iter np = next; np.prev();
272 // pn should match next unless the target node was the head, in which case prev 272 // pn should match next unless the target node was the head, in which case prev
273 // walked off the list. 273 // walked off the list.
274 REPORTER_ASSERT(reporter, pn.get() == next.get() || NULL == prev .get()); 274 REPORTER_ASSERT(reporter, pn.get() == next.get() || nullptr == p rev.get());
275 // Similarly, np should match prev unless next originally walked off the tail. 275 // Similarly, np should match prev unless next originally walked off the tail.
276 REPORTER_ASSERT(reporter, np.get() == prev.get() || NULL == next .get()); 276 REPORTER_ASSERT(reporter, np.get() == prev.get() || nullptr == n ext.get());
277 --count; 277 --count;
278 } 278 }
279 REPORTER_ASSERT(reporter, count == list1.count()); 279 REPORTER_ASSERT(reporter, count == list1.count());
280 } 280 }
281 list1.reset(); 281 list1.reset();
282 } 282 }
283 } 283 }
284 284
285 DEF_TEST(LList, reporter) { 285 DEF_TEST(LList, reporter) {
286 TestTInternalLList(reporter); 286 TestTInternalLList(reporter);
287 TestTLList(reporter); 287 TestTLList(reporter);
288 } 288 }
OLDNEW
« no previous file with comments | « tests/KtxTest.cpp ('k') | tests/LayerRasterizerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698