diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2005-02-11 16:59:50 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2005-02-11 16:59:50 (GMT) |
commit | 54f376edbb1bce24bff19fb6b7c3d298470356be (patch) | |
tree | fa7c4e208f75f806431fe60c30ea82500413709a /test | |
parent | 9bda1fcfd86752983d8d49232e0fb520da28dce6 (diff) | |
download | hdf5-54f376edbb1bce24bff19fb6b7c3d298470356be.zip hdf5-54f376edbb1bce24bff19fb6b7c3d298470356be.tar.gz hdf5-54f376edbb1bce24bff19fb6b7c3d298470356be.tar.bz2 |
[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
Diffstat (limited to 'test')
-rw-r--r-- | test/dtypes.c | 16 |
1 files 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<dst_size; q++) { + buf[j*dst_size+q] = 0x00; + } } /* Are the two results the same? */ |