| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |