summaryrefslogtreecommitdiffstats
path: root/test/dtypes.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/dtypes.c')
-rw-r--r--test/dtypes.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index 255ef8e..f247bd9 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -1925,12 +1925,12 @@ test_compound_10(void)
for(i=0; i<ARRAY_DIM; i++) {
wdata[i].i1 = i*10+i;
wdata[i].str = HDstrdup("C string A");
- wdata[i].str[9] += (char)i;
+ wdata[i].str[9] = (char)(wdata[i].str[9] + i);
wdata[i].i2 = i*1000+i*10;
wdata[i].text.p = (void*)HDstrdup("variable-length text A\0");
len = wdata[i].text.len = HDstrlen((char*)wdata[i].text.p)+1;
- ((char*)(wdata[i].text.p))[len-2] += (char)i;
+ ((char *)(wdata[i].text.p))[len - 2] = (char)(((char *)(wdata[i].text.p))[len - 2] + i);
((char*)(wdata[i].text.p))[len-1] = '\0';
}
@@ -2183,7 +2183,7 @@ test_compound_11(void)
/* Verify converted buffer is correct */
for(u=0; u<NTESTELEM; u++) {
- if(((big_t *)buf_orig)[u].d1!=((little_t *)buf)[u].d1) {
+ if(!H5_DBL_ABS_EQUAL(((big_t *)buf_orig)[u].d1, ((little_t *)buf)[u].d1)) {
printf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].d1,(unsigned)u,((little_t *)buf)[u].d1);
TEST_ERROR
@@ -2227,7 +2227,7 @@ test_compound_11(void)
/* Verify converted buffer is correct */
for(u=0; u<NTESTELEM; u++) {
- if(((big_t *)buf_orig)[u].d1!=((little_t *)buf)[u].d1) {
+ if(!H5_DBL_ABS_EQUAL(((big_t *)buf_orig)[u].d1, ((little_t *)buf)[u].d1)) {
printf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].d1,(unsigned)u,((little_t *)buf)[u].d1);
TEST_ERROR
@@ -2265,7 +2265,7 @@ test_compound_11(void)
/* Verify converted buffer is correct */
for(u=0; u<NTESTELEM; u++) {
- if(((big_t *)buf_orig)[u].d1!=((little_t *)buf)[u].d1) {
+ if(!H5_DBL_ABS_EQUAL(((big_t *)buf_orig)[u].d1, ((little_t *)buf)[u].d1)) {
printf("Error, line #%d: buf_orig[%u].d1=%f, buf[%u].d1=%f\n",__LINE__,
(unsigned)u,((big_t *)buf_orig)[u].d1,(unsigned)u,((little_t *)buf)[u].d1);
TEST_ERROR
@@ -2487,7 +2487,7 @@ test_compound_13(void)
/* Check the data. */
for (u = 0; u < COMPOUND13_ARRAY_SIZE + 1; u++)
if(data_out.x[u] != data_in.x[u]) TEST_ERROR
- if(data_out.y != data_in.y) TEST_ERROR
+ if(!H5_FLT_ABS_EQUAL(data_out.y, data_in.y)) TEST_ERROR
/* Release all resources. */
if(H5Aclose(attid) < 0) FAIL_STACK_ERROR
@@ -6113,7 +6113,7 @@ test_int_float_except(void)
/* Check the buffer after conversion, as floats */
for(u = 0; u < CONVERT_SIZE; u++) {
floatp = (float *)&buf[u];
- if(*floatp != buf_float[u]) TEST_ERROR
+ if(!H5_FLT_ABS_EQUAL(*floatp, buf_float[u])) TEST_ERROR
} /* end for */
/* Check for proper exceptions */
@@ -6134,7 +6134,7 @@ test_int_float_except(void)
/* Check the buffer after conversion, as floats */
for(u = 0; u < CONVERT_SIZE; u++) {
floatp = (float *)&buf2[u];
- if(*floatp != buf2_float[u]) TEST_ERROR
+ if(!H5_FLT_ABS_EQUAL(*floatp, buf2_float[u])) TEST_ERROR
} /* end for */
/* Check for proper exceptions */