Changeset 877 for trunk/test/half.cpp
- Timestamp:
- Aug 29, 2011, 7:02:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/half.cpp
r875 r877 34 34 { 35 35 CPPUNIT_TEST_SUITE(HalfTest); 36 CPPUNIT_TEST(test_half_from_float); 37 CPPUNIT_TEST(test_half_makeslow); 36 38 CPPUNIT_TEST(test_half_makebits); 37 CPPUNIT_TEST(test_half_makeslow);38 CPPUNIT_TEST(test_half_makefast);39 39 CPPUNIT_TEST(test_half_is_nan); 40 40 CPPUNIT_TEST(test_half_is_inf); … … 57 57 void tearDown() {} 58 58 59 void test_half_ makebits()60 { 61 for ( unsigned int i = 0; i < 0x10000; i++)62 { 63 half a = half::makebits(i);64 uint16_t b = i;59 void test_half_from_float() 60 { 61 for (size_t i = 0; i < sizeof(pairs) / sizeof(*pairs); i++) 62 { 63 half a = (half)pairs[i].f; 64 uint16_t b = pairs[i].x; 65 65 CPPUNIT_ASSERT_EQUAL(a.bits, b); 66 66 } … … 77 77 } 78 78 79 void test_half_make fast()80 { 81 for ( size_t i = 0; i < sizeof(pairs) / sizeof(*pairs); i++)82 { 83 half a = half::make fast(pairs[i].f);84 uint16_t b = pairs[i].x;79 void test_half_makebits() 80 { 81 for (unsigned int i = 0; i < 0x10000; i++) 82 { 83 half a = half::makebits(i); 84 uint16_t b = i; 85 85 CPPUNIT_ASSERT_EQUAL(a.bits, b); 86 86 }
Note: See TracChangeset
for help on using the changeset viewer.