diff options
Diffstat (limited to 'test/dt_arith.c')
-rw-r--r-- | test/dt_arith.c | 96 |
1 files changed, 64 insertions, 32 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c index be795dd..5ae401b 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -296,8 +296,8 @@ static int without_hardware_g = 0; HDmemset(BUF, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \ HDmemset(SAVED, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \ \ - tmp1 = (unsigned char*)calloc((size_t)1, (size_t)SRC_SIZE); \ - tmp2 = (unsigned char*)calloc((size_t)1, (size_t)SRC_SIZE); \ + tmp1 = (unsigned char*)HDcalloc((size_t)1, (size_t)SRC_SIZE); \ + tmp2 = (unsigned char*)HDcalloc((size_t)1, (size_t)SRC_SIZE); \ \ buf_p = BUF; \ saved_p = SAVED; \ @@ -325,8 +325,8 @@ static int without_hardware_g = 0; buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ } \ - free(tmp1); \ - free(tmp2); \ + HDfree(tmp1); \ + HDfree(tmp2); \ } /* Allocate buffer and initialize it with floating-point special values, +/-0, +/-infinity, @@ -348,7 +348,7 @@ static int without_hardware_g = 0; SAVED = (unsigned char*)aligned_malloc( NELMTS*MAX(SRC_SIZE, DST_SIZE)); \ HDmemset(BUF, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \ HDmemset(SAVED, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \ - value = (unsigned char*)calloc(SRC_SIZE, sizeof(unsigned char)); \ + value = (unsigned char*)HDcalloc(SRC_SIZE, sizeof(unsigned char)); \ \ buf_p = BUF; \ \ @@ -391,7 +391,7 @@ static int without_hardware_g = 0; } \ \ HDmemcpy(SAVED, BUF, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \ - free(value); \ + HDfree(value); \ } void some_dummy_func(float x); @@ -757,8 +757,8 @@ static int test_particular_fp_integer(void) endian = H5Tget_order(H5T_NATIVE_DOUBLE); src_size1 = H5Tget_size(H5T_NATIVE_DOUBLE); dst_size1 = H5Tget_size(H5T_NATIVE_SCHAR); - buf1 = (unsigned char*)calloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); - saved_buf1 = (unsigned char*)calloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); + buf1 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); + saved_buf1 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); memcpy(buf1, &src_d, src_size1); memcpy(saved_buf1, &src_d, src_size1); @@ -807,8 +807,8 @@ static int test_particular_fp_integer(void) /* Test conversion from float (the value is INT_MAX) to int. */ src_size2 = H5Tget_size(H5T_NATIVE_FLOAT); dst_size2 = H5Tget_size(H5T_NATIVE_INT); - buf2 = (unsigned char*)calloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); - saved_buf2 = (unsigned char*)calloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); + buf2 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); + saved_buf2 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); HDmemcpy(buf2, &src_f, src_size2); HDmemcpy(saved_buf2, &src_f, src_size2); @@ -858,13 +858,13 @@ static int test_particular_fp_integer(void) } if(buf1) - free(buf1); + HDfree(buf1); if(buf2) - free(buf2); + HDfree(buf2); if(saved_buf1) - free(saved_buf1); + HDfree(saved_buf1); if(saved_buf2) - free(saved_buf2); + HDfree(saved_buf2); PASSED(); return 0; @@ -875,13 +875,13 @@ error: H5Pclose(dxpl_id); } H5E_END_TRY; if(buf1) - free(buf1); + HDfree(buf1); if(buf2) - free(buf2); + HDfree(buf2); if(saved_buf1) - free(saved_buf1); + HDfree(saved_buf1); if(saved_buf2) - free(saved_buf2); + HDfree(saved_buf2); reset_hdf5(); /*print statistics*/ return MAX((int)fails_this_test, 1); @@ -1111,9 +1111,9 @@ test_derived_flt(void) } fails_this_test = 0; - free(buf); - free(saved_buf); - free(aligned); + HDfree(buf); + HDfree(saved_buf); + HDfree(aligned); buf = NULL; saved_buf = NULL; aligned = NULL; @@ -1274,8 +1274,8 @@ test_derived_flt(void) } } - if (buf) free(buf); - if (saved_buf) free(saved_buf); + if (buf) HDfree(buf); + if (saved_buf) HDfree(saved_buf); if(H5Tclose(tid1) < 0) { H5_FAILED(); @@ -1307,9 +1307,9 @@ test_derived_flt(void) return 0; error: - if (buf) free(buf); - if (saved_buf) free(saved_buf); - if (aligned) free(aligned); + if (buf) HDfree(buf); + if (saved_buf) HDfree(saved_buf); + if (aligned) HDfree(aligned); HDfflush(stdout); H5E_BEGIN_TRY { H5Tclose (tid1); @@ -1600,8 +1600,8 @@ test_derived_integer(void) goto error; } /* end if */ - free(buf); - free(saved_buf); + HDfree(buf); + HDfree(saved_buf); PASSED(); reset_hdf5(); /*print statistics*/ @@ -1609,8 +1609,8 @@ test_derived_integer(void) return 0; error: - if (buf) free(buf); - if (saved_buf) free(saved_buf); + if (buf) HDfree(buf); + if (saved_buf) HDfree(saved_buf); HDfflush(stdout); H5E_BEGIN_TRY { H5Tclose (tid1); @@ -1859,6 +1859,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_UCHAR==dst_type) { @@ -1909,6 +1910,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_SHORT==dst_type) { @@ -1960,6 +1962,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_USHORT==dst_type) { @@ -2010,6 +2013,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_INT==dst_type) { @@ -2060,6 +2064,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_UINT==dst_type) { @@ -2110,6 +2115,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_LONG==dst_type) { @@ -2160,6 +2166,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_ULONG==dst_type) { @@ -2210,6 +2217,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_LLONG==dst_type) { @@ -2260,6 +2268,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_ULLONG==dst_type) { @@ -2310,6 +2319,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } @@ -2488,6 +2498,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } @@ -2541,6 +2552,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } @@ -2584,6 +2596,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } @@ -2777,7 +2790,7 @@ my_isinf(int endian, unsigned char *val, size_t size, int retval = 0; size_t i; - bits = (unsigned char*)calloc((size_t)1, size); + bits = (unsigned char*)HDcalloc((size_t)1, size); #ifdef H5_VMS if(H5T_ORDER_VAX==endian) { @@ -2801,7 +2814,7 @@ my_isinf(int endian, unsigned char *val, size_t size, H5T__bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0) retval = 1; - free(bits); + HDfree(bits); return retval; } @@ -3881,6 +3894,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (FLT_DOUBLE==dst_type) { @@ -3933,6 +3947,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } #if H5_SIZEOF_LONG_DOUBLE !=0 @@ -3986,6 +4001,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } #endif @@ -4018,6 +4034,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_UCHAR==dst_type) { @@ -4049,6 +4066,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_SHORT==dst_type) { @@ -4080,6 +4098,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_USHORT==dst_type) { @@ -4111,6 +4130,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_INT==dst_type) { @@ -4142,6 +4162,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_UINT==dst_type) { @@ -4173,6 +4194,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_LONG==dst_type) { @@ -4204,6 +4226,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_ULONG==dst_type) { @@ -4235,6 +4258,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_LLONG==dst_type) { @@ -4266,6 +4290,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_ULLONG==dst_type) { @@ -4297,6 +4322,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } @@ -4586,6 +4612,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; #endif case OTHER: + default: + HDassert(0 && "Unknown type"); break; } @@ -4649,6 +4677,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; #endif case OTHER: + default: + HDassert(0 && "Unknown type"); break; } @@ -4699,6 +4729,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; #endif case OTHER: + default: + HDassert(0 && "Unknown type"); break; } |