From 54f0b6c66d3b1746b326b7f7a1072854376a15d7 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 30 Mar 2005 17:22:42 -0500 Subject: [svn-r10512] Purpose: Bug fix Description: In test_conv_int_float(), when testing special floating-point value NaN, the test program couldn't detect it for Linux Intel compiler when it's optimized. The reason is in my_isnan(), a printf command used "%LLg" to print "long double". Solution: Changed it to "%Lg". Also differentiate cases for NaN, using exception handler if present, decide if software conversion set converted integer to 0, or simply skip for hardware conversion. Platforms tested: heping - simple change. --- test/dtypes.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/test/dtypes.c b/test/dtypes.c index 58a03d4..627d7bf 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -5737,7 +5737,7 @@ my_isnan(dtype_t type, void *val) } else if (FLT_LDOUBLE==type) { long double x; HDmemcpy(&x, val, sizeof(long double)); - sprintf(s, "%LLg", x); + sprintf(s, "%Lg", x); #endif } else { return 0; @@ -6617,9 +6617,6 @@ test_conv_int_float(const char *name, hbool_t run_special, hid_t src, hid_t dst) /* Check the results from the library against hardware */ for (j=0; j