diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2014-07-30 20:56:40 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2014-07-30 20:56:40 (GMT) |
commit | e8c162613b75fb3b269830defa769728f439db72 (patch) | |
tree | 7c02108c8d1012fb7e8a2b54c5503a5c2f5c019c /test | |
parent | ff1a9ae0e74ded0274729313ba24df578ffaf678 (diff) | |
download | hdf5-e8c162613b75fb3b269830defa769728f439db72.zip hdf5-e8c162613b75fb3b269830defa769728f439db72.tar.gz hdf5-e8c162613b75fb3b269830defa769728f439db72.tar.bz2 |
[svn-r25497] Description:
Merge changes that correspond to the 64-bit ID changes (without the actual
switch to 64-bit IDs) to the 1.8 release branch. (Plus a few minor cleanups
and alignments with the trunk that aren't on the branch)
Tested on:
Mac OSX/64 10.9.4 (amazon) w/C++ & FORTRAN
(h5committested on branch already for a week)
Diffstat (limited to 'test')
-rw-r--r-- | test/cache_api.c | 14 | ||||
-rw-r--r-- | test/cmpd_dset.c | 34 | ||||
-rw-r--r-- | test/dsets.c | 12 | ||||
-rw-r--r-- | test/dt_arith.c | 96 | ||||
-rw-r--r-- | test/dtypes.c | 88 | ||||
-rw-r--r-- | test/dynlib2.c | 3 | ||||
-rw-r--r-- | test/dynlib3.c | 3 | ||||
-rw-r--r-- | test/err_compat.c | 2 | ||||
-rw-r--r-- | test/error_test.c | 2 | ||||
-rw-r--r-- | test/file_image.c | 2 | ||||
-rw-r--r-- | test/fillval.c | 28 | ||||
-rw-r--r-- | test/filter_fail.c | 5 | ||||
-rw-r--r-- | test/getname.c | 16 | ||||
-rw-r--r-- | test/h5test.c | 6 | ||||
-rw-r--r-- | test/links.c | 122 | ||||
-rw-r--r-- | test/ntypes.c | 6 | ||||
-rw-r--r-- | test/objcopy.c | 16 | ||||
-rw-r--r-- | test/tarray.c | 6 | ||||
-rw-r--r-- | test/tattr.c | 18 | ||||
-rw-r--r-- | test/tconfig.c | 4 | ||||
-rw-r--r-- | test/tcoords.c | 22 | ||||
-rw-r--r-- | test/tfile.c | 22 | ||||
-rw-r--r-- | test/tgenprop.c | 2 | ||||
-rw-r--r-- | test/tid.c | 24 | ||||
-rw-r--r-- | test/tmisc.c | 4 | ||||
-rw-r--r-- | test/trefer.c | 107 | ||||
-rw-r--r-- | test/tselect.c | 447 | ||||
-rw-r--r-- | test/ttsafe.c | 80 | ||||
-rw-r--r-- | test/ttsafe_acreate.c | 4 | ||||
-rw-r--r-- | test/ttsafe_cancel.c | 4 | ||||
-rw-r--r-- | test/tunicode.c | 2 |
31 files changed, 617 insertions, 584 deletions
diff --git a/test/cache_api.c b/test/cache_api.c index 66f8143..b1ccef1 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -3038,7 +3038,7 @@ check_fapl_mdc_api_errs(void) if ( pass ) { H5E_BEGIN_TRY { - result = H5Pget_mdc_config(-1, &scratch); + result = H5Pget_mdc_config((hid_t)-1, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -3109,7 +3109,7 @@ check_fapl_mdc_api_errs(void) if ( pass ) { H5E_BEGIN_TRY { - result = H5Pset_mdc_config(-1, &default_config); + result = H5Pset_mdc_config((hid_t)-1, &default_config); } H5E_END_TRY; if ( result >= 0 ) { @@ -3258,7 +3258,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fget_mdc_config(-1, &scratch); + result = H5Fget_mdc_config((hid_t)-1, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -3317,7 +3317,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fset_mdc_config(-1, &default_config); + result = H5Fset_mdc_config((hid_t)-1, &default_config); } H5E_END_TRY; if ( result >= 0 ) { @@ -3385,7 +3385,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fget_mdc_hit_rate(-1, &hit_rate); + result = H5Fget_mdc_hit_rate((hid_t)-1, &hit_rate); } H5E_END_TRY; if ( result >= 0 ) { @@ -3425,7 +3425,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Freset_mdc_hit_rate_stats(-1); + result = H5Freset_mdc_hit_rate_stats((hid_t)-1); } H5E_END_TRY; if ( result >= 0 ) { @@ -3446,7 +3446,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fget_mdc_size(-1, &max_size, &min_clean_size, + result = H5Fget_mdc_size((hid_t)-1, &max_size, &min_clean_size, &cur_size, &cur_num_entries); } H5E_END_TRY; diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 433c488..a782fb0 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -614,7 +614,7 @@ test_compound (char *filename, hid_t fapl) if ((s8_m_sid = H5Screate_simple (2, h_size, NULL)) < 0) goto error; /* Read the dataset */ - s8 = (s1_t *) calloc ((size_t)(h_size[0]*h_size[1]), sizeof(s1_t)); + s8 = (s1_t *) HDcalloc ((size_t)(h_size[0]*h_size[1]), sizeof(s1_t)); assert (s8); if (H5Dread (dataset, s1_tid, s8_m_sid, s8_f_sid, H5P_DEFAULT, s8) < 0) { goto error; @@ -641,7 +641,7 @@ test_compound (char *filename, hid_t fapl) } } - free (s8); + HDfree (s8); s8 = NULL; PASSED(); @@ -781,7 +781,7 @@ test_compound (char *filename, hid_t fapl) f_offset[1] = NY/3; h_size[0] = 2*NX/3 - f_offset[0]; h_size[1] = 2*NY/3 - f_offset[1]; - s11 = (s4_t *) malloc ((size_t)h_size[0]*(size_t)h_size[1]*sizeof(s4_t)); + s11 = (s4_t *) HDmalloc ((size_t)h_size[0]*(size_t)h_size[1]*sizeof(s4_t)); assert (s11); /* Initialize */ @@ -793,7 +793,7 @@ test_compound (char *filename, hid_t fapl) if (H5Dwrite (dataset, s4_tid, s8_m_sid, s8_f_sid, PRESERVE, s11) < 0) { goto error; } - free (s11); + HDfree (s11); s11=NULL; /* Read the whole thing */ @@ -1380,12 +1380,12 @@ test_hdf5_src_subset(char *filename, hid_t fapl) goto error; /* Allocate space and initialize data */ - orig = (unsigned char*)malloc(NX * NY * sizeof(stype1)); + orig = (unsigned char*)HDmalloc(NX * NY * sizeof(stype1)); initialize_stype1(orig, (size_t)NX*NY); - rbuf = (unsigned char*)malloc(NX * NY * sizeof(stype2)); + rbuf = (unsigned char*)HDmalloc(NX * NY * sizeof(stype2)); - rew_buf = (unsigned char*)malloc(NX * NY * sizeof(stype3)); + rew_buf = (unsigned char*)HDmalloc(NX * NY * sizeof(stype3)); initialize_stype3(rew_buf, (size_t)NX*NY); @@ -1515,9 +1515,9 @@ test_hdf5_src_subset(char *filename, hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - free(orig); - free(rbuf); - free(rew_buf); + HDfree(orig); + HDfree(rbuf); + HDfree(rew_buf); PASSED(); return 0; @@ -1585,12 +1585,12 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) goto error; /* Allocate space and initialize data */ - orig = (unsigned char*)malloc(NX * NY * sizeof(stype2)); + orig = (unsigned char*)HDmalloc(NX * NY * sizeof(stype2)); initialize_stype2(orig, (size_t)NX*NY); - rbuf = (unsigned char*)malloc(NX * NY * sizeof(stype1)); + rbuf = (unsigned char*)HDmalloc(NX * NY * sizeof(stype1)); - rew_buf = (unsigned char*)malloc(NX * NY * sizeof(stype4)); + rew_buf = (unsigned char*)HDmalloc(NX * NY * sizeof(stype4)); initialize_stype4(rew_buf, (size_t)NX*NY); /* Create dataset creation property list */ @@ -1719,9 +1719,9 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) if(H5Fclose(file) < 0) goto error; - free(orig); - free(rbuf); - free(rew_buf); + HDfree(orig); + HDfree(rbuf); + HDfree(rew_buf); PASSED(); return 0; @@ -2183,7 +2183,7 @@ main (int argc, char *argv[]) fprintf(stderr, "usage: %s [--noopt]\n", argv[0]); exit(1); } - H5Tunregister(H5T_PERS_DONTCARE, NULL, -1, -1, H5T__conv_struct_opt); + H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1, H5T__conv_struct_opt); } /* Create the file */ diff --git a/test/dsets.c b/test/dsets.c index b41e883..8ba79c3 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -483,7 +483,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) HDclose(f); - free (tconv_buf); + HDfree (tconv_buf); PASSED(); } /* end if */ else { @@ -1854,13 +1854,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(H5Dclose (dataset) < 0) goto error; if(H5Sclose (sid) < 0) goto error; if(H5Pclose (dxpl) < 0) goto error; - free (tconv_buf); + HDfree (tconv_buf); return(0); error: if(tconv_buf) - free (tconv_buf); + HDfree (tconv_buf); return -1; } @@ -3856,7 +3856,7 @@ test_nbit_compound_3(hid_t file) for(k = 0; k < (i+1); k++) ((unsigned int *)orig_data[i].v.p)[k] = (unsigned int)(i*100 + k); /* Create reference to the dataset "nbit_obj_ref" */ - if(H5Rcreate(&orig_data[i].r, file, "nbit_obj_ref", H5R_OBJECT, -1) < 0) goto error; + if(H5Rcreate(&orig_data[i].r, file, "nbit_obj_ref", H5R_OBJECT, (hid_t)-1) < 0) goto error; for(j = 0; j < 5; j++) orig_data[i].o[j] = (unsigned char)(i + j); } @@ -6547,7 +6547,7 @@ auxread_fdata(hid_t fid, const char *name) if(H5Dclose(dset_id) < 0) goto error; if(buf) - free(buf); + HDfree(buf); return 0; @@ -6559,7 +6559,7 @@ error: H5Tclose(ftype_id); H5Tclose(mtype_id); if(buf) - free(buf); + HDfree(buf); } H5E_END_TRY; return -1; } 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; } diff --git a/test/dtypes.c b/test/dtypes.c index de81bd5..52e7983 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -697,9 +697,9 @@ test_compound_2(void) FAIL_STACK_ERROR /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))); - bkg = (unsigned char*)malloc(nelmts * sizeof(struct dt)); - orig = (unsigned char*)malloc(nelmts * sizeof(struct st)); + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st)); for (i=0; i<(int)nelmts; i++) { s_ptr = ((struct st*)orig) + i; s_ptr->a = i*8+0; @@ -762,9 +762,9 @@ test_compound_2(void) } /* Release resources */ - free(buf); - free(bkg); - free(orig); + HDfree(buf); + HDfree(bkg); + HDfree(orig); CHECK_NMEMBS(nmembs , st, dt) PASSED(); @@ -818,9 +818,9 @@ test_compound_3(void) FAIL_STACK_ERROR /* Initialize */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))); - bkg = (unsigned char*)malloc(nelmts * sizeof(struct dt)); - orig = (unsigned char*)malloc(nelmts * sizeof(struct st)); + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st)); for (i=0; i<(int)nelmts; i++) { s_ptr = ((struct st*)orig) + i; s_ptr->a = i*8+0; @@ -880,9 +880,9 @@ test_compound_3(void) } /* Release resources */ - free(buf); - free(bkg); - free(orig); + HDfree(buf); + HDfree(bkg); + HDfree(orig); CHECK_NMEMBS(nmembs, st, dt) PASSED(); @@ -940,9 +940,9 @@ test_compound_4(void) FAIL_STACK_ERROR /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))); - bkg = (unsigned char*)malloc(nelmts * sizeof(struct dt)); - orig = (unsigned char*)malloc(nelmts * sizeof(struct st)); + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st)); for (i=0; i<(int)nelmts; i++) { s_ptr = ((struct st*)orig) + i; s_ptr->a = i*8+0; @@ -1006,9 +1006,9 @@ test_compound_4(void) } /* Release resources */ - free(buf); - free(bkg); - free(orig); + HDfree(buf); + HDfree(bkg); + HDfree(orig); CHECK_NMEMBS(nmembs, st, dt) PASSED(); @@ -1066,14 +1066,7 @@ test_compound_5(void) void *bkg = HDcalloc((size_t)2, sizeof(dst_type_t)); int retval = 1; -#if 1 TESTING("optimized struct converter"); -#else - /* Turn off optimized compound conversion function to work around - * the problem. */ - TESTING("optimized struct converter bug workaround"); - H5Tunregister(H5T_PERS_DONTCARE, "struct(opt)", -1, -1, NULL); -#endif /* Build datatypes */ short_array = H5Tcreate(H5T_COMPOUND, 4*sizeof(short)); @@ -1175,9 +1168,9 @@ test_compound_6(void) FAIL_STACK_ERROR /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))); - bkg = (unsigned char*)malloc(nelmts * sizeof(struct dt)); - orig = (unsigned char*)malloc(nelmts * sizeof(struct st)); + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st)); for (i=0; i<(int)nelmts; i++) { s_ptr = ((struct st*)orig) + i; s_ptr->b = (i*8+1) & 0x7fff; @@ -1223,9 +1216,9 @@ test_compound_6(void) } /* Release resources */ - free(buf); - free(bkg); - free(orig); + HDfree(buf); + HDfree(bkg); + HDfree(orig); CHECK_NMEMBS(nmembs, st, dt) PASSED(); @@ -1408,8 +1401,7 @@ test_compound_8(void) char c; s1 d; } s2; - - hid_t tid1, tid1_copy, tid2, tid2_copy, tid3, arr_tid; + hid_t tid1, tid1_copy, tid2, tid2_copy, tid3, arr_tid; size_t tsize; hsize_t dims[1] = {ARRAY_DIM}; herr_t ret; @@ -1561,7 +1553,7 @@ test_compound_8(void) if(tsize != (sizeof(char) + sizeof(char) + sizeof(int))) { H5_FAILED(); AT(); - printf("The size of the packed compound datatype is incorrect: tsize=%d\n", tsize); + printf("The size of the packed compound datatype is incorrect: tsize = %zu\n", tsize); goto error; } /* end if */ @@ -1791,7 +1783,7 @@ test_compound_9(void) } /* end if */ rdata.i1 = rdata.i2 = 0; - if(rdata.str) free(rdata.str); + if(rdata.str) HDfree(rdata.str); if(H5Dread(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); AT(); @@ -1805,7 +1797,7 @@ test_compound_9(void) goto error; } /* end if */ - if(rdata.str) free(rdata.str); + if(rdata.str) HDfree(rdata.str); if(H5Dclose(dset_id) < 0) goto error; @@ -1984,10 +1976,10 @@ test_compound_10(void) goto error; } - free(t1); - free(t2); - free(wdata[i].str); - free(rdata[i].str); + HDfree(t1); + HDfree(t2); + HDfree(wdata[i].str); + HDfree(rdata[i].str); } /* end for */ if(H5Dclose(dset_id) < 0) @@ -4548,7 +4540,7 @@ test_conv_enum_2(void) H5Tenum_insert(dsttype, mname[i], &i); /* Source data */ - data = (int*)malloc(NTESTELEM*sizeof(int)); + data = (int*)HDmalloc(NTESTELEM*sizeof(int)); for (i=0; i<NTESTELEM; i++) { ((char*)data)[i*3+2] = (char)(i % 8); ((char*)data)[i*3+0] = 0; @@ -4570,7 +4562,7 @@ test_conv_enum_2(void) } /* Cleanup */ - free(data); + HDfree(data); H5Tclose(srctype); H5Tclose(dsttype); H5Tclose(oddsize); @@ -5387,7 +5379,7 @@ test_encode(void) printf("Can't close datatype\n"); goto error; } /* end if */ - free(cmpd_buf); + HDfree(cmpd_buf); cmpd_buf_size = 0; /* Commit enumeration datatype and close it */ @@ -5406,7 +5398,7 @@ test_encode(void) printf("Can't close datatype\n"); goto error; } /* end if */ - free(enum_buf); + HDfree(enum_buf); enum_buf_size = 0; /* Commit enumeration datatype and close it */ @@ -5425,7 +5417,7 @@ test_encode(void) printf("Can't close datatype\n"); goto error; } /* end if */ - free(vlstr_buf); + HDfree(vlstr_buf); vlstr_buf_size = 0; /* Open the dataytpe for query */ @@ -5543,7 +5535,7 @@ test_encode(void) printf("Can't decode VL string type\n"); goto error; } /* end if */ - free(vlstr_buf); + HDfree(vlstr_buf); /* Verify that the datatype was copied exactly */ if(H5Tequal(decoded_tid3, tid3)<=0) { @@ -5656,8 +5648,8 @@ test_encode(void) goto error; } /* end if */ - free(cmpd_buf); - free(enum_buf); + HDfree(cmpd_buf); + HDfree(enum_buf); PASSED(); return 0; diff --git a/test/dynlib2.c b/test/dynlib2.c index a853ed0..0d8be2b 100644 --- a/test/dynlib2.c +++ b/test/dynlib2.c @@ -71,6 +71,9 @@ H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, if(cd_nelmts > 0) return(0); + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + if(flags & H5Z_FLAG_REVERSE) { /*read*/ /* Divide the original value with MULTIPLIER */ while(buf_left > 0) { diff --git a/test/dynlib3.c b/test/dynlib3.c index 9560b86..b3a02ed 100644 --- a/test/dynlib3.c +++ b/test/dynlib3.c @@ -71,6 +71,9 @@ H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, if(cd_nelmts > 0) return(0); + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + if(flags & H5Z_FLAG_REVERSE) { /*read*/ ret_value = *buf_size = nbytes - SUFFIX_LEN; } /* end if */ diff --git a/test/err_compat.c b/test/err_compat.c index 346d397..576433e 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -40,7 +40,7 @@ const char *FILENAME[] = { int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1]; #define DSET_NAME "a_dataset" -#define FAKE_ID -1 +#define FAKE_ID (hid_t)-1 herr_t custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data); herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data); diff --git a/test/error_test.c b/test/error_test.c index 1ca9686..0d945d2 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -57,7 +57,7 @@ hid_t ERR_MIN_WRITE; hid_t ERR_MIN_GETNUM; #define DSET_NAME "a_dataset" -#define FAKE_ID 0 +#define FAKE_ID (hid_t)0 #define ERR_CLS_NAME "Error Test" #define ERR_CLS2_NAME "Second Test" diff --git a/test/file_image.c b/test/file_image.c index d4056a7..b1b9d47 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -557,7 +557,7 @@ test_core(void) /* Append ".copy" to the filename from the source directory */ VERIFY(HDstrlen(filename) < (1023 - 5), "file name too long."); - HDstrncpy(copied_filename, filename, 1023); + HDstrncpy(copied_filename, filename, (size_t)1023); copied_filename[1023] = '\0'; HDstrcat(copied_filename, ".copy"); diff --git a/test/fillval.c b/test/fillval.c index c69f409..b73ed17 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -469,7 +469,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) /* 6. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. * Supposed to fail. */ - if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; + if(H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0) goto error; if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; H5E_BEGIN_TRY { if(H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)!=FAIL) @@ -510,7 +510,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) /* 4. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. * Supposed to fail. */ - if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; + if(H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0) goto error; H5E_BEGIN_TRY { if(H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)!=FAIL) goto error; @@ -1111,34 +1111,34 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; fillval = 0; nerrors += test_rdwr_cases(file, dcpl, "dset1", &fillval, H5D_FILL_TIME_ALLOC, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset2", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; fillval = 0x4c70f1cd; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset3", &fillval, H5D_FILL_TIME_ALLOC, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value is user-defined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset4", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is undefined */ /* This case has been tested in test_create() function */ /* case for H5D_FILL_TIME_NEVER as fill write time and fill value is undefined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; - if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; + if(H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset5", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined * as compound type */ @@ -1164,34 +1164,34 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; fillval = 0; nerrors += test_rdwr_cases(file, dcpl, "dset6", &fillval, H5D_FILL_TIME_ALLOC, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset7", &fillval, H5D_FILL_TIME_NEVER, layout, - H5T_INTEGER, -1); + H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; fillval = 0x4c70f1cd; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset8", &fillval, H5D_FILL_TIME_ALLOC, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value is user-defined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset9", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is undefined */ /* This case has been tested in test_create() function */ /* case for H5D_FILL_TIME_NEVER as fill write time and fill value is undefined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; - if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; + if(H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset10", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined * as compound type */ diff --git a/test/filter_fail.c b/test/filter_fail.c index 67e1dda..3dbb564 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -65,8 +65,8 @@ const H5Z_class2_t H5Z_FAIL_TEST[1] = {{ *------------------------------------------------------------------------- */ static size_t -filter_fail(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, +filter_fail(unsigned int flags, size_t UNUSED cd_nelmts, + const unsigned int UNUSED *cd_values, size_t nbytes, size_t *buf_size, void **buf) { int *dst = (int*)(*buf); @@ -387,6 +387,7 @@ int main(void) if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) TEST_ERROR + /* Run the test again. */ nerrors += (test_filter_write(filename, fapl, FALSE) < 0 ? 1 : 0); nerrors += (test_filter_read(filename, fapl) < 0 ? 1 : 0); diff --git a/test/getname.c b/test/getname.c index 1abc04a..dac115c 100644 --- a/test/getname.c +++ b/test/getname.c @@ -2487,30 +2487,30 @@ test_obj_ref(hid_t fapl) FAIL_STACK_ERROR /* Create reference to dataset */ - if(H5Rcreate(&wbuf[0], fid1, "/Dataset3", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[0], fid1, "/Dataset3", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Create reference to dataset */ - if(H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Create reference to group */ - if(H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Create reference to named datatype */ - if(H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR - if(H5Rcreate(&wbuf[4], fid1, "/Group1/Group2/Dataset4", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[4], fid1, "/Group1/Group2/Dataset4", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR - if(H5Rcreate(&wbuf[5], fid1, "/Group1/Group2", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[5], fid1, "/Group1/Group2", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR - if(H5Rcreate(&wbuf[6], fid1, "/Group1/Group2/Link/Dataset5", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[6], fid1, "/Group1/Group2/Link/Dataset5", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Create reference to root group */ - if(H5Rcreate(&wbuf[7], fid1, "/", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[7], fid1, "/", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Write selection to disk */ diff --git a/test/h5test.c b/test/h5test.c index 2afda36..fce8c9b 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -623,7 +623,7 @@ h5_fileaccess(void) void h5_no_hwconv(void) { - H5Tunregister(H5T_PERS_HARD, NULL, -1, -1, NULL); + H5Tunregister(H5T_PERS_HARD, NULL, (hid_t)-1, (hid_t)-1, NULL); } @@ -745,7 +745,7 @@ h5_set_info_object(void) /* copy key/value pair into temporary buffer */ len = strcspn(valp, ";"); next = &valp[len]; - key_val = (char *)calloc(1, len + 1); + key_val = (char *)HDcalloc(1, len + 1); /* increment the next pointer past the terminating semicolon */ if (*next == ';') @@ -1113,7 +1113,7 @@ getenv_all(MPI_Comm comm, int root, const char* name) * *------------------------------------------------------------------------- */ -hid_t +int h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ diff --git a/test/links.c b/test/links.c index 9d8b8b1..26bfaa8 100644 --- a/test/links.c +++ b/test/links.c @@ -558,8 +558,8 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ if(H5Lexists(file, "d1", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -574,14 +574,14 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { H5_FAILED(); - puts(" Soft link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Soft link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ if(H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(HDstrcmp(linkval, "/d1")) { H5_FAILED(); - puts(" Soft link test failed. Wrong link value"); + HDputs(" Soft link test failed. Wrong link value"); TEST_ERROR } /* end if */ if(H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -592,7 +592,7 @@ cklinks(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(status >= 0) { H5_FAILED(); - puts(" H5Oget_info_by_name() should have failed for a dangling link."); + HDputs(" H5Oget_info_by_name() should have failed for a dangling link."); TEST_ERROR } /* end if */ if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -608,7 +608,7 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(HDstrcmp(linkval, "foobar")) { H5_FAILED(); - puts(" Dangling link test failed. Wrong link value"); + HDputs(" Dangling link test failed. Wrong link value"); TEST_ERROR } /* end if */ if(H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -619,7 +619,7 @@ cklinks(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(status >= 0) { H5_FAILED(); - puts(" H5Oget_info_by_name() should have failed for a recursive link."); + HDputs(" H5Oget_info_by_name() should have failed for a recursive link."); TEST_ERROR } /* end if */ if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -635,7 +635,7 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(HDstrcmp(linkval, "/grp1/recursive")) { H5_FAILED(); - puts(" Recursive link test failed. Wrong link value"); + HDputs(" Recursive link test failed. Wrong link value"); TEST_ERROR } /* end if */ @@ -700,8 +700,8 @@ ck_new_links(hid_t fapl, hbool_t new_format) } if(H5F_addr_ne(oi_dset.addr, oi_hard1.addr) || H5F_addr_ne(oi_dset.addr, oi_hard2.addr)) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } @@ -905,7 +905,7 @@ toomany(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); TEST_ERROR } /* end if */ @@ -1189,7 +1189,7 @@ test_move(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(moved_grp >= 0) { H5_FAILED(); - puts(" Group still in original location?"); + HDputs(" Group still in original location?"); TEST_ERROR } /* end if */ @@ -1684,8 +1684,8 @@ test_deprec(hid_t fapl, hbool_t new_format) if(HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ @@ -1695,8 +1695,8 @@ test_deprec(hid_t fapl, hbool_t new_format) if(HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ @@ -1812,19 +1812,19 @@ external_link_root(hid_t fapl, hbool_t new_format) if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error; if(H5L_TYPE_EXTERNAL != linfo.type) { H5_FAILED(); - puts(" Unexpected object type - should have been an external link"); + HDputs(" Unexpected object type - should have been an external link"); goto error; } if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR if(HDstrcmp(file, filename1)) { H5_FAILED(); - puts(" External link file name incorrect"); + HDputs(" External link file name incorrect"); goto error; } if(HDstrcmp(path, "/")) { H5_FAILED(); - puts(" External link path incorrect"); + HDputs(" External link path incorrect"); goto error; } @@ -1836,19 +1836,19 @@ external_link_root(hid_t fapl, hbool_t new_format) if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error; if(H5L_TYPE_EXTERNAL != linfo.type) { H5_FAILED(); - puts(" Unexpected object type - should have been an external link"); + HDputs(" Unexpected object type - should have been an external link"); goto error; } if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR if(HDstrcmp(file, filename1)) { H5_FAILED(); - puts(" External link file name incorrect"); + HDputs(" External link file name incorrect"); goto error; } if(HDstrcmp(path, "/")) { H5_FAILED(); - puts(" External link path incorrect"); + HDputs(" External link path incorrect"); goto error; } @@ -2693,7 +2693,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); goto error; } @@ -2703,7 +2703,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); goto error; } @@ -2713,7 +2713,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (status >= 0) { H5_FAILED(); - puts(" Retreiving name of object by index through dangling file external link should have failed."); + HDputs(" Retreiving name of object by index through dangling file external link should have failed."); } /* end if */ /* Close root group */ @@ -2810,7 +2810,7 @@ external_link_prefix(hid_t fapl, hbool_t new_format) /* should be able to find the target file from pathnames set via H5Pset_elink_prefix() */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -2905,7 +2905,7 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) /* should be able to find the target file from absolute path set for main file */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -2991,7 +2991,7 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format) /* should be able to find the target file from the main file's relative pathname */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in current working directory"); + HDputs(" Should have found the file in current working directory"); goto error; } @@ -3083,7 +3083,7 @@ external_link_cwd(hid_t fapl, hbool_t new_format) /* should be able to find the target file from the current working directory */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in current working directory"); + HDputs(" Should have found the file in current working directory"); goto error; } @@ -3179,7 +3179,7 @@ external_link_abstar(hid_t fapl, hbool_t new_format) /* should be able to find the target file with abolute path */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -3273,7 +3273,7 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format) /* should be able to find the target file from main file's current working directory */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in current working directory."); + HDputs(" Should have found the file in current working directory."); goto error; } @@ -3353,7 +3353,7 @@ external_link_reltar(hid_t fapl, hbool_t new_format) /* Open object through external link */ if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } /* end if */ @@ -3450,7 +3450,7 @@ external_link_chdir(hid_t fapl, hbool_t new_format) */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -3625,7 +3625,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) /* should succeed in opening the target object A in the current working directory */ if (oidA < 0) { H5_FAILED(); - puts(" Should succeed in opening family target file A in current working directory"); + HDputs(" Should succeed in opening family target file A in current working directory"); goto error; } @@ -3639,7 +3639,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) /* should succeed in opening the target object B in the current working directory */ if (oidB < 0) { H5_FAILED(); - puts(" Should succeed in opening multi target file B in current working directory"); + HDputs(" Should succeed in opening multi target file B in current working directory"); goto error; } @@ -3785,7 +3785,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) did = H5Dopen2(fid, "ext_link", dapl_id); if(did < 0) { H5_FAILED(); - puts(" Should succeed in opening the target dataset"); + HDputs(" Should succeed in opening the target dataset"); goto error; } @@ -4372,7 +4372,7 @@ external_link_win1(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's CWD*/ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in CWD."); + HDputs(" Should have found the file in CWD."); goto error; } @@ -4466,7 +4466,7 @@ external_link_win2(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -4559,7 +4559,7 @@ external_link_win3(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -4648,7 +4648,7 @@ external_link_win4(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's absolute drive/relative path */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in CWD."); + HDputs(" Should have found the file in CWD."); goto error; } @@ -4744,7 +4744,7 @@ external_link_win5(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's rel drive/abs path */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in CWD."); + HDputs(" Should have found the file in CWD."); goto error; } @@ -4837,7 +4837,7 @@ external_link_win6(hid_t fapl, hbool_t new_format) /* should be able to find the target file via target file's rel path in current drive */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -4924,7 +4924,7 @@ external_link_win7(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's local host/main drive*/ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in local host/main drive."); + HDputs(" Should have found the file in local host/main drive."); goto error; } @@ -5016,7 +5016,7 @@ external_link_win8(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -5103,7 +5103,7 @@ external_link_win9(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's local host/main drive*/ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in local host/main drive."); + HDputs(" Should have found the file in local host/main drive."); goto error; } @@ -5174,7 +5174,7 @@ external_link_recursive(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for recursive external links."); + HDputs(" Should have failed for recursive external links."); goto error; } @@ -5244,7 +5244,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR if (H5L_TYPE_EXTERNAL != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been an external link"); + HDputs(" Unexpected link class - should have been an external link"); goto error; } @@ -5270,7 +5270,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR if(H5L_TYPE_EXTERNAL != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been an external link"); + HDputs(" Unexpected link class - should have been an external link"); goto error; } @@ -5288,7 +5288,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(H5Oget_info_by_name(fid, "src", &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5O_TYPE_GROUP != oi.type) { H5_FAILED(); - puts(" Unexpected object type - should have been a group"); + HDputs(" Unexpected object type - should have been a group"); goto error; } @@ -6077,7 +6077,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) } H5E_END_TRY /* Test H5Rcreate */ - if(H5Rcreate(&obj_ref, fid1, "elink/elink/elink/type1_moved", H5R_OBJECT, (-1)) < 0) TEST_ERROR + if(H5Rcreate(&obj_ref, fid1, "elink/elink/elink/type1_moved", H5R_OBJECT, (hid_t)(-1)) < 0) TEST_ERROR /* Test unlink */ if(H5Ldelete(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT) < 0) TEST_ERROR @@ -6528,7 +6528,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) } /* end if */ else { SKIPPED(); - puts(" Current VFD doesn't support POSIX I/O calls"); + HDputs(" Current VFD doesn't support POSIX I/O calls"); } /* end else */ return 0; @@ -6548,7 +6548,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) return -1; #else /* H5_HAVE_SYMLINK */ SKIPPED(); - puts(" Current file system or operating system doesn't support symbolic links"); + HDputs(" Current file system or operating system doesn't support symbolic links"); return 0; #endif /* H5_HAVE_SYMLINK */ @@ -7587,7 +7587,7 @@ ud_hard_links(hid_t fapl) if(li.u.val_size != 0) TEST_ERROR if(UD_HARD_TYPE != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been a UD hard link"); + HDputs(" Unexpected link class - should have been a UD hard link"); goto error; } /* end if */ @@ -8001,7 +8001,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) if(li.u.val_size != 16) TEST_ERROR if (UD_CB_TYPE != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been a UD hard link"); + HDputs(" Unexpected link class - should have been a UD hard link"); goto error; } @@ -8649,7 +8649,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); goto error; } @@ -10173,7 +10173,7 @@ corder_create_empty(hid_t fapl) } H5E_END_TRY; if(ret > 0) { H5_FAILED(); - puts(" H5Pset_link_create_order() should have failed for a creation order index with no tracking."); + HDputs(" H5Pset_link_create_order() should have failed for a creation order index with no tracking."); TEST_ERROR } /* end if */ @@ -12626,13 +12626,13 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, /* Check for iteration w/bad location ID */ skip = 0; H5E_BEGIN_TRY { - ret = H5Literate((-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); + ret = H5Literate((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); } H5E_END_TRY; if(ret >= 0) TEST_ERROR #ifndef H5_NO_DEPRECATED_SYMBOLS H5E_BEGIN_TRY { - ret = H5Giterate((-1), ".", &gskip, group_iterate_old_cb, iter_info); + ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_cb, iter_info); } H5E_END_TRY; if(ret >= 0) TEST_ERROR #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -14729,7 +14729,7 @@ main(void) if(nerrors) { printf("***** %d LINK TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - exit(1); + HDexit(1); } printf("All link tests passed.\n"); @@ -14744,7 +14744,7 @@ main(void) return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); return 1; } diff --git a/test/ntypes.c b/test/ntypes.c index 25060ec..a4ae4cf 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -2148,7 +2148,7 @@ test_refer_dtype(hid_t file) TEST_ERROR; /* Create reference to named datatype */ - if(H5Rcreate(wbuf, file, "/Group1/Datatype1", H5R_OBJECT, -1) < 0) + if(H5Rcreate(wbuf, file, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR; if(H5Rget_obj_type2(dataset, H5R_OBJECT, wbuf, &obj_type) < 0) TEST_ERROR; @@ -2605,7 +2605,7 @@ test_bitfield_dtype(hid_t file) if((ntype_size = H5Tget_size(native_type)) == 0) TEST_ERROR; - rbuf = malloc((size_t)nelmts*ntype_size); + rbuf = HDmalloc((size_t)nelmts*ntype_size); /* Read the data and compare them */ if(H5Dread(dataset1, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) TEST_ERROR; @@ -2624,7 +2624,7 @@ test_bitfield_dtype(hid_t file) if(H5Tclose(dtype) < 0) TEST_ERROR; if(H5Tclose(native_type) < 0) TEST_ERROR; if(H5Dclose(dataset1) < 0) TEST_ERROR; - if(rbuf) free(rbuf); + if(rbuf) HDfree(rbuf); /* Open dataset2 again to check H5Tget_native_type */ if((dataset2 = H5Dopen2(file, DSET2_BITFIELD_NAME, H5P_DEFAULT)) < 0) TEST_ERROR; diff --git a/test/objcopy.c b/test/objcopy.c index 7c86911..af0a835 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -269,8 +269,8 @@ attach_ref_attr(hid_t file_id, hid_t loc_id) if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data2) < 0) TEST_ERROR /* create an attribute with two object references */ - if(H5Rcreate(&ref[0], file_id, dsetname1, H5R_OBJECT, -1) < 0) TEST_ERROR - if(H5Rcreate(&ref[1], file_id, dsetname2, H5R_OBJECT, -1) < 0) TEST_ERROR + if(H5Rcreate(&ref[0], file_id, dsetname1, H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR + if(H5Rcreate(&ref[1], file_id, dsetname2, H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR if((aid = H5Acreate2(loc_id, "obj_ref_attr", H5T_STD_REF_OBJ, sid_ref, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Awrite(aid, H5T_STD_REF_OBJ, ref) < 0) TEST_ERROR @@ -750,8 +750,8 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ /* Check raw data read in against data written out */ if(wbuf) { - if(!compare_data(aid, 0, pid, tid, (size_t)nelmts, wbuf, rbuf, obj_owner)) TEST_ERROR - if(!compare_data(aid2, 0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, obj_owner)) TEST_ERROR + if(!compare_data(aid, (hid_t)0, pid, tid, (size_t)nelmts, wbuf, rbuf, obj_owner)) TEST_ERROR + if(!compare_data(aid2, (hid_t)0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, obj_owner)) TEST_ERROR } /* end if */ /* Don't have written data, just compare data between the two attributes */ else @@ -1303,8 +1303,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) /* Check raw data read in against data written out */ if(wbuf) { - if(!compare_data(did, 0, pid, tid, (size_t)nelmts, wbuf, rbuf, did)) TEST_ERROR - if(!compare_data(did2, 0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, did2)) TEST_ERROR + if(!compare_data(did, (hid_t)0, pid, tid, (size_t)nelmts, wbuf, rbuf, did)) TEST_ERROR + if(!compare_data(did2, (hid_t)0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, did2)) TEST_ERROR } /* end if */ /* Don't have written data, just compare data between the two datasets */ else @@ -8053,8 +8053,8 @@ test_copy_null_ref(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Create references */ - if(H5Rcreate(&obj_buf[0], did1, ".", H5R_OBJECT, -1) < 0) TEST_ERROR - if(H5Rcreate(&obj_buf[1], did2, ".", H5R_OBJECT, -1) < 0) TEST_ERROR + if(H5Rcreate(&obj_buf[0], did1, ".", H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR + if(H5Rcreate(&obj_buf[1], did2, ".", H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR if(H5Rcreate(®_buf[0], did1, ".", H5R_DATASET_REGION, sid) < 0) TEST_ERROR if(H5Rcreate(®_buf[1], did2, ".", H5R_DATASET_REGION, sid) < 0) diff --git a/test/tarray.c b/test/tarray.c index 2d6581b..c2af58d 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -1041,7 +1041,7 @@ test_array_vlen_atomic(void) /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) for(j=0; j<ARRAY1_DIM1; j++) { - wdata[i][j].p=malloc((i+j+1)*sizeof(unsigned int)); + wdata[i][j].p=HDmalloc((i+j+1)*sizeof(unsigned int)); wdata[i][j].len=i+j+1; for(k=0; k<(i+j+1); k++) ((unsigned int *)wdata[i][j].p)[k]=i*100+j*10+k; @@ -1252,7 +1252,7 @@ test_array_vlen_array(void) /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) for(j=0; j<ARRAY1_DIM1; j++) { - wdata[i][j].p=malloc((i+j+1)*(sizeof(unsigned int)*ARRAY1_DIM1)); + wdata[i][j].p=HDmalloc((i+j+1)*(sizeof(unsigned int)*ARRAY1_DIM1)); wdata[i][j].len=i+j+1; for(k=0; k<(i+j+1); k++) for(l=0; l<ARRAY1_DIM1; l++) @@ -1633,7 +1633,7 @@ test_array_bkg(void) /* Release memory resources */ /* ------------------------ */ for (i = 0; i < dtsinfo.nsubfields; i++) - free(dtsinfo.name[i]); + HDfree(dtsinfo.name[i]); /* Release IDs */ diff --git a/test/tattr.c b/test/tattr.c index e9430fe..57b3263 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -3261,12 +3261,12 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); /* Open first attribute for the dataset */ - attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, 4, + attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)4, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); /* Open attribute for the second time */ - attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, 4, + attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)4, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); @@ -3317,13 +3317,13 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); /* Open attribute of the dataset for the first time */ - attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, 2, + attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); /* Delete a few attributes until the storage switches to compact */ for(u = max_compact; u >= min_dense - 1; u--) { - ret = H5Adelete_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, u, + ret = H5Adelete_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT); CHECK(ret, FAIL, "H5Adelete_by_idx"); } @@ -3333,7 +3333,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); /* Open attribute for the second time */ - attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, 2, + attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); @@ -3384,7 +3384,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); /* Open attribute of the dataset for the first time */ - attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, 3, + attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)3, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); @@ -3409,7 +3409,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); /* Open attribute for the second time */ - attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, 3, + attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)3, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); @@ -4086,7 +4086,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) /* Get number of attributes with bad ID */ - ret = H5Aget_num_attrs(-1); + ret = H5Aget_num_attrs((hid_t)-1); VERIFY(ret, FAIL, "H5Aget_num_attrs"); /* Get number of attributes */ @@ -6859,7 +6859,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; - visited = HDmalloc(sizeof(hbool_t) * iter_info.max_visit); + visited = (hbool_t*)HDmalloc(sizeof(hbool_t) * iter_info.max_visit); CHECK(visited, NULL, "HDmalloc"); iter_info.visited = visited; diff --git a/test/tconfig.c b/test/tconfig.c index 7978727..f3ac242 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -65,8 +65,8 @@ void test_exit_definitions(void); * 16 Dec 2009 * On Boeing's OpenVMS, the value of EXIT_FAILURE is 268435458. * (The test is in test_exit_definitions.) Their document says - * it's supposed to be 2. I commented it out for further - * consideration. + * it's supposed to be 2. I commented it out for OpenVMS for + * further consideration. *------------------------------------------------------------------------- */ void diff --git a/test/tcoords.c b/test/tcoords.c index abe63dd..306c6b2 100644 --- a/test/tcoords.c +++ b/test/tcoords.c @@ -143,7 +143,7 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked) /* ****** Case 1: ****** * Testing the full selection in the fastest-growing end */ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ elmts_numb = 12; @@ -176,7 +176,7 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked) /* ****** Case 2: ****** * Testing the full selection in the slowest-growing end */ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ elmts_numb = 6; @@ -209,7 +209,7 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked) /* ****** Case 3: ****** * Testing the full selection in the middle dimensions */ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ elmts_numb = 18; @@ -298,7 +298,7 @@ static void test_singleEnd_selHyperslab(hid_t file, hbool_t is_chunked) /* ****** Case 1: ****** * Testing the full selection in the fastest-growing end */ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem1_start, mem1_stride, mem1_count, mem1_block); @@ -329,7 +329,7 @@ static void test_singleEnd_selHyperslab(hid_t file, hbool_t is_chunked) /* ****** Case 2: ****** * Testing the full selection in the slowest-growing end */ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem2_start, mem2_stride, mem2_count, mem2_block); @@ -360,7 +360,7 @@ static void test_singleEnd_selHyperslab(hid_t file, hbool_t is_chunked) /* ****** Case 3: ****** * Testing the full selection in the middle dimensions */ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem3_start, mem3_stride, mem3_count, mem3_block); @@ -493,7 +493,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked) /* ****** Case 1: ****** * Testing the full selections in the fastest-growing end and in the middle dimensions*/ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem1_start, mem1_stride, mem1_count, mem1_block); @@ -525,7 +525,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked) /* ****** Case 2: ****** * Testing the full selections in the slowest-growing end and in the middle dimensions*/ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem2_start, mem2_stride, mem2_count, mem2_block); @@ -557,7 +557,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked) /* ****** Case 3: ****** * Testing two unadjacent full selections in the middle dimensions */ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem3_start, mem3_stride, mem3_count, mem3_block); @@ -589,7 +589,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked) /* ****** Case 4: ****** * Testing the full selections in the fastest-growing end and the slowest-growing end */ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem4_start, mem4_stride, mem4_count, mem4_block); @@ -623,7 +623,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked) * Testing the full selections in the fastest-growing end and the slowest-growing end, * and also in the middle dimensions */ did = H5Dopen2(file, dset_name, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); + CHECK(did, FAIL, "H5Dopen2"); /* Select the elements in the dataset */ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem5_start, mem5_stride, mem5_count, mem5_block); diff --git a/test/tfile.c b/test/tfile.c index bf4a8c2..82e0182 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1032,7 +1032,7 @@ test_get_obj_ids(void) H5Fclose(fid); /* Get the number of all opened objects */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); @@ -1040,7 +1040,7 @@ test_get_obj_ids(void) CHECK(oid_list, NULL, "HDcalloc"); /* Get the list of all opened objects */ - ret_count = H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); + ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); VERIFY(ret_count, NDSETS, "H5Fget_obj_count"); @@ -1092,7 +1092,7 @@ test_get_file_id(void) CHECK(ret, FAIL, "H5Fclose"); /* Test H5Iget_file_id() */ - check_file_id(-1, group_id); + check_file_id((hid_t)-1, group_id); ret = H5Gclose(group_id); CHECK(ret, FAIL, "H5Gclose"); @@ -1231,32 +1231,32 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, CHECK(fid4, FAIL, "H5Fcreate"); /* test object count of all files IDs open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_FILE); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_FILE); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count"); /* test object count of all datasets open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATASET); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_DATASET); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_1, "H5Fget_obj_count"); /* test object count of all groups open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_GROUP); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_GROUP); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_3, "H5Fget_obj_count"); /* test object count of all named datatypes open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATATYPE); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_DATATYPE); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count"); /* test object count of all attributes open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ATTR); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ATTR); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count"); /* test object count of all objects currently open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count"); @@ -1267,7 +1267,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, if(oid_list != NULL) { int i; - ret_count = H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); + ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); for(i = 0; i < oid_count; i++) { @@ -2815,7 +2815,7 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, /**************************************************************** ** ** test_libver_bounds(): -** Verify that a file created and modified with various +** Verify that a file created and modified with various ** libver bounds is handled correctly. (Further testing ** welcome) ** diff --git a/test/tgenprop.c b/test/tgenprop.c index 4e93dd5..004e346 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -1818,7 +1818,7 @@ test_genprop_path(void) VERIFY(ret, 1, "H5Pequal"); /* Release the path string */ - free(path); + HDfree(path); /* Close class */ ret = H5Pclose_class(cid3); @@ -56,7 +56,7 @@ static int basic_id_test(void) /* Try to access IDs with ficticious types */ H5E_BEGIN_TRY - testPtr = H5Iobject_verify(100, (H5I_type_t) 0); + testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); H5E_END_TRY VERIFY(testPtr, NULL, "H5Iobject_verify"); @@ -64,7 +64,7 @@ static int basic_id_test(void) goto out; H5E_BEGIN_TRY - testPtr = H5Iobject_verify(700, (H5I_type_t) 700); + testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); H5E_END_TRY VERIFY(testPtr, NULL, "H5Iobject_verify"); @@ -81,13 +81,13 @@ static int basic_id_test(void) /* Register an ID and retrieve the object it points to. * Once the ID has been registered, testObj will be freed when * its ID type is destroyed. */ - testObj = malloc(7 * sizeof(int)); + testObj = HDmalloc(7 * sizeof(int)); arrayID = H5Iregister(myType, testObj); CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); if(arrayID == H5I_INVALID_HID) { - free(testObj); + HDfree(testObj); goto out; } @@ -175,13 +175,13 @@ static int basic_id_test(void) * freed when the previous type was destroyed. Allocate new * memory for it. */ - testObj = malloc(7 * sizeof(int)); + testObj = HDmalloc(7 * sizeof(int)); arrayID = H5Iregister(myType, testObj); CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); if(arrayID == H5I_INVALID_HID) { - free(testObj); + HDfree(testObj); goto out; } @@ -250,7 +250,7 @@ static int id_predefined_test(void ) void * testPtr; herr_t testErr; - testObj = malloc(sizeof(int)); + testObj = HDmalloc(sizeof(int)); /* Try to perform illegal functions on various predefined types */ H5E_BEGIN_TRY @@ -319,14 +319,14 @@ static int id_predefined_test(void ) /* testObj was never registered as an atom, so it will not be * automatically freed. */ - free(testObj); + HDfree(testObj); return 0; out: if(typeID != H5I_INVALID_HID) H5Tclose(typeID); if(testObj != NULL) - free(testObj); + HDfree(testObj); return -1; } @@ -393,7 +393,7 @@ static int test_is_valid(void) goto out; /* Check that an id of -1 is invalid */ - tri_ret = H5Iis_valid(-1); + tri_ret = H5Iis_valid((hid_t)-1); VERIFY(tri_ret, FALSE, "H4Iis_valid"); if (tri_ret != FALSE) goto out; @@ -427,13 +427,13 @@ static int test_get_type(void) goto out; /* Check that the ID is correct */ - type_ret = H5Iget_type(H5T_STRING); + type_ret = H5Iget_type((hid_t)H5T_STRING); VERIFY(type_ret, H5I_BADID, "H5Iget_type"); if (type_ret != H5I_BADID) goto out; /* Check that the ID is correct */ - type_ret = H5Iget_type(-1); + type_ret = H5Iget_type((hid_t)-1); VERIFY(type_ret, H5I_BADID, "H5Iget_type"); if (type_ret != H5I_BADID) goto out; diff --git a/test/tmisc.c b/test/tmisc.c index d599199..fcb5eac 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -1686,7 +1686,7 @@ test_misc8(void) /* Free the read & write buffers */ HDfree(wdata); #ifdef VERIFY_DATA - free(rdata); + HDfree(rdata); #endif /* VERIFY_DATA */ } /* end test_misc8() */ @@ -1910,7 +1910,7 @@ test_misc11(void) file = H5Fopen(MISC11_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(file, FAIL, "H5Fcreate"); - /* Get the file's dataset creation property list */ + /* Get the file's creation property list */ fcpl = H5Fget_create_plist(file); CHECK(fcpl, FAIL, "H5Fget_create_plist"); diff --git a/test/trefer.c b/test/trefer.c index 376d2f5..bd105a3 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -89,9 +89,9 @@ test_reference_params(void) MESSAGE(5, ("Testing Reference Parameters\n")); /* Allocate write & read buffers */ - wbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - rbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - tbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -163,23 +163,23 @@ test_reference_params(void) CHECK(ret, FAIL, "H5Dcreate2"); /* Test parameters to H5Rcreate */ - ret = H5Rcreate(NULL, fid1, "/Group1/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(NULL, fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate ref"); - ret = H5Rcreate(&wbuf[0], -1, "/Group1/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[0], (hid_t)-1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate loc_id"); - ret = H5Rcreate(&wbuf[0], fid1, NULL, H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[0], fid1, NULL, H5R_OBJECT, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate name"); - ret = H5Rcreate(&wbuf[0], fid1, "", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[0], fid1, "", H5R_OBJECT, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate null name"); - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, -1); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate type"); - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION, -1); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate region space"); - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, 0); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)0); VERIFY(ret, FAIL, "H5Rcreate space"); /* Test parameters to H5Rdereference */ - dset2 = H5Rdereference(-1, H5R_OBJECT, &rbuf[0]); + dset2 = H5Rdereference((hid_t)-1, H5R_OBJECT, &rbuf[0]); VERIFY(dset2, FAIL, "H5Rdereference loc_id"); dset2 = H5Rdereference(dataset, H5R_OBJECT, NULL); VERIFY(dset2, FAIL, "H5Rdereference ref"); @@ -187,7 +187,7 @@ test_reference_params(void) VERIFY(dset2, FAIL, "H5Rdereference type"); /* Test parameters to H5Rget_obj_type2 */ - ret = H5Rget_obj_type2(-1, H5R_OBJECT, &rbuf[0], NULL); + ret = H5Rget_obj_type2((hid_t)-1, H5R_OBJECT, &rbuf[0], NULL); VERIFY(ret, FAIL, "H5Rget_obj_type2 loc_id"); ret = H5Rget_obj_type2(fid1, H5R_OBJECT, NULL, NULL); VERIFY(ret, FAIL, "H5Rget_obj_type2 ref"); @@ -195,15 +195,15 @@ test_reference_params(void) VERIFY(ret, FAIL, "H5Rget_obj_type2 type"); /* Test parameters to H5Rget_name */ - name_size = H5Rget_name(-1, H5R_DATASET_REGION, &rbuf[0], NULL, 0); + name_size = H5Rget_name((hid_t)-1, H5R_DATASET_REGION, &rbuf[0], NULL, 0); VERIFY(name_size, FAIL, "H5Rget_name loc_id"); name_size = H5Rget_name(fid1, H5R_DATASET_REGION, NULL, NULL, 0); - VERIFY(ret, FAIL, "H5Rget_name ref"); + VERIFY(name_size, FAIL, "H5Rget_name ref"); name_size = H5Rget_name(fid1, H5R_MAXTYPE, &rbuf[0], NULL, 0); - VERIFY(ret, FAIL, "H5Rget_name type"); + VERIFY(name_size, FAIL, "H5Rget_name type"); /* Test parameters to H5Rget_region */ - ret = H5Rget_region(-1, H5R_OBJECT, &rbuf[0]); + ret = H5Rget_region((hid_t)-1, H5R_OBJECT, &rbuf[0]); VERIFY(ret, FAIL, "H5Rget_region loc_id"); ret = H5Rget_region(fid1, H5R_OBJECT, NULL); VERIFY(ret, FAIL, "H5Rget_region ref"); @@ -223,9 +223,9 @@ test_reference_params(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); - free(tbuf); + HDfree(wbuf); + HDfree(rbuf); + HDfree(tbuf); } /* test_reference_obj() */ /**************************************************************** @@ -237,31 +237,31 @@ test_reference_params(void) static void test_reference_obj(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ hid_t group; /* Group ID */ hid_t sid1; /* Dataspace ID */ hid_t tid1; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; - hobj_ref_t *wbuf, /* buffer to write to disk */ - *rbuf, /* buffer read from disk */ - *tbuf; /* temp. buffer read from disk */ + hobj_ref_t *wbuf, /* buffer to write to disk */ + *rbuf, /* buffer read from disk */ + *tbuf; /* temp. buffer read from disk */ hobj_ref_t nvrbuf[3]={0,101,1000000000}; /* buffer with non-valid refs */ - unsigned *tu32; /* Temporary pointer to uint32 data */ - int i, j; /* counting variables */ + unsigned *tu32; /* Temporary pointer to uint32 data */ + int i, j; /* counting variables */ const char *write_comment="Foo!"; /* Comments for group */ char read_comment[10]; - H5O_type_t obj_type; /* Object type */ - herr_t ret; /* Generic return value */ + H5O_type_t obj_type; /* Object type */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Object Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - rbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - tbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -333,28 +333,28 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[0], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[1], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2"); /* Create reference to group */ - ret = H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[2], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type2"); /* Create reference to named datatype */ - ret = H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[3], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); @@ -462,9 +462,9 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); - free(tbuf); + HDfree(wbuf); + HDfree(rbuf); + HDfree(tbuf); } /* test_reference_obj() */ /**************************************************************** @@ -734,10 +734,10 @@ test_reference_region(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); - free(dwbuf); - free(drbuf); + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); } /* test_reference_region() */ /**************************************************************** @@ -1010,10 +1010,10 @@ test_reference_region_1D(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); - free(dwbuf); - free(drbuf); + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); } /* test_reference_region_1D() */ /**************************************************************** @@ -1054,7 +1054,7 @@ test_reference_obj_deleted(void) CHECK(dataset, FAIL, "H5Dcreate2"); /* Create reference to dataset */ - ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &oref, &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); @@ -1209,7 +1209,7 @@ test_reference_group(void) CHECK(did, FAIL, "H5Dcreate2"); /* Create reference to group */ - ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, -1); + ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Write reference to disk */ @@ -1378,19 +1378,19 @@ test_reference_compat(void) CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf_obj[1], fid1, "/Group1/Dataset2", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf_obj[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Create reference to group */ - ret = H5Rcreate(&wbuf_obj[2], fid1, "/Group1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf_obj[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Create reference to named datatype */ - ret = H5Rcreate(&wbuf_obj[3], fid1, "/Group1/Datatype1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf_obj[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Write references to disk */ @@ -1517,7 +1517,6 @@ test_reference_compat(void) ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); - /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); diff --git a/test/tselect.c b/test/tselect.c index 7dfb6d7..4f15694 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -362,8 +362,8 @@ test_select_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); + HDfree(wbuf); + HDfree(rbuf); } /* test_select_hyper() */ struct pnt_iter { @@ -645,8 +645,8 @@ test_select_point(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); + HDfree(wbuf); + HDfree(rbuf); } /* test_select_point() */ /**************************************************************** @@ -758,8 +758,8 @@ test_select_all(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); + HDfree(wbuf); + HDfree(rbuf); } /* test_select_all() */ /**************************************************************** @@ -898,8 +898,8 @@ test_select_all_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); + HDfree(wbuf); + HDfree(rbuf); } /* test_select_all_hyper() */ /**************************************************************** @@ -1640,8 +1640,8 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, /* Advance to next element */ cube_ptr++; expected_value++; - s++; - m++; + s++; + m++; } while((cube_rank > 0) && (m < edge_size)); l++; } while((cube_rank > 1) && (l < edge_size)); @@ -1658,10 +1658,10 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, /**************************************************************** ** -** test_select_hyper_contig_dr__run_test(): Test H5S (dataspace) -** selection code with contiguous source and target having +** test_select_hyper_contig_dr__run_test(): Test H5S (dataspace) +** selection code with contiguous source and target having ** different ranks but the same shape. We have already -** tested H5S_shape_same in isolation, so now we try to do +** tested H5S_shape_same in isolation, so now we try to do ** I/O. ** ****************************************************************/ @@ -1765,13 +1765,13 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, CHECK(file_large_cube_sid, FAIL, "H5Screate_simple"); /* if chunk edge size is greater than zero, set up the small and - * large data set creation property lists to specify chunked + * large data set creation property lists to specify chunked * datasets. */ if(chunk_edge_size > 0) { hsize_t chunk_dims[SS_DR_MAX_RANK]; /* Chunk dimensions */ - chunk_dims[0] = chunk_dims[1] = + chunk_dims[0] = chunk_dims[1] = chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = (hsize_t)chunk_edge_size; small_cube_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); @@ -1795,7 +1795,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, } /* end if */ /* create the small cube dataset */ - small_cube_dataset = H5Dcreate2(fid1, "small_cube_dataset", dset_type, + small_cube_dataset = H5Dcreate2(fid1, "small_cube_dataset", dset_type, small_cube_sid, H5P_DEFAULT, small_cube_dcpl_id, H5P_DEFAULT); CHECK(small_cube_dataset, FAIL, "H5Dcreate2"); @@ -1806,7 +1806,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, } /* end if */ /* create the large cube dataset */ - large_cube_dataset = H5Dcreate2(fid1, "large_cube_dataset", dset_type, + large_cube_dataset = H5Dcreate2(fid1, "large_cube_dataset", dset_type, file_large_cube_sid, H5P_DEFAULT, large_cube_dcpl_id, H5P_DEFAULT); CHECK(large_cube_dataset, FAIL, "H5Dcreate2"); @@ -1818,16 +1818,16 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, /* write initial data to the on disk datasets */ - ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid, + ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid, small_cube_sid, xfer_plist, cube_buf); CHECK(ret, FAIL, "H5Dwrite"); - ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid, + ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid, file_large_cube_sid, xfer_plist, cube_buf); CHECK(ret, FAIL, "H5Dwrite"); /* read initial data from disk and verify that it is as expected. */ - ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid, + ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid, small_cube_sid, xfer_plist, small_cube_buf_1); CHECK(ret, FAIL, "H5Dread"); @@ -1835,7 +1835,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, verify_select_hyper_contig_dr__run_test(small_cube_buf_1, small_cube_size, edge_size, small_rank); - ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid, + ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid, file_large_cube_sid, xfer_plist, large_cube_buf_1); CHECK(ret, FAIL, "H5Dread"); @@ -1848,12 +1848,12 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, * of different rank that H5S_select_shape_same() views as being of the * same shape. * - * Start by reading small_rank-D slice from the on disk large cube, and - * verifying that the data read is correct. Verify that H5S_select_shape_same() + * Start by reading small_rank-D slice from the on disk large cube, and + * verifying that the data read is correct. Verify that H5S_select_shape_same() * returns true on the memory and file selections. */ - + /* set up start, stride, count, and block -- note that we will * change start[] so as to read slices of the large cube. */ @@ -1885,18 +1885,18 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, start[3] = (hsize_t)x; start[4] = (hsize_t)0; - ret = H5Sselect_hyperslab(file_large_cube_sid, + ret = H5Sselect_hyperslab(file_large_cube_sid, H5S_SELECT_SET, - start_ptr, - stride_ptr, - count_ptr, + start_ptr, + stride_ptr, + count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5S_select_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(small_cube_sid, + check = H5S_select_shape_same_test(small_cube_sid, file_large_cube_sid); VERIFY(check, TRUE, "H5S_select_shape_same_test"); @@ -1933,7 +1933,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, } while((large_rank >= 4) && (small_rank <= 3) && (v < edge_size)); u++; } while((large_rank >= 5) && (small_rank <= 4) && (u < edge_size)); - + /* similarly, read the on disk small cube into slices through the in memory * large cube, and verify that the correct data (and only the correct data) @@ -1961,19 +1961,19 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, start[3] = (hsize_t)x; start[4] = (hsize_t)0; - ret = H5Sselect_hyperslab(mem_large_cube_sid, + ret = H5Sselect_hyperslab(mem_large_cube_sid, H5S_SELECT_SET, - start_ptr, - stride_ptr, - count_ptr, + start_ptr, + stride_ptr, + count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5S_select_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(small_cube_sid, + check = H5S_select_shape_same_test(small_cube_sid, mem_large_cube_sid); VERIFY(check, TRUE, "H5S_select_shape_same_test"); @@ -1988,7 +1988,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, CHECK(ret, FAIL, "H5Dread"); - /* verify that the expected data and only the + /* verify that the expected data and only the * expected data was read. */ start_index = (u * edge_size * edge_size * edge_size * edge_size) + @@ -2024,7 +2024,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, /* Zero out the buffer for the next pass */ HDmemset(large_cube_buf_1 + start_index, 0, small_cube_size * sizeof(uint16_t)); - + x++; } while((large_rank >= 2) && (small_rank <= 1) && (x < edge_size)); w++; @@ -2035,16 +2035,16 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, } while((large_rank >= 5) && (small_rank <= 4) && (u < edge_size)); - /* now we go in the opposite direction, verifying that we can write - * from memory to file using selections of different rank that + /* now we go in the opposite direction, verifying that we can write + * from memory to file using selections of different rank that * H5S_select_shape_same() views as being of the same shape. * - * Start by writing small_rank D slices from the in memory large cube, to + * Start by writing small_rank D slices from the in memory large cube, to * the the on disk small cube dataset. After each write, read the small * cube dataset back from disk, and verify that it contains the expected - * data. Verify that H5S_select_shape_same() returns true on the + * data. Verify that H5S_select_shape_same() returns true on the * memory and file selections. - */ + */ u = 0; do { @@ -2060,15 +2060,15 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, */ /* zero out the on disk small cube */ - ret = H5Dwrite(small_cube_dataset, - H5T_NATIVE_UINT16, - small_cube_sid, - small_cube_sid, - xfer_plist, + ret = H5Dwrite(small_cube_dataset, + H5T_NATIVE_UINT16, + small_cube_sid, + small_cube_sid, + xfer_plist, zero_buf); CHECK(ret, FAIL, "H5Dwrite"); - /* select the portion of the in memory large cube from which we + /* select the portion of the in memory large cube from which we * are going to write data. */ start[0] = (hsize_t)u; @@ -2077,40 +2077,40 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, start[3] = (hsize_t)x; start[4] = (hsize_t)0; - ret = H5Sselect_hyperslab(mem_large_cube_sid, + ret = H5Sselect_hyperslab(mem_large_cube_sid, H5S_SELECT_SET, - start_ptr, - stride_ptr, - count_ptr, + start_ptr, + stride_ptr, + count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the in - * memory slice through the cube selection and the + /* verify that H5S_select_shape_same() reports the in + * memory slice through the cube selection and the * on disk full small cube selections as having the same shape. */ - check = H5S_select_shape_same_test(small_cube_sid, + check = H5S_select_shape_same_test(small_cube_sid, mem_large_cube_sid); VERIFY(check, TRUE, "H5S_select_shape_same_test"); /* write the slice from the in memory large cube to the on disk small cube */ - ret = H5Dwrite(small_cube_dataset, - H5T_NATIVE_UINT16, - mem_large_cube_sid, - small_cube_sid, - xfer_plist, + ret = H5Dwrite(small_cube_dataset, + H5T_NATIVE_UINT16, + mem_large_cube_sid, + small_cube_sid, + xfer_plist, cube_buf); CHECK(ret, FAIL, "H5Dwrite"); /* read the on disk small cube into memory */ - ret = H5Dread(small_cube_dataset, + ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid, - small_cube_sid, - xfer_plist, + small_cube_sid, + xfer_plist, small_cube_buf_1); CHECK(ret, FAIL, "H5Dread"); @@ -2130,7 +2130,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, } /* end for */ if(mis_match ) TestErrPrintf("small cube data don't match! Line=%d\n",__LINE__); - + x++; } while((large_rank >= 2) && (small_rank <= 1) && (x < edge_size)); w++; @@ -2141,10 +2141,10 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, } while((large_rank >= 5) && (small_rank <= 4) && (u < edge_size)); - /* Now write the contents of the in memory small cube to slices of + /* Now write the contents of the in memory small cube to slices of * the on disk cube. After each write, read the on disk cube - * into memeory, and verify that it contains the expected - * data. Verify that H5S_select_shape_same() returns true on + * into memeory, and verify that it contains the expected + * data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ @@ -2169,16 +2169,16 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, */ /* zero out the on disk cube */ - ret = H5Dwrite(large_cube_dataset, - H5T_NATIVE_USHORT, - mem_large_cube_sid, - file_large_cube_sid, - xfer_plist, + ret = H5Dwrite(large_cube_dataset, + H5T_NATIVE_USHORT, + mem_large_cube_sid, + file_large_cube_sid, + xfer_plist, zero_buf); CHECK(ret, FAIL, "H5Dwrite"); - /* select the portion of the in memory large cube to which we + /* select the portion of the in memory large cube to which we * are going to write data. */ start[0] = (hsize_t)u; @@ -2187,31 +2187,31 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, start[3] = (hsize_t)x; start[4] = (hsize_t)0; - ret = H5Sselect_hyperslab(file_large_cube_sid, + ret = H5Sselect_hyperslab(file_large_cube_sid, H5S_SELECT_SET, - start_ptr, - stride_ptr, - count_ptr, + start_ptr, + stride_ptr, + count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the in - * memory full selection of the small cube and the - * on disk slice through the large cube selection + /* verify that H5S_select_shape_same() reports the in + * memory full selection of the small cube and the + * on disk slice through the large cube selection * as having the same shape. */ - check = H5S_select_shape_same_test(small_cube_sid, + check = H5S_select_shape_same_test(small_cube_sid, file_large_cube_sid); VERIFY(check, TRUE, "H5S_select_shape_same_test"); /* write the cube from memory to the target slice of the disk cube */ - ret = H5Dwrite(large_cube_dataset, - H5T_NATIVE_UINT16, - small_cube_sid, - file_large_cube_sid, - xfer_plist, + ret = H5Dwrite(large_cube_dataset, + H5T_NATIVE_UINT16, + small_cube_sid, + file_large_cube_sid, + xfer_plist, cube_buf); CHECK(ret, FAIL, "H5Dwrite"); @@ -2220,16 +2220,16 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, ret = H5Sselect_all(file_large_cube_sid); CHECK(ret, FAIL, "H5Sselect_all"); - ret = H5Dread(large_cube_dataset, + ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid, - file_large_cube_sid, - xfer_plist, + file_large_cube_sid, + xfer_plist, large_cube_buf_1); CHECK(ret, FAIL, "H5Dread"); - /* verify that the expected data and only the + /* verify that the expected data and only the * expected data was read. */ start_index = (u * edge_size * edge_size * edge_size * edge_size) + @@ -2262,7 +2262,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, } /* end for */ if(mis_match) TestErrPrintf("large cube written from small cube has bad data! Line=%d\n", __LINE__); - + x++; } while((large_rank >= 2) && (small_rank <= 1) && (x < edge_size)); w++; @@ -2305,10 +2305,10 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, /**************************************************************** ** -** test_select_hyper_contig_dr(): Test H5S (dataspace) -** selection code with contiguous source and target having +** test_select_hyper_contig_dr(): Test H5S (dataspace) +** selection code with contiguous source and target having ** different ranks but the same shape. We have already -** tested H5S_shape_same in isolation, so now we try to do +** tested H5S_shape_same in isolation, so now we try to do ** I/O. ** ****************************************************************/ @@ -2373,12 +2373,12 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) /**************************************************************** ** -** test_select_hyper_checker_board_dr__select_checker_board(): -** Given an n-cube data space with each edge of length +** test_select_hyper_checker_board_dr__select_checker_board(): +** Given an n-cube data space with each edge of length ** edge_size, and a checker_edge_size either select a checker ** board selection of the entire cube(if sel_rank == n), ** or select a checker board selection of a -** sel_rank dimensional slice through n-cube parallel to the +** sel_rank dimensional slice through n-cube parallel to the ** sel_rank fastest changing indices, with origin (in the ** higher indices) as indicated by the start array. ** @@ -2434,7 +2434,7 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, offset_count++; /* Now set up the stride and block arrays, and portions of the start - * and count arrays that will not be altered during the selection of + * and count arrays that will not be altered during the selection of * the checker board. */ u = 0; @@ -2463,7 +2463,7 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, u++; } /* end while */ - + i = 0; do { if(0 >= sel_offset) { @@ -2478,7 +2478,7 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, } /* end if */ j = 0; - do { + do { if(1 >= sel_offset) { if(j == 0 ) { start[1] = 0; @@ -2531,22 +2531,22 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, if(((i + j + k + l + m) % 2) == 0) { if(first_selection) { - first_selection = FALSE; + first_selection = FALSE; - ret = H5Sselect_hyperslab(tgt_n_cube_sid, + ret = H5Sselect_hyperslab(tgt_n_cube_sid, H5S_SELECT_SET, - &(start[n_cube_offset]), - &(stride[n_cube_offset]), - &(count[n_cube_offset]), + &(start[n_cube_offset]), + &(stride[n_cube_offset]), + &(count[n_cube_offset]), &(block[n_cube_offset])); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end if */ else { - ret = H5Sselect_hyperslab(tgt_n_cube_sid, + ret = H5Sselect_hyperslab(tgt_n_cube_sid, H5S_SELECT_OR, - &(start[n_cube_offset]), - &(stride[n_cube_offset]), - &(count[n_cube_offset]), + &(start[n_cube_offset]), + &(stride[n_cube_offset]), + &(count[n_cube_offset]), &(block[n_cube_offset])); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end else */ @@ -2584,21 +2584,21 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, /**************************************************************** ** -** test_select_hyper_checker_board_dr__verify_data(): +** test_select_hyper_checker_board_dr__verify_data(): ** -** Examine the supplied buffer to see if it contains the -** expected data. Return TRUE if it does, and FALSE +** Examine the supplied buffer to see if it contains the +** expected data. Return TRUE if it does, and FALSE ** otherwise. ** ** The supplied buffer is presumed to contain the results -** of read or writing a checkerboard selection of an +** of read or writing a checkerboard selection of an ** n-cube, or a checkerboard selection of an m (1 <= m < n) -** dimensional slice through an n-cube parallel to the -** fastest changing indices. +** dimensional slice through an n-cube parallel to the +** fastest changing indices. ** ** It is further presumed that the buffer was zeroed before -** the read, and that the n-cube was initialize with the -** natural numbers listed in order from the origin along +** the read, and that the n-cube was initialize with the +** natural numbers listed in order from the origin along ** the fastest changing axis. ** ** Thus for a 10x10x10 3-cube, the value stored in location @@ -2607,19 +2607,19 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, ** ** (10 * 10 * x) + (10 * y) + z ** -** Thus, if the buffer contains the result of reading a +** Thus, if the buffer contains the result of reading a ** checker board selection of a 10x10x10 3-cube, location ** (x, y, z) will contain zero if it is not in a checker, ** and 100x + 10y + z if (x, y, z) is in a checker. ** -** If the buffer contains the result of reading a 3 +** If the buffer contains the result of reading a 3 ** dimensional slice (parallel to the three fastest changing -** indices) through an n cube (n > 3), then the expected +** indices) through an n cube (n > 3), then the expected ** values in the buffer will be the same, save that we will -** add a constant determined by the origin of the 3-cube +** add a constant determined by the origin of the 3-cube ** in the n-cube. ** -** Finally, the function presumes that the first element +** Finally, the function presumes that the first element ** of the buffer resides either at the origin of either ** a selected or an unselected checker. ** @@ -2679,7 +2679,7 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr, l = 0; y = 0; start_in_checker[3] = start_in_checker[2]; - do { + do { if(y >= checker_edge_size) { start_in_checker[3] = ! start_in_checker[3]; y = 0; @@ -2693,7 +2693,7 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr, in_checker = ! in_checker; z = 0; } /* end if */ - + if(in_checker) { if(*val_ptr != expected_value) good_data = FALSE; @@ -2702,10 +2702,10 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr, if(*val_ptr != 0) good_data = FALSE; } /* end else */ - + val_ptr++; expected_value++; - + m++; z++; } while((rank >= (test_max_rank - 4)) && (m < edge_size)); @@ -2728,10 +2728,10 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr, /**************************************************************** ** -** test_select_hyper_checker_board_dr__run_test(): Test H5S -** (dataspace) selection code with checker board source and -** target selections having different ranks but the same -** shape. We have already tested H5S_shape_same in +** test_select_hyper_checker_board_dr__run_test(): Test H5S +** (dataspace) selection code with checker board source and +** target selections having different ranks but the same +** shape. We have already tested H5S_shape_same in ** isolation, so now we try to do I/O. ** ****************************************************************/ @@ -2856,11 +2856,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ /* if chunk edge size is greater than zero, set up the small and - * large data set creation property lists to specify chunked + * large data set creation property lists to specify chunked * datasets. */ if(chunk_edge_size > 0) { - chunk_dims[0] = chunk_dims[1] = + chunk_dims[0] = chunk_dims[1] = chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = chunk_edge_size; small_cube_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); @@ -2885,7 +2885,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ /* create the small cube dataset */ - small_cube_dataset = H5Dcreate2(fid, "small_cube_dataset", dset_type, + small_cube_dataset = H5Dcreate2(fid, "small_cube_dataset", dset_type, file_small_cube_sid, H5P_DEFAULT, small_cube_dcpl_id, H5P_DEFAULT); CHECK(small_cube_dataset, FAIL, "H5Dcreate2"); @@ -2896,7 +2896,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ } /* end if */ /* create the large cube dataset */ - large_cube_dataset = H5Dcreate2(fid, "large_cube_dataset", dset_type, + large_cube_dataset = H5Dcreate2(fid, "large_cube_dataset", dset_type, file_large_cube_sid, H5P_DEFAULT, large_cube_dcpl_id, H5P_DEFAULT); CHECK(large_cube_dataset, FAIL, "H5Dcreate2"); @@ -2908,17 +2908,17 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ /* write initial data to the on disk datasets */ - ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, full_small_cube_sid, + ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, full_small_cube_sid, full_small_cube_sid, xfer_plist, cube_buf); CHECK(ret, FAIL, "H5Dwrite"); - ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, full_large_cube_sid, + ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, full_large_cube_sid, full_large_cube_sid, xfer_plist, cube_buf); CHECK(ret, FAIL, "H5Dwrite"); /* read initial small cube data from disk and verify that it is as expected. */ - ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, full_small_cube_sid, + ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, full_small_cube_sid, full_small_cube_sid, xfer_plist, small_cube_buf_1); CHECK(ret, FAIL, "H5Dread"); @@ -2927,7 +2927,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ edge_size, small_rank); /* read initial large cube data from disk and verify that it is as expected. */ - ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, full_large_cube_sid, + ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, full_large_cube_sid, full_large_cube_sid, xfer_plist, large_cube_buf_1); CHECK(ret, FAIL, "H5Dread"); @@ -2940,11 +2940,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * of different rank that H5S_select_shape_same() views as being of the * same shape. * - * Start by reading small_rank-D slice from the on disk large cube, and - * verifying that the data read is correct. Verify that H5S_select_shape_same() + * Start by reading small_rank-D slice from the on disk large cube, and + * verifying that the data read is correct. Verify that H5S_select_shape_same() * returns true on the memory and file selections. * - * The first step is to set up the needed checker board selection in the + * The first step is to set up the needed checker board selection in the * in memory small small cube */ @@ -2957,8 +2957,8 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ small_rank, sel_start); - /* now read slices from the large, on-disk cube into the small cube. - * Note how we adjust sel_start only in the dimensions peculiar to the + /* now read slices from the large, on-disk cube into the small cube. + * Note how we adjust sel_start only in the dimensions peculiar to the * large cube. */ @@ -3003,10 +3003,10 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5S_select_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(mem_small_cube_sid, + check = H5S_select_shape_same_test(mem_small_cube_sid, file_large_cube_sid); VERIFY(check, TRUE, "H5S_select_shape_same_test"); @@ -3041,18 +3041,18 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ TestErrPrintf("small cube read from largecube has bad data! Line=%d\n",__LINE__); x++; - } while((large_rank >= (test_max_rank - 3)) && + } while((large_rank >= (test_max_rank - 3)) && (small_rank <= (test_max_rank - 4)) && (x < edge_size)); w++; - } while((large_rank >= (test_max_rank - 2)) && + } while((large_rank >= (test_max_rank - 2)) && (small_rank <= (test_max_rank - 3)) && (w < edge_size)); v++; - } while((large_rank >= (test_max_rank - 1)) && + } while((large_rank >= (test_max_rank - 1)) && (small_rank <= (test_max_rank - 2)) && (v < edge_size)); u++; - } while((large_rank >= test_max_rank) && + } while((large_rank >= test_max_rank) && (small_rank <= (test_max_rank - 1)) && (u < edge_size)); - + /* similarly, read the on disk small cube into slices through the in memory * large cube, and verify that the correct data (and only the correct data) @@ -3110,10 +3110,10 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5S_select_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(file_small_cube_sid, + check = H5S_select_shape_same_test(file_small_cube_sid, mem_large_cube_sid); VERIFY(check, TRUE, "H5S_select_shape_same_test"); @@ -3131,7 +3131,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ CHECK(ret, FAIL, "H5Dread"); - /* verify that the expected data and only the + /* verify that the expected data and only the * expected data was read. */ data_ok = TRUE; @@ -3179,29 +3179,29 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ TestErrPrintf("large cube read from small cube has bad data! Line=%d\n",__LINE__); x++; - } while((large_rank >= (test_max_rank - 3)) && + } while((large_rank >= (test_max_rank - 3)) && (small_rank <= (test_max_rank - 4)) && (x < edge_size)); w++; - } while((large_rank >= (test_max_rank - 2)) && + } while((large_rank >= (test_max_rank - 2)) && (small_rank <= (test_max_rank - 3)) && (w < edge_size)); v++; - } while((large_rank >= (test_max_rank - 1)) && + } while((large_rank >= (test_max_rank - 1)) && (small_rank <= (test_max_rank - 2)) && (v < edge_size)); u++; - } while((large_rank >= test_max_rank) && + } while((large_rank >= test_max_rank) && (small_rank <= (test_max_rank - 1)) && (u < edge_size)); - /* now we go in the opposite direction, verifying that we can write - * from memory to file using selections of different rank that + /* now we go in the opposite direction, verifying that we can write + * from memory to file using selections of different rank that * H5S_select_shape_same() views as being of the same shape. * - * Start by writing small_rank D slices from the in memory large cube, to + * Start by writing small_rank D slices from the in memory large cube, to * the the on disk small cube dataset. After each write, read the small * cube dataset back from disk, and verify that it contains the expected - * data. Verify that H5S_select_shape_same() returns true on the + * data. Verify that H5S_select_shape_same() returns true on the * memory and file selections. - */ + */ /* select a checker board in the file small cube dataspace */ sel_start[0] = sel_start[1] = sel_start[2] = sel_start[3] = sel_start[4] = 0; @@ -3233,11 +3233,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start[3] = x; /* zero out the on disk small cube */ - ret = H5Dwrite(small_cube_dataset, - H5T_NATIVE_UINT16, - full_small_cube_sid, - full_small_cube_sid, - xfer_plist, + ret = H5Dwrite(small_cube_dataset, + H5T_NATIVE_UINT16, + full_small_cube_sid, + full_small_cube_sid, + xfer_plist, zero_buf); CHECK(ret, FAIL, "H5Dwrite"); @@ -3263,22 +3263,22 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5S_select_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(file_small_cube_sid, + check = H5S_select_shape_same_test(file_small_cube_sid, mem_large_cube_sid); VERIFY(check, TRUE, "H5S_select_shape_same_test"); - /* write the slice from the in memory large cube to the - * on disk small cube + /* write the slice from the in memory large cube to the + * on disk small cube */ - ret = H5Dwrite(small_cube_dataset, - H5T_NATIVE_UINT16, - mem_large_cube_sid, - file_small_cube_sid, - xfer_plist, + ret = H5Dwrite(small_cube_dataset, + H5T_NATIVE_UINT16, + mem_large_cube_sid, + file_small_cube_sid, + xfer_plist, cube_buf); CHECK(ret, FAIL, "H5Dwrite"); @@ -3287,11 +3287,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ HDmemset(small_cube_buf_1, 0, sizeof(*small_cube_buf_1) * small_cube_size); /* read the on disk small cube into memory */ - ret = H5Dread(small_cube_dataset, + ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, full_small_cube_sid, - full_small_cube_sid, - xfer_plist, + full_small_cube_sid, + xfer_plist, small_cube_buf_1); CHECK(ret, FAIL, "H5Dread"); @@ -3314,24 +3314,24 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ TestErrPrintf("small cube read from largecube has bad data! Line=%d\n",__LINE__); x++; - } while((large_rank >= (test_max_rank - 3)) && + } while((large_rank >= (test_max_rank - 3)) && (small_rank <= (test_max_rank - 4)) && (x < edge_size)); w++; - } while((large_rank >= (test_max_rank - 2)) && + } while((large_rank >= (test_max_rank - 2)) && (small_rank <= (test_max_rank - 3)) && (w < edge_size)); v++; - } while((large_rank >= (test_max_rank - 1)) && + } while((large_rank >= (test_max_rank - 1)) && (small_rank <= (test_max_rank - 2)) && (v < edge_size)); u++; - } while((large_rank >= test_max_rank) && + } while((large_rank >= test_max_rank) && (small_rank <= (test_max_rank - 1)) && (u < edge_size)); - /* Now write checker board selections of the entries in memory - * small cube to slices of the on disk cube. After each write, - * read the on disk large cube * into memeory, and verify that - * it contains the expected * data. Verify that - * H5S_select_shape_same() returns true on the memory and file + /* Now write checker board selections of the entries in memory + * small cube to slices of the on disk cube. After each write, + * read the on disk large cube * into memeory, and verify that + * it contains the expected * data. Verify that + * H5S_select_shape_same() returns true on the memory and file * selections. */ @@ -3365,11 +3365,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start[3] = x; /* zero out the on disk cube */ - ret = H5Dwrite(large_cube_dataset, - H5T_NATIVE_USHORT, - full_large_cube_sid, - full_large_cube_sid, - xfer_plist, + ret = H5Dwrite(large_cube_dataset, + H5T_NATIVE_USHORT, + full_large_cube_sid, + full_large_cube_sid, + xfer_plist, zero_buf); CHECK(ret, FAIL, "H5Dwrite"); @@ -3395,10 +3395,10 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5S_select_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(file_large_cube_sid, + check = H5S_select_shape_same_test(file_large_cube_sid, mem_small_cube_sid); VERIFY(check, TRUE, "H5S_select_shape_same_test"); @@ -3407,11 +3407,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * small cube to a slice through the on disk large * cube. */ - ret = H5Dwrite(large_cube_dataset, - H5T_NATIVE_UINT16, - mem_small_cube_sid, - file_large_cube_sid, - xfer_plist, + ret = H5Dwrite(large_cube_dataset, + H5T_NATIVE_UINT16, + mem_small_cube_sid, + file_large_cube_sid, + xfer_plist, cube_buf); CHECK(ret, FAIL, "H5Dwrite"); @@ -3420,16 +3420,16 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ HDmemset(large_cube_buf_1, 0, sizeof(*large_cube_buf_1) * large_cube_size); /* read the on disk large cube into memory */ - ret = H5Dread(large_cube_dataset, + ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, full_large_cube_sid, - full_large_cube_sid, - xfer_plist, + full_large_cube_sid, + xfer_plist, large_cube_buf_1); CHECK(ret, FAIL, "H5Dread"); - /* verify that the expected data and only the + /* verify that the expected data and only the * expected data was written to the on disk large * cube. */ @@ -3479,18 +3479,18 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ TestErrPrintf("large cube written from small cube has bad data! Line=%d\n",__LINE__); x++; - } while((large_rank >= (test_max_rank - 3)) && + } while((large_rank >= (test_max_rank - 3)) && (small_rank <= (test_max_rank - 4)) && (x < edge_size)); w++; - } while((large_rank >= (test_max_rank - 2)) && + } while((large_rank >= (test_max_rank - 2)) && (small_rank <= (test_max_rank - 3)) && (w < edge_size)); v++; - } while((large_rank >= (test_max_rank - 1)) && + } while((large_rank >= (test_max_rank - 1)) && (small_rank <= (test_max_rank - 2)) && (v < edge_size)); u++; - } while((large_rank >= test_max_rank) && + } while((large_rank >= test_max_rank) && (small_rank <= (test_max_rank - 1)) && (u < edge_size)); - + /* Close memory dataspaces */ ret = H5Sclose(full_small_cube_sid); @@ -5409,8 +5409,8 @@ test_select_hyper_and_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); + HDfree(wbuf); + HDfree(rbuf); } /* test_select_hyper_and_2d() */ /**************************************************************** @@ -5540,8 +5540,8 @@ test_select_hyper_xor_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); + HDfree(wbuf); + HDfree(rbuf); } /* test_select_hyper_xor_2d() */ /**************************************************************** @@ -5670,8 +5670,8 @@ test_select_hyper_notb_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); + HDfree(wbuf); + HDfree(rbuf); } /* test_select_hyper_notb_2d() */ /**************************************************************** @@ -6443,8 +6443,8 @@ test_select_point_chunk(void) ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - free(data); - free (data_out); + HDfree(data); + HDfree (data_out); } /* test_select_point_chunk() */ /**************************************************************** @@ -6671,7 +6671,7 @@ test_select_combine(void) none_id=H5Scopy(base_id); CHECK(none_id, FAIL, "H5Scopy"); error=H5Sselect_none(none_id); - CHECK(error, FAIL, "H5Sselect_all"); + CHECK(error, FAIL, "H5Sselect_none"); sel_type=H5Sget_select_type(none_id); VERIFY(sel_type, H5S_SEL_NONE, "H5Sget_select_type"); @@ -7623,8 +7623,8 @@ test_select_none(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); + HDfree(wbuf); + HDfree(rbuf); } /* test_select_none() */ /**************************************************************** @@ -12344,7 +12344,7 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_reg_ori5,H5S_SELECT_SET,start5,stride5,count5,block5); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* Build up four dimensional regular selection with H5_SELECT_OR, inside HDF5, + /* Build up five dimensional regular selection with H5_SELECT_OR, inside HDF5, it will be treated as an irregular selection. */ start5[4] = 1; count5[4] = 1; @@ -12494,6 +12494,7 @@ test_space_rebuild(void) CHECK(ret,FAIL,"H5S_hyper_rebuild"); }/* No need to do shape comparision */ + /* Add more selections to make it regular again */ start5[3] = 5; count5[3] = 1; stride5[3] = 4; diff --git a/test/ttsafe.c b/test/ttsafe.c index 253470b..d0ab81a 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -52,69 +52,71 @@ int main(void) #define NAME_OFFSET 6 /* offset for "name<num>" */ /* pre-condition: num must be a non-negative number */ -static int num_digits(int num) +static unsigned +num_digits(int num) { - int i; + unsigned u; - if (num == 0) - return 1; + if(num == 0) + return 1; - for (i = 0; num > 0; i++) - num = num / 10; + for(u = 0; num > 0; u++) + num = num / 10; - return i; + return u; } /* Routine to generate attribute names for numeric values */ char *gen_name(int value) { - char *temp; - int i, length; + char *temp; + unsigned length; + int i; - length = num_digits(MAX_NUM_NAME - 1); - temp = (char *)HDmalloc((NAME_OFFSET + length + 1) * sizeof(char)); - temp = HDstrcpy(temp, "attrib"); - temp[NAME_OFFSET + length] = '\0'; + length = num_digits(MAX_NUM_NAME - 1); + temp = (char *)HDmalloc(NAME_OFFSET + length + 1); + temp = HDstrcpy(temp, "attrib"); + temp[NAME_OFFSET + length] = '\0'; - for (i = length - 1; i >= 0; i--) { - temp[NAME_OFFSET + i] = (char)((int)'0' + value % 10); - value = value / 10; - } + for (i = (int)(length - 1); i >= 0; i--) { + temp[NAME_OFFSET + i] = (char)((int)'0' + value % 10); + value = value / 10; + } - return temp; + return temp; } int main(int argc, char *argv[]) { - /* Initialize testing framework */ - TestInit(argv[0], NULL, NULL); + /* Initialize testing framework */ + TestInit(argv[0], NULL, NULL); - /* Tests are generally arranged from least to most complexity... */ - AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); - AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); + /* Tests are generally arranged from least to most complexity... */ + AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); + AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); #ifdef H5_HAVE_PTHREAD_H - /* Thread cancellability only supported with pthreads ... */ - AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test", NULL); + /* Thread cancellability only supported with pthreads ... */ + AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test", NULL); #endif /* H5_HAVE_PTHREAD_H */ - AddTest("acreate", tts_acreate, cleanup_acreate, "multi-attribute creation", NULL); + AddTest("acreate", tts_acreate, cleanup_acreate, "multi-attribute creation", NULL); - /* Display testing information */ - TestInfo(argv[0]); + /* Display testing information */ + TestInfo(argv[0]); - /* Parse command line arguments */ - TestParseCmdLine(argc,argv); + /* Parse command line arguments */ + TestParseCmdLine(argc,argv); - /* Perform requested testing */ - PerformTests(); + /* Perform requested testing */ + PerformTests(); - /* Display test summary, if requested */ - if (GetTestSummary()) - TestSummary(); + /* Display test summary, if requested */ + if (GetTestSummary()) + TestSummary(); - /* Clean up test files, if allowed */ - if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) - TestCleanup(); + /* Clean up test files, if allowed */ + if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) + TestCleanup(); - return GetTestNumErrs(); + return GetTestNumErrs(); } /* end main() */ #endif /*H5_HAVE_THREADSAFE*/ diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c index 0efd02c..dec2eee 100644 --- a/test/ttsafe_acreate.c +++ b/test/ttsafe_acreate.c @@ -113,7 +113,7 @@ void tts_acreate(void) * with the dataset */ for(i = 0; i < NUM_THREADS; i++) { - attrib_data = malloc(sizeof(ttsafe_name_data_t)); + attrib_data = HDmalloc(sizeof(ttsafe_name_data_t)); attrib_data->dataset = dataset; attrib_data->datatype = datatype; attrib_data->dataspace = dataspace; @@ -170,7 +170,7 @@ void *tts_acreate_thread(void *client_data) H5P_DEFAULT, H5P_DEFAULT); /* Write data to the attribute */ - attribute_data = malloc(sizeof(int)); + attribute_data = HDmalloc(sizeof(int)); *attribute_data = attrib_data->current_index; H5Awrite(attribute, H5T_NATIVE_INT, attribute_data); H5Aclose(attribute); diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 8264403..56f431e 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -145,7 +145,7 @@ void *tts_cancel_thread(void UNUSED *arg) assert(dataset >= 0); /* If thread is cancelled, make cleanup call */ - cleanup_structure = (cancel_cleanup_t*)malloc(sizeof(cancel_cleanup_t)); + cleanup_structure = (cancel_cleanup_t*)HDmalloc(sizeof(cancel_cleanup_t)); cleanup_structure->dataset = dataset; cleanup_structure->datatype = datatype; cleanup_structure->dataspace = dataspace; @@ -156,7 +156,7 @@ void *tts_cancel_thread(void UNUSED *arg) ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue); assert(ret>=0); - buffer = malloc(sizeof(int)); + buffer = HDmalloc(sizeof(int)); ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); assert(ret>=0); ret=H5Diterate(buffer, H5T_NATIVE_INT, dataspace, tts_cancel_callback, &dataset); diff --git a/test/tunicode.c b/test/tunicode.c index 6f3e3a9..856c2cb 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -454,7 +454,7 @@ void test_objnames(hid_t fid, const char* string) CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to named datatype */ - ret = H5Rcreate(&obj_ref, grp2_id, string, H5R_OBJECT, -1); + ret = H5Rcreate(&obj_ref, grp2_id, string, H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Write selection and read it back*/ ret = H5Dwrite(dset_id, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &obj_ref); |