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

Side by Side Diff: src/gpu/GrRedBlackTree.h

Issue 12334131: Change random number generator for tests to SkMWCRandom (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Rebase to latest Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkMatrix.cpp ('k') | src/gpu/gl/GrGLEffectMatrix.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 /* 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 8
9 9
10 #ifndef GrRedBlackTree_DEFINED 10 #ifndef GrRedBlackTree_DEFINED
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 943 }
944 #endif 944 #endif
945 945
946 #include "SkRandom.h" 946 #include "SkRandom.h"
947 947
948 template <typename T, typename C> 948 template <typename T, typename C>
949 void GrRedBlackTree<T,C>::UnitTest() { 949 void GrRedBlackTree<T,C>::UnitTest() {
950 GrRedBlackTree<int> tree; 950 GrRedBlackTree<int> tree;
951 typedef GrRedBlackTree<int>::Iter iter; 951 typedef GrRedBlackTree<int>::Iter iter;
952 952
953 SkRandom r; 953 SkMWCRandom r;
954 954
955 int count[100] = {0}; 955 int count[100] = {0};
956 // add 10K ints 956 // add 10K ints
957 for (int i = 0; i < 10000; ++i) { 957 for (int i = 0; i < 10000; ++i) {
958 int x = r.nextU()%100; 958 int x = r.nextU()%100;
959 SkDEBUGCODE(Iter xi = ) tree.insert(x); 959 SkDEBUGCODE(Iter xi = ) tree.insert(x);
960 GrAssert(*xi == x); 960 GrAssert(*xi == x);
961 ++count[x]; 961 ++count[x];
962 } 962 }
963 963
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 // remove all entries 1109 // remove all entries
1110 while (!tree.empty()) { 1110 while (!tree.empty()) {
1111 tree.remove(tree.begin()); 1111 tree.remove(tree.begin());
1112 } 1112 }
1113 1113
1114 // test reset on empty tree. 1114 // test reset on empty tree.
1115 tree.reset(); 1115 tree.reset();
1116 } 1116 }
1117 1117
1118 #endif 1118 #endif
OLDNEW
« no previous file with comments | « src/core/SkMatrix.cpp ('k') | src/gpu/gl/GrGLEffectMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698