From 54f376edbb1bce24bff19fb6b7c3d298470356be Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 11 Feb 2005 11:59:50 -0500 Subject: [svn-r9987] Purpose: bug fix Description: For hardware conversion from integers to "long double" on AMD machine, the test failed because the size of "long double"(can be 16 bytes) is bigger than the precision(80 bits). There can be some garbage in the unused bytes in "long double". That caused failure during byte comparison. Solution: Clean these unused bytes before comparison. Platforms tested: mir and fuss; simple change --- test/dtypes.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/dtypes.c b/test/dtypes.c index f1a7ca0..f5bfb3c 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -6618,13 +6618,17 @@ test_conv_int_float(const char *name, hid_t src, hid_t dst) /* Make certain that there isn't some weird number of destination bits */ assert(dst_nbits%8==0); - /* For Intel machines, the size of "long double" is 12 byte, precision - * is 80 bits. During hardware conversion, the last 2 byte may have - * garbage in them. Clean them out with 0s before compare the values. + /* For Intel machines, the size of "long double" is 12 bytes, precision + * is 80 bits; for 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 && dst_size==12) { - buf[j*dst_size+10] = 0x00; - buf[j*dst_size+11] = 0x00; + if(endian==H5T_ORDER_LE && dst_type==FLT_LDOUBLE) { + int q; + for(q=10; q