| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
| 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 #include "SkFloat.h" | 10 #include "SkFloat.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 n = b.getInt(); | 284 n = b.getInt(); |
| 285 SkASSERT(n == 5); | 285 SkASSERT(n == 5); |
| 286 | 286 |
| 287 c.setInt(-3); | 287 c.setInt(-3); |
| 288 n = c.getInt(); | 288 n = c.getInt(); |
| 289 SkASSERT(n == -3); | 289 SkASSERT(n == -3); |
| 290 | 290 |
| 291 d.setAdd(c, b); | 291 d.setAdd(c, b); |
| 292 SkDebugf("SkFloat: %d + %d = %d\n", c.getInt(), b.getInt(), d.getInt()); | 292 SkDebugf("SkFloat: %d + %d = %d\n", c.getInt(), b.getInt(), d.getInt()); |
| 293 | 293 |
| 294 SkMWCRandom rand; | 294 SkRandom rand; |
| 295 | 295 |
| 296 int i; | 296 int i; |
| 297 for (i = 0; i < 1000; i++) | 297 for (i = 0; i < 1000; i++) |
| 298 { | 298 { |
| 299 float fa, fb; | 299 float fa, fb; |
| 300 int aa = rand.nextS() >> 14; | 300 int aa = rand.nextS() >> 14; |
| 301 int bb = rand.nextS() >> 14; | 301 int bb = rand.nextS() >> 14; |
| 302 a.setInt(aa); | 302 a.setInt(aa); |
| 303 b.setInt(bb); | 303 b.setInt(bb); |
| 304 SkASSERT(a.getInt() == aa); | 304 SkASSERT(a.getInt() == aa); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 a.assertEquals(2.0f, 0); | 384 a.assertEquals(2.0f, 0); |
| 385 a.setInt(27); | 385 a.setInt(27); |
| 386 a.cubeRoot(); | 386 a.cubeRoot(); |
| 387 a.assertEquals(3.0f, 0); | 387 a.assertEquals(3.0f, 0); |
| 388 #endif | 388 #endif |
| 389 } | 389 } |
| 390 #endif | 390 #endif |
| 391 } | 391 } |
| 392 | 392 |
| 393 #endif | 393 #endif |
| OLD | NEW |