| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkColorPriv.h" | 8 #include "SkColorPriv.h" |
| 9 #include "SkEndian.h" | 9 #include "SkEndian.h" |
| 10 #include "SkFloatBits.h" | 10 #include "SkFloatBits.h" |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 (void)SkCLZ(numer); | 531 (void)SkCLZ(numer); |
| 532 (void)SkCLZ(denom); | 532 (void)SkCLZ(denom); |
| 533 | 533 |
| 534 REPORTER_ASSERT(reporter, result != (SkFixed)SK_NaN32); | 534 REPORTER_ASSERT(reporter, result != (SkFixed)SK_NaN32); |
| 535 if (check > SK_MaxS32) { | 535 if (check > SK_MaxS32) { |
| 536 check = SK_MaxS32; | 536 check = SK_MaxS32; |
| 537 } else if (check < -SK_MaxS32) { | 537 } else if (check < -SK_MaxS32) { |
| 538 check = SK_MinS32; | 538 check = SK_MinS32; |
| 539 } | 539 } |
| 540 if (result != (int32_t)check) { |
| 541 ERRORF(reporter, "\nFixed Divide: %8x / %8x -> %8x %8x\n", numer, de
nom, result, check); |
| 542 } |
| 540 REPORTER_ASSERT(reporter, result == (int32_t)check); | 543 REPORTER_ASSERT(reporter, result == (int32_t)check); |
| 541 } | 544 } |
| 542 | 545 |
| 543 test_blend(reporter); | 546 test_blend(reporter); |
| 544 | 547 |
| 545 if (false) test_floor(reporter); | 548 if (false) test_floor(reporter); |
| 546 | 549 |
| 547 // disable for now | 550 // disable for now |
| 548 if (false) test_blend31(); // avoid bit rot, suppress warning | 551 if (false) test_blend31(); // avoid bit rot, suppress warning |
| 549 | 552 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 test_divmod<int16_t>(r); | 654 test_divmod<int16_t>(r); |
| 652 } | 655 } |
| 653 | 656 |
| 654 DEF_TEST(divmod_s32, r) { | 657 DEF_TEST(divmod_s32, r) { |
| 655 test_divmod<int32_t>(r); | 658 test_divmod<int32_t>(r); |
| 656 } | 659 } |
| 657 | 660 |
| 658 DEF_TEST(divmod_s64, r) { | 661 DEF_TEST(divmod_s64, r) { |
| 659 test_divmod<int64_t>(r); | 662 test_divmod<int64_t>(r); |
| 660 } | 663 } |
| OLD | NEW |