Ignore:
Timestamp:
Aug 29, 2011, 2:07:54 AM (11 years ago)
Author:
sam
Message:

core: minor refactoring in the float / half conversions to accomodate
for future array versions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/half.cpp

    r871 r872  
    5555            half a = half::makebits(i);
    5656            uint16_t b = i;
    57             CPPUNIT_ASSERT_EQUAL(a.bits(), b);
     57            CPPUNIT_ASSERT_EQUAL(a.bits, b);
    5858        }
    5959    }
     
    6565            half a = half::makeslow(pairs[i].f);
    6666            uint16_t b = pairs[i].x;
    67             CPPUNIT_ASSERT_EQUAL(a.bits(), b);
     67            CPPUNIT_ASSERT_EQUAL(a.bits, b);
    6868        }
    6969    }
     
    7575            half a = half::makefast(pairs[i].f);
    7676            uint16_t b = pairs[i].x;
    77             CPPUNIT_ASSERT_EQUAL(a.bits(), b);
     77            CPPUNIT_ASSERT_EQUAL(a.bits, b);
    7878        }
    7979    }
     
    191191            {
    192192                CPPUNIT_ASSERT(!isnan(f));
    193                 CPPUNIT_ASSERT_EQUAL(g.bits(), h.bits());
     193                CPPUNIT_ASSERT_EQUAL(g.bits, h.bits);
    194194            }
    195195        }
     
    259259
    260260        half a = one + 0.0f;
    261         CPPUNIT_ASSERT_EQUAL(one.bits(), a.bits());
     261        CPPUNIT_ASSERT_EQUAL(one.bits, a.bits);
    262262        a += 0.0f;
    263         CPPUNIT_ASSERT_EQUAL(one.bits(), a.bits());
     263        CPPUNIT_ASSERT_EQUAL(one.bits, a.bits);
    264264        a -= 0.0f;
    265         CPPUNIT_ASSERT_EQUAL(one.bits(), a.bits());
     265        CPPUNIT_ASSERT_EQUAL(one.bits, a.bits);
    266266        a *= 1.0f;
    267         CPPUNIT_ASSERT_EQUAL(one.bits(), a.bits());
     267        CPPUNIT_ASSERT_EQUAL(one.bits, a.bits);
    268268        a /= 1.0f;
    269         CPPUNIT_ASSERT_EQUAL(one.bits(), a.bits());
     269        CPPUNIT_ASSERT_EQUAL(one.bits, a.bits);
    270270
    271271        half b = one + 0.0f;
    272         CPPUNIT_ASSERT_EQUAL(one.bits(), b.bits());
     272        CPPUNIT_ASSERT_EQUAL(one.bits, b.bits);
    273273        b += 1.0f;
    274         CPPUNIT_ASSERT_EQUAL(two.bits(), b.bits());
     274        CPPUNIT_ASSERT_EQUAL(two.bits, b.bits);
    275275        b *= 2.0f;
    276         CPPUNIT_ASSERT_EQUAL(four.bits(), b.bits());
     276        CPPUNIT_ASSERT_EQUAL(four.bits, b.bits);
    277277        b -= 2.0f;
    278         CPPUNIT_ASSERT_EQUAL(two.bits(), b.bits());
     278        CPPUNIT_ASSERT_EQUAL(two.bits, b.bits);
    279279        b /= 2.0f;
    280         CPPUNIT_ASSERT_EQUAL(one.bits(), b.bits());
     280        CPPUNIT_ASSERT_EQUAL(one.bits, b.bits);
    281281
    282282        half c = 1.0f - zero;
    283         CPPUNIT_ASSERT_EQUAL(one.bits(), c.bits());
     283        CPPUNIT_ASSERT_EQUAL(one.bits, c.bits);
    284284
    285285        half d = 2.0f - one;
    286         CPPUNIT_ASSERT_EQUAL(one.bits(), d.bits());
     286        CPPUNIT_ASSERT_EQUAL(one.bits, d.bits);
    287287
    288288        half e = 2.0f + (-one);
    289         CPPUNIT_ASSERT_EQUAL(one.bits(), e.bits());
     289        CPPUNIT_ASSERT_EQUAL(one.bits, e.bits);
    290290
    291291        half f = (2.0f * two) / (1.0f + one);
    292         CPPUNIT_ASSERT_EQUAL(two.bits(), f.bits());
     292        CPPUNIT_ASSERT_EQUAL(two.bits, f.bits);
    293293    }
    294294
Note: See TracChangeset for help on using the changeset viewer.