From b0a5b7828239c8dd81fea3a13a6dffb1bfa88321 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 3 Apr 2011 01:05:29 +0000 Subject: Tweak to the float unit test. --- src/unit/float.unit | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/unit/float.unit') diff --git a/src/unit/float.unit b/src/unit/float.unit index 0473ffb..b1eb063 100644 --- a/src/unit/float.unit +++ b/src/unit/float.unit @@ -33,7 +33,14 @@ suite Basic unitTest( pObj != NULL ); unitTest( pObj->getType() == Gats::typeFloat ); Gats::Float *pFlt = dynamic_cast(pObj); -// printf("In: %a\nOut: %a\n", dVal, pFlt->getValue() ); + Bu::String sHex; + for( Bu::String::iterator i = mb.getString().begin(); i; i++ ) + { + sHex += "0123456789abcdef"[(((uint8_t)*i)>>4)&0x0f]; + sHex += "0123456789abcdef"[(*i)&0x0f]; + sHex += ' '; + } + printf("In: %a\nOut: %a\nRaw: %s\n", dVal, pFlt->getValue(), sHex.getStr() ); if( isnan( dVal ) ) unitTest( isnan(pFlt->getValue()) == isnan(dVal) ); else @@ -46,6 +53,7 @@ suite Basic test positive { rw( 8485738457.0 ); + rw( 63723.0 ); rw( 0.000000000000001928173 ); rw( 1.0 ); rw( 0.0 ); @@ -55,6 +63,7 @@ suite Basic test negitave { rw( -8485738457.0 ); + rw( -63723.0 ); rw( -0.000000000000001928173 ); rw( -1.0 ); rw( -0.0 ); -- cgit v1.2.3