summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-28 18:42:25 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-28 18:42:25 (GMT)
commitd992a4a387d543332c8fcc7e3cdebef5bcc47e7d (patch)
tree865d8ea1a9f1685d8fd37e4cf7a8f36da7e7e271 /test
parent480e8d4c9cf0d4b399de7564cc15c4b372e90f51 (diff)
downloadhdf5-d992a4a387d543332c8fcc7e3cdebef5bcc47e7d.zip
hdf5-d992a4a387d543332c8fcc7e3cdebef5bcc47e7d.tar.gz
hdf5-d992a4a387d543332c8fcc7e3cdebef5bcc47e7d.tar.bz2
[svn-r8427] Purpose:
Bug fix (sorta) Description: Add hack to allow the MS Visual Studio 6 compiler to build the library. It cannot cast unsigned long long values to float or double values. So, add another configuration macro to disable this conversion in the library. Just the "hardware" conversion is disabled, so the library will still correctly convert unsigned long long to float and double values, it will just happen more slowly with the "software" conversion routine. Platforms tested: FreeBSD 4.9 (sleipnir) with "Windows" setting faked inappropriate for h5committest
Diffstat (limited to 'test')
-rw-r--r--test/dtypes.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index 7e0b71b..96a3893 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -4114,10 +4114,12 @@ test_conv_int_float(const char *name, hid_t src, hid_t dst)
HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long));
hw_float = (float)(*((long_long*)aligned));
break;
+#ifdef H5_ULLONG_TO_FP_CAST_WORKS
case INT_ULLONG:
HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long));
hw_float = (float)(*((unsigned long_long*)aligned));
break;
+#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
default:
break;
}
@@ -4160,10 +4162,12 @@ test_conv_int_float(const char *name, hid_t src, hid_t dst)
HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long));
hw_double = (double)(*((long_long*)aligned));
break;
+#ifdef H5_ULLONG_TO_FP_CAST_WORKS
case INT_ULLONG:
HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long));
hw_double = (double)(*((unsigned long_long*)aligned));
break;
+#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
default:
break;
}
@@ -4206,10 +4210,12 @@ test_conv_int_float(const char *name, hid_t src, hid_t dst)
HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long));
hw_ldouble = (long double)(*((long_long*)aligned));
break;
+#ifdef H5_ULLONG_TO_FP_CAST_WORKS
case INT_ULLONG:
HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long));
hw_ldouble = (long double)(*((unsigned long_long*)aligned));
break;
+#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
default:
break;
}
@@ -5583,8 +5589,26 @@ run_int_float_conv(const char *name)
nerrors += test_conv_int_float(name, H5T_NATIVE_LLONG, H5T_NATIVE_FLOAT);
nerrors += test_conv_int_float(name, H5T_NATIVE_LLONG, H5T_NATIVE_DOUBLE);
+#ifdef H5_ULLONG_TO_FP_CAST_WORKS
nerrors += test_conv_int_float(name, H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT);
nerrors += test_conv_int_float(name, H5T_NATIVE_ULLONG, H5T_NATIVE_DOUBLE);
+#else /* H5_ULLONG_TO_FP_CAST_WORKS */
+ {
+ char str[256]; /*hello string */
+
+ sprintf(str, "Testing random %s %s -> %s conversions",
+ name, "unsigned long long", "float");
+ printf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to compiler not handling conversion.");
+
+ sprintf(str, "Testing random %s %s -> %s conversions",
+ name, "unsigned long long", "double");
+ printf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to compiler not handling conversion.");
+ }
+#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
#endif
return nerrors;