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

Side by Side Diff: tests/RTreeTest.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 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/PictureTest.cpp ('k') | tests/RecordTestUtils.h » ('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 "SkRTree.h" 8 #include "SkRTree.h"
9 #include "SkRandom.h" 9 #include "SkRandom.h"
10 #include "SkTSort.h" 10 #include "SkTSort.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 SkTDArray<void*> hits; 77 SkTDArray<void*> hits;
78 SkRect query = random_rect(rand); 78 SkRect query = random_rect(rand);
79 tree.search(query, &hits); 79 tree.search(query, &hits);
80 REPORTER_ASSERT(reporter, verify_query(query, rects, hits)); 80 REPORTER_ASSERT(reporter, verify_query(query, rects, hits));
81 } 81 }
82 } 82 }
83 83
84 static void rtree_test_main(SkRTree* rtree, skiatest::Reporter* reporter) { 84 static void rtree_test_main(SkRTree* rtree, skiatest::Reporter* reporter) {
85 DataRect rects[NUM_RECTS]; 85 DataRect rects[NUM_RECTS];
86 SkRandom rand; 86 SkRandom rand;
87 REPORTER_ASSERT(reporter, NULL != rtree); 87 REPORTER_ASSERT(reporter, rtree);
88 88
89 int expectedDepthMin = -1; 89 int expectedDepthMin = -1;
90 int expectedDepthMax = -1; 90 int expectedDepthMax = -1;
91 91
92 int tmp = NUM_RECTS; 92 int tmp = NUM_RECTS;
93 while (tmp > 0) { 93 while (tmp > 0) {
94 tmp -= static_cast<int>(pow(static_cast<double>(MAX_CHILDREN), 94 tmp -= static_cast<int>(pow(static_cast<double>(MAX_CHILDREN),
95 static_cast<double>(expectedDepthMin + 1))); 95 static_cast<double>(expectedDepthMin + 1)));
96 ++expectedDepthMin; 96 ++expectedDepthMin;
97 } 97 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 DEF_TEST(RTree, reporter) { 145 DEF_TEST(RTree, reporter) {
146 SkRTree* rtree = SkRTree::Create(MIN_CHILDREN, MAX_CHILDREN); 146 SkRTree* rtree = SkRTree::Create(MIN_CHILDREN, MAX_CHILDREN);
147 SkAutoUnref au(rtree); 147 SkAutoUnref au(rtree);
148 rtree_test_main(rtree, reporter); 148 rtree_test_main(rtree, reporter);
149 149
150 // Rtree that orders input rectangles on deferred insert. 150 // Rtree that orders input rectangles on deferred insert.
151 SkRTree* unsortedRtree = SkRTree::Create(MIN_CHILDREN, MAX_CHILDREN, 1, fals e); 151 SkRTree* unsortedRtree = SkRTree::Create(MIN_CHILDREN, MAX_CHILDREN, 1, fals e);
152 SkAutoUnref auo(unsortedRtree); 152 SkAutoUnref auo(unsortedRtree);
153 rtree_test_main(unsortedRtree, reporter); 153 rtree_test_main(unsortedRtree, reporter);
154 } 154 }
OLDNEW
« no previous file with comments | « tests/PictureTest.cpp ('k') | tests/RecordTestUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698