From 705b9ec0c98ee78acbe4824c482f23b284dbd190 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 25 Mar 2005 12:53:19 -0500 Subject: [svn-r10445] Purpose: Bug fix Description: In test_conv_flt_1() in dtypes.c, the case of Intel-Linux or AMD-Linux "long double" wasn't considered. The precision is smaller than the size. There may be some garbage left in the unused bytes during hardware conversion. Solution: Clear those bytes before comparison. Platforms tested: h5committest and mir, modi4. --- test/dtypes.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/test/dtypes.c b/test/dtypes.c index 5cac6e8..911bba0 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -6038,9 +6038,23 @@ test_conv_flt_1 (const char *name, hbool_t run_special, hid_t src, hid_t dst) uflow++; } + /* For Intel machines, the size of "long double" is 12 bytes, precision + * is 80 bits; for Intel IA64 and AMD processors, the size of "long double" + * is 16 bytes, precision is 80 bits. During hardware conversion, the + * last few unused bytes may have garbage in them. Clean them out with + * 0s before compare the values. + */ + if(endian==H5T_ORDER_LE && dst_type==FLT_LDOUBLE) { + int q; + for(q=dst_nbits/8; q