| 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 "SkFloatBits.h" | 9 #include "SkFloatBits.h" |
| 10 #include "SkFloatingPoint.h" | 10 #include "SkFloatingPoint.h" |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 if (false) test_floor(reporter); | 640 if (false) test_floor(reporter); |
| 641 | 641 |
| 642 // disable for now | 642 // disable for now |
| 643 if (false) test_blend31(); // avoid bit rot, suppress warning | 643 if (false) test_blend31(); // avoid bit rot, suppress warning |
| 644 | 644 |
| 645 test_muldivround(reporter); | 645 test_muldivround(reporter); |
| 646 test_clz(reporter); | 646 test_clz(reporter); |
| 647 } | 647 } |
| 648 | 648 |
| 649 #include "TestClassDef.h" | 649 #include "TestClassDef.h" |
| 650 DEFINE_TESTCLASS("Math", MathTestClass, TestMath) | 650 DEFINE_TESTCLASS_SHORT(TestMath) |
| 651 | 651 |
| 652 /////////////////////////////////////////////////////////////////////////////// | 652 /////////////////////////////////////////////////////////////////////////////// |
| 653 | 653 |
| 654 #include "SkEndian.h" | 654 #include "SkEndian.h" |
| 655 | 655 |
| 656 template <typename T> struct PairRec { | 656 template <typename T> struct PairRec { |
| 657 T fYin; | 657 T fYin; |
| 658 T fYang; | 658 T fYang; |
| 659 }; | 659 }; |
| 660 | 660 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 683 REPORTER_ASSERT(reporter, g16[i].fYang == SkEndianSwap16(g16[i].fYin)); | 683 REPORTER_ASSERT(reporter, g16[i].fYang == SkEndianSwap16(g16[i].fYin)); |
| 684 } | 684 } |
| 685 for (size_t i = 0; i < SK_ARRAY_COUNT(g32); ++i) { | 685 for (size_t i = 0; i < SK_ARRAY_COUNT(g32); ++i) { |
| 686 REPORTER_ASSERT(reporter, g32[i].fYang == SkEndianSwap32(g32[i].fYin)); | 686 REPORTER_ASSERT(reporter, g32[i].fYang == SkEndianSwap32(g32[i].fYin)); |
| 687 } | 687 } |
| 688 for (size_t i = 0; i < SK_ARRAY_COUNT(g64); ++i) { | 688 for (size_t i = 0; i < SK_ARRAY_COUNT(g64); ++i) { |
| 689 REPORTER_ASSERT(reporter, g64[i].fYang == SkEndianSwap64(g64[i].fYin)); | 689 REPORTER_ASSERT(reporter, g64[i].fYang == SkEndianSwap64(g64[i].fYin)); |
| 690 } | 690 } |
| 691 } | 691 } |
| 692 | 692 |
| 693 DEFINE_TESTCLASS("Endian", EndianTestClass, TestEndian) | 693 DEFINE_TESTCLASS_SHORT(TestEndian) |
| 694 | 694 |
| 695 template <typename T> | 695 template <typename T> |
| 696 static void test_divmod(skiatest::Reporter* r) { | 696 static void test_divmod(skiatest::Reporter* r) { |
| 697 const struct { | 697 const struct { |
| 698 T numer; | 698 T numer; |
| 699 T denom; | 699 T denom; |
| 700 } kEdgeCases[] = { | 700 } kEdgeCases[] = { |
| 701 {(T)17, (T)17}, | 701 {(T)17, (T)17}, |
| 702 {(T)17, (T)4}, | 702 {(T)17, (T)4}, |
| 703 {(T)0, (T)17}, | 703 {(T)0, (T)17}, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 test_divmod<int16_t>(r); | 755 test_divmod<int16_t>(r); |
| 756 } | 756 } |
| 757 | 757 |
| 758 DEF_TEST(divmod_s32, r) { | 758 DEF_TEST(divmod_s32, r) { |
| 759 test_divmod<int32_t>(r); | 759 test_divmod<int32_t>(r); |
| 760 } | 760 } |
| 761 | 761 |
| 762 DEF_TEST(divmod_s64, r) { | 762 DEF_TEST(divmod_s64, r) { |
| 763 test_divmod<int64_t>(r); | 763 test_divmod<int64_t>(r); |
| 764 } | 764 } |
| OLD | NEW |