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

Side by Side Diff: tests/UtilsTest.cpp

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tests/SortTest.cpp ('k') | tests/Writer32Test.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 /* 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 REPORTER_ASSERT(reporter, 1 == obj0.getRefCnt()); 116 REPORTER_ASSERT(reporter, 1 == obj0.getRefCnt());
117 REPORTER_ASSERT(reporter, 1 == obj1.getRefCnt()); 117 REPORTER_ASSERT(reporter, 1 == obj1.getRefCnt());
118 } 118 }
119 119
120 ///////////////////////////////////////////////////////////////////////////// 120 /////////////////////////////////////////////////////////////////////////////
121 121
122 #define kSEARCH_COUNT 91 122 #define kSEARCH_COUNT 91
123 123
124 static void test_search(skiatest::Reporter* reporter) { 124 static void test_search(skiatest::Reporter* reporter) {
125 int i, array[kSEARCH_COUNT]; 125 int i, array[kSEARCH_COUNT];
126 SkMWCRandom rand; 126 SkRandom rand;
127 127
128 for (i = 0; i < kSEARCH_COUNT; i++) { 128 for (i = 0; i < kSEARCH_COUNT; i++) {
129 array[i] = rand.nextS(); 129 array[i] = rand.nextS();
130 } 130 }
131 131
132 SkTHeapSort<int>(array, kSEARCH_COUNT); 132 SkTHeapSort<int>(array, kSEARCH_COUNT);
133 // make sure we got sorted properly 133 // make sure we got sorted properly
134 for (i = 1; i < kSEARCH_COUNT; i++) { 134 for (i = 1; i < kSEARCH_COUNT; i++) {
135 REPORTER_ASSERT(reporter, array[i-1] <= array[i]); 135 REPORTER_ASSERT(reporter, array[i-1] <= array[i]);
136 } 136 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)
OLDNEW
« no previous file with comments | « tests/SortTest.cpp ('k') | tests/Writer32Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698