diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-12-23 22:00:43 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-12-23 22:00:43 (GMT) |
commit | 928d398be4143546e57c50788b429095328cb3ba (patch) | |
tree | 62e0c15ab90dead334cf25a99ba2eb4fe1322fd5 /test | |
parent | d03ae28886d062f7552334c204562a98bb7351e9 (diff) | |
parent | 92d4f32514e05a3cff1db0af0befcd489c74c1d3 (diff) | |
download | hdf5-928d398be4143546e57c50788b429095328cb3ba.zip hdf5-928d398be4143546e57c50788b429095328cb3ba.tar.gz hdf5-928d398be4143546e57c50788b429095328cb3ba.tar.bz2 |
[svn-r24593] merge from trunk
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeTests.cmake | 2 | ||||
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/Makefile.in | 2 | ||||
-rw-r--r-- | test/accum.c | 8 | ||||
-rw-r--r-- | test/big.c | 320 | ||||
-rw-r--r-- | test/cmpd_dset.c | 32 | ||||
-rw-r--r-- | test/dsets.c | 46 | ||||
-rw-r--r-- | test/dt_arith.c | 74 | ||||
-rw-r--r-- | test/dtypes.c | 81 | ||||
-rw-r--r-- | test/h5test.c | 2 | ||||
-rw-r--r-- | test/links.c | 6 | ||||
-rw-r--r-- | test/ntypes.c | 4 | ||||
-rw-r--r-- | test/tarray.c | 28 | ||||
-rw-r--r-- | test/tattr.c | 2 | ||||
-rw-r--r-- | test/test_plugin.sh.in | 3 | ||||
-rw-r--r-- | test/tfile.c | 34 | ||||
-rw-r--r-- | test/tgenprop.c | 6 | ||||
-rw-r--r-- | test/tid.c | 14 | ||||
-rw-r--r-- | test/tmisc.c | 2 | ||||
-rw-r--r-- | test/trefer.c | 40 | ||||
-rw-r--r-- | test/tselect.c | 36 | ||||
-rw-r--r-- | test/tsohm.c | 4 | ||||
-rw-r--r-- | test/ttsafe_acreate.c | 4 | ||||
-rw-r--r-- | test/ttsafe_cancel.c | 4 | ||||
-rw-r--r-- | test/tunicode.c | 4 |
25 files changed, 412 insertions, 348 deletions
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index b64eeca..58ef1e6 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -142,6 +142,7 @@ ADD_TEST ( COMMAND ${CMAKE_COMMAND} -E remove coord.h5 + dtypes10.h5 sys_file1 tattr.h5 tfile1.h5 @@ -150,6 +151,7 @@ ADD_TEST ( tfile4.h5 tfile5.h5 tfile6.h5 + tfile7.h5 th5o_file th5s1.h5 tselect.h5 diff --git a/test/Makefile.am b/test/Makefile.am index b7fd1a9..3dff50c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -131,7 +131,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_expand.h5 \ copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \ - sys_file1 tfile[1-6].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ + sys_file1 tfile[1-7].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ stab.h5 extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 \ dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \ big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ diff --git a/test/Makefile.in b/test/Makefile.in index f9309bb..3b63fd6 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -865,7 +865,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_expand.h5 \ copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 \ - frspace.h5 links*.h5 sys_file1 tfile[1-6].h5 th5s[1-4].h5 \ + frspace.h5 links*.h5 sys_file1 tfile[1-7].h5 th5s[1-4].h5 \ lheap.h5 fheap.h5 ohdr.h5 stab.h5 extern_[1-3].h5 \ extern_[1-4][ab].raw gheap[0-4].h5 dt_arith[1-2] links.h5 \ links[0-6]*.h5 extlinks[0-15].h5 tmp big.data \ diff --git a/test/accum.c b/test/accum.c index c170388..351ed88 100644 --- a/test/accum.c +++ b/test/accum.c @@ -1661,9 +1661,9 @@ test_random_write(void) unsigned u; /* Local index variable */ /* Allocate space for the write & read buffers */ - wbuf = (uint8_t *)malloc(RANDOM_BUF_SIZE); + wbuf = (uint8_t *)HDmalloc(RANDOM_BUF_SIZE); HDassert(wbuf); - rbuf = (uint8_t *)calloc(RANDOM_BUF_SIZE, 1); + rbuf = (uint8_t *)HDcalloc(RANDOM_BUF_SIZE, 1); HDassert(rbuf); /* Initialize write buffer */ @@ -1681,9 +1681,9 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed); HDsrandom(seed); /* Allocate space for the segment length buffer */ - off = (size_t *)malloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); + off = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); HDassert(off); - len = (size_t *)malloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); + len = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); HDassert(len); /* Randomly choose lengths of segments */ @@ -76,8 +76,6 @@ * NOFILE stands for "no file" to be tested. */ typedef enum fsizes_t { SFILE, LFILE, XLFILE, HUGEFILE, NOFILE} fsizes_t; -/* Lists of vfd to test */ -typedef enum vfd_t { SEC2_VFD, STDIO_VFD, FAMILY_VFD } vfd_t; fsizes_t file_size= NOFILE; const char *FILENAME[] = { @@ -91,9 +89,11 @@ int sparse_support=0; /* sparse file supported, default false */ int have_space=0; /* enough space for huge file test, default false */ hsize_t family_size_def=FAMILY_SIZE; /* default family file size */ -/* Protocols */ +/* Prototypes */ static void usage(void); -int testvfd(vfd_t vfd); +static int test_sec2(hid_t fapl); +static int test_stdio(hid_t fapl); +static int test_family(hid_t fapl); /* Array used to record all addresses at which data has been written */ /* so far. Used to prevent overlapping writes. */ @@ -207,66 +207,55 @@ is_sparse(void) *------------------------------------------------------------------------- */ static fsizes_t -supports_big(vfd_t vfd) +supports_big(void) { int fd = -1; fsizes_t fsize = NOFILE; - switch (vfd){ - case FAMILY_VFD: - case SEC2_VFD: - case STDIO_VFD: - if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) - goto error; - - /* Write a few byte at the beginning */ - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = SFILE; - - /* Write a few bytes at 2GB */ - if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB) - goto quit; - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = LFILE; - - /* Write a few bytes at 4GB */ - if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB) - goto quit; - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = XLFILE; - - /* If this supports sparse_file, write a few bytes at 32GB */ - if (!sparse_support) - goto quit; - if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB) - goto quit; - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = HUGEFILE; - - break; - default: - /* unknown or unsupported VFD */ + if((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) goto error; - break; - } + + /* Write a few byte at the beginning */ + if(5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = SFILE; + + /* Write a few bytes at 2GB */ + if(HDlseek(fd, 2*GB, SEEK_SET)!=2*GB) + goto quit; + if(5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = LFILE; + + /* Write a few bytes at 4GB */ + if(HDlseek(fd, 4*GB, SEEK_SET) != 4*GB) + goto quit; + if(5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = XLFILE; + + /* If this supports sparse_file, write a few bytes at 32GB */ + if(!sparse_support) + goto quit; + if(HDlseek(fd, 32*GB, SEEK_SET) != 32*GB) + goto quit; + if(5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = HUGEFILE; quit: - if (HDclose(fd) < 0) + if(HDclose(fd) < 0) goto error; - if (HDremove("y.h5") < 0) + if(HDremove("y.h5") < 0) goto error; - return(fsize); + return fsize; error: - if (fd >= 0){ + if(fd >= 0){ HDclose(fd); HDremove("y.h5"); } - return (fsize); + return fsize; } @@ -301,11 +290,11 @@ enough_room(hid_t fapl) /* Get file name template */ HDassert(H5FD_FAMILY==H5Pget_driver(fapl)); - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); /* Create files */ for (i=0; i<NELMTS(fd); i++) { - HDsnprintf(name, sizeof name, filename, i); + HDsnprintf(name, sizeof(name), filename, i); if ((fd[i]=HDopen(name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) { goto done; } @@ -320,7 +309,7 @@ enough_room(hid_t fapl) done: for (i=0; i<NELMTS(fd) && fd[i]>=0; i++) { - HDsnprintf(name, sizeof name, filename, i); + HDsnprintf(name, sizeof(name), filename, i); if(HDclose(fd[i]) < 0) ret_value=0; HDremove(name); @@ -603,123 +592,138 @@ usage(void) , (hsize_t)FAMILY_SIZE); } - - -/* Flush stdout at the end of this test routine to ensure later output to */ -/* stderr will not come out before it.*/ -int testvfd(vfd_t vfd) +static int +test_sec2(hid_t fapl) { - hid_t fapl=-1; char filename[1024]; fsizes_t testsize; + testsize = supports_big(); + if(testsize == NOFILE) { + HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n"); + goto quit; + } + /* Test big file with the SEC2 driver */ + HDputs("Testing big file with the SEC2 Driver "); - switch(vfd){ - case FAMILY_VFD: - /* Test huge file with the family driver */ - HDputs("Testing big file with the Family Driver "); - if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0) - goto error; + if(writer(filename, fapl, testsize, WRT_N)) + goto error; + if(reader(filename, fapl)) + goto error; - if (cflag){ - /* - * We shouldn't run this test if the file system doesn't support holes - * because we would generate multi-gigabyte files. - */ - HDputs("Checking if file system is adequate for this test..."); - if (sizeof(long long)<8 || 0==GB8LL) { - HDputs("Test skipped because sizeof(long long) is too small. This"); - HDputs("hardware apparently doesn't support 64-bit integer types."); - usage(); - goto quit; - } - if (!sparse_support) { - HDputs("Test skipped because file system does not support holes."); - usage(); - goto quit; - } - if (!enough_room(fapl)) { - HDputs("Test skipped because of quota (file size or num open files)."); - usage(); - goto quit; - } - } + HDputs("Test passed with the SEC2 Driver."); - /* Do the test with the Family Driver */ - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); +quit: + /* End with normal return code */ + /* Clean up the test file */ + if(h5_cleanup(FILENAME, fapl)) + HDremove(DNAME); + return 0; - if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error; - if (reader(filename, fapl)) goto error; +error: + HDputs("*** TEST FAILED ***"); + return 1; +} /* end test_sec2() */ - HDputs("Test passed with the Family Driver."); - break; +static int +test_stdio(hid_t fapl) +{ + char filename[1024]; + fsizes_t testsize; - case SEC2_VFD: - testsize = supports_big(SEC2_VFD); - if (testsize == NOFILE) { - HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n"); - goto quit; - } - /* Test big file with the SEC2 driver */ - HDputs("Testing big file with the SEC2 Driver "); + testsize = supports_big(); + if(testsize == NOFILE) { + HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n"); + goto quit; + } + HDputs("\nTesting big file with the STDIO Driver "); - if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if(H5Pset_fapl_sec2(fapl) < 0) - goto error; + h5_fixname(FILENAME[2], fapl, filename, sizeof filename); - h5_fixname(FILENAME[1], fapl, filename, sizeof filename); + if(writer(filename, fapl, testsize, WRT_N)) + goto error; + if(reader(filename, fapl)) + goto error; + HDputs("Test passed with the STDIO Driver."); - if (writer(filename, fapl, testsize, WRT_N)) goto error; - if (reader(filename, fapl)) goto error; + /* Flush stdout at the end of this test routine to ensure later + * output to stderr will not come out before it. + */ - HDputs("Test passed with the SEC2 Driver."); - break; +quit: + /* End with normal return code */ + /* Clean up the test file */ + if(h5_cleanup(FILENAME, fapl)) + HDremove(DNAME); + HDfflush(stdout); + return 0; + +error: + HDputs("*** TEST FAILED ***"); + HDfflush(stdout); + return 1; +} /* end test_stdio() */ - case STDIO_VFD: - testsize = supports_big(STDIO_VFD); - if (testsize == NOFILE) { - HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n"); +static int +test_family(hid_t fapl) +{ + char filename[1024]; + + /* Test huge file with the family driver */ + HDputs("Testing big file with the Family Driver "); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + if(H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0) + goto error; + + if(cflag){ + /* + * We shouldn't run this test if the file system doesn't support holes + * because we would generate multi-gigabyte files. + */ + HDputs("Checking if file system is adequate for this test..."); + if(sizeof(long long) < 8 || 0 == GB8LL) { + HDputs("Test skipped because sizeof(long long) is too small. This"); + HDputs("hardware apparently doesn't support 64-bit integer types."); + usage(); goto quit; } - HDputs("\nTesting big file with the STDIO Driver "); - - if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if(H5Pset_fapl_stdio(fapl) < 0) - goto error; + if(!sparse_support) { + HDputs("Test skipped because file system does not support holes."); + usage(); + goto quit; + } + if(!enough_room(fapl)) { + HDputs("Test skipped because of quota (file size or num open files)."); + usage(); + goto quit; + } + } - h5_fixname(FILENAME[2], fapl, filename, sizeof filename); + /* Do the test with the Family Driver */ + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if (writer(filename, fapl, testsize, WRT_N)) goto error; - if (reader(filename, fapl)) goto error; - HDputs("Test passed with the STDIO Driver."); - break; + if(writer(filename, fapl, HUGEFILE, WRT_N)) + goto error; + if(reader(filename, fapl)) + goto error; - default: - HDputs("Unsupprted VFD"); - usage(); - goto error;; - } /* end of switch (vfd) */ + HDputs("Test passed with the Family Driver."); quit: /* End with normal return code */ /* Clean up the test file */ - if (h5_cleanup(FILENAME, fapl)) HDremove(DNAME); - HDfflush(stdout); + if(h5_cleanup(FILENAME, fapl)) + HDremove(DNAME); return 0; - error: - if (fapl>=0) H5Pclose(fapl); HDputs("*** TEST FAILED ***"); - HDfflush(stdout); return 1; -} - +} /* end test_family() */ /*------------------------------------------------------------------------- @@ -749,6 +753,8 @@ int main (int ac, char **av) { unsigned long seed = 0; /* Random # seed */ + hid_t fapl = -1; + hid_t driver = -1; /* parameters setup */ @@ -779,11 +785,16 @@ main (int ac, char **av) } } + /* check VFD to see if this is one we test */ + if((fapl = h5_fileaccess()) < 0) + goto error; + if((driver = H5Pget_driver(fapl)) < 0) + goto error; + /* check sparse file support unless cflag is not set. */ - if (cflag) + if(cflag) sparse_support = is_sparse(); - /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); #ifdef QAK @@ -792,19 +803,30 @@ main (int ac, char **av) #endif /* QAK */ HDsrandom(seed); - /*=================================================*/ - if (testvfd(FAMILY_VFD) != 0) - goto error; - if (testvfd(SEC2_VFD) != 0) - goto error; - if (testvfd(STDIO_VFD) != 0) - goto error; + /* run VFD-specific test */ + if(H5FD_SEC2 == driver) { + if(test_sec2(fapl) != 0) + goto error; + } + else if(H5FD_STDIO == driver) { + if(test_stdio(fapl) != 0) + goto error; + } + else if(H5FD_FAMILY == driver) { + if(test_family(fapl) != 0) + goto error; + } + else + HDputs("This VFD is not supported"); /* End with normal exit code */ + /* fapls are cleaned up in the vfd test code */ return 0; error: HDputs("*** TEST FAILED ***"); + if(fapl > 0) + H5Pclose(fapl); return 1; } diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 433c488..b3d17dc 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; diff --git a/test/dsets.c b/test/dsets.c index cec8f9a..5f44ce2 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -477,7 +477,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) HDclose(f); - free (tconv_buf); + HDfree (tconv_buf); PASSED(); } /* end if */ else { @@ -1848,13 +1848,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; } @@ -4021,7 +4021,7 @@ test_nbit_int_size(hid_t file) */ for (i=0; i < DSET_DIM1; i++) for (j=0; j < DSET_DIM2; j++) - orig_data[i][j] = rand() % (int)pow(2, precision-1) <<offset; + orig_data[i][j] = rand() % (int)pow((double)2, (double)(precision-1)) << offset; /* Describe the dataspace. */ @@ -6533,7 +6533,7 @@ auxread_fdata(hid_t fid, const char *name) if(H5Dclose(dset_id) < 0) goto error; if(buf) - free(buf); + HDfree(buf); return 0; @@ -6545,7 +6545,7 @@ error: H5Tclose(ftype_id); H5Tclose(mtype_id); if(buf) - free(buf); + HDfree(buf); } H5E_END_TRY; return -1; } @@ -7811,13 +7811,15 @@ test_chunk_expand(hid_t fapl) H5D_alloc_time_t alloc_time; /* Storage allocation time */ unsigned write_elem, read_elem; /* Element written/read */ unsigned u; /* Local index variable */ + size_t size; /* Size of type */ herr_t status; /* Generic return value */ TESTING("filter expanding chunks too much"); h5_fixname(FILENAME[10], fapl, filename, sizeof filename); - if(sizeof(size_t) <= 4) { + size = sizeof(size_t); + if(size <= 4) { SKIPPED(); puts(" Current machine can't test for error"); } /* end if */ @@ -8287,7 +8289,7 @@ test_scatter(void) scatter_info.size = 8; /* Scatter data */ - if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + if(H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) TEST_ERROR /* Verify data */ @@ -8327,7 +8329,7 @@ test_scatter(void) scatter_info.size = 12; /* Scatter data */ - if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + if(H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) TEST_ERROR /* Verify data */ @@ -8385,7 +8387,7 @@ test_scatter(void) scatter_info.size = 36; /* Scatter data */ - if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + if(H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) TEST_ERROR /* Verify data */ @@ -8441,7 +8443,7 @@ test_scatter(void) scatter_info.size = 16; /* Scatter data */ - if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + if(H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) TEST_ERROR /* Verify data */ @@ -8475,7 +8477,7 @@ test_scatter(void) scatter_info.size = 4; /* Scatter data */ - if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + if(H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) TEST_ERROR /* Verify data */ @@ -8952,7 +8954,7 @@ test_scatter_error(void) scatter_info.src_buf = src_buf; scatter_info.block = sizeof(src_buf)/sizeof(src_buf[0]); scatter_info.size = 6; - if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + if(H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) TEST_ERROR @@ -8969,21 +8971,21 @@ test_scatter_error(void) scatter_info.src_buf = src_buf; scatter_info.size = 6; H5E_BEGIN_TRY { - ret = H5Dscatter(scatter_cb, &scatter_info, sid, sid, dst_buf); + ret = H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, sid, sid, dst_buf); } H5E_END_TRY if(ret >= 0) TEST_ERROR scatter_info.src_buf = src_buf; scatter_info.size = 6; H5E_BEGIN_TRY { - ret = H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, H5T_NATIVE_INT, dst_buf); + ret = H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, H5T_NATIVE_INT, H5T_NATIVE_INT, dst_buf); } H5E_END_TRY if(ret >= 0) TEST_ERROR scatter_info.src_buf = src_buf; scatter_info.size = 6; H5E_BEGIN_TRY { - ret = H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, NULL); + ret = H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, NULL); } H5E_END_TRY if(ret >= 0) TEST_ERROR @@ -8994,7 +8996,7 @@ test_scatter_error(void) scatter_info.src_buf = src_buf; scatter_info.size = 7; H5E_BEGIN_TRY { - ret = H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf); + ret = H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf); } H5E_END_TRY if(ret >= 0) TEST_ERROR @@ -9005,7 +9007,7 @@ test_scatter_error(void) scatter_info.src_buf = src_buf; scatter_info.size = 6; H5E_BEGIN_TRY { - ret = H5Dscatter(scatter_error_cb_fail, &scatter_info, H5T_NATIVE_INT, sid, dst_buf); + ret = H5Dscatter((H5D_scatter_func_t)scatter_error_cb_fail, &scatter_info, H5T_NATIVE_INT, sid, dst_buf); } H5E_END_TRY if(ret >= 0) TEST_ERROR @@ -9016,7 +9018,7 @@ test_scatter_error(void) scatter_info.src_buf = src_buf; scatter_info.size = 6; H5E_BEGIN_TRY { - ret = H5Dscatter(scatter_error_cb_null, &scatter_info, H5T_NATIVE_INT, sid, dst_buf); + ret = H5Dscatter((H5D_scatter_func_t)scatter_error_cb_null, &scatter_info, H5T_NATIVE_INT, sid, dst_buf); } H5E_END_TRY if(ret >= 0) TEST_ERROR @@ -9026,7 +9028,7 @@ test_scatter_error(void) */ cb_unalign_nbytes = 0; H5E_BEGIN_TRY { - ret = H5Dscatter(scatter_error_cb_unalign, &cb_unalign_nbytes, H5T_NATIVE_INT, sid, dst_buf); + ret = H5Dscatter((H5D_scatter_func_t)scatter_error_cb_unalign, &cb_unalign_nbytes, H5T_NATIVE_INT, sid, dst_buf); } H5E_END_TRY if(ret >= 0) TEST_ERROR @@ -9037,13 +9039,13 @@ test_scatter_error(void) */ cb_unalign_nbytes = sizeof(src_buf[0]) - 1; H5E_BEGIN_TRY { - ret = H5Dscatter(scatter_error_cb_unalign, &cb_unalign_nbytes, H5T_NATIVE_INT, sid, dst_buf); + ret = H5Dscatter((H5D_scatter_func_t)scatter_error_cb_unalign, &cb_unalign_nbytes, H5T_NATIVE_INT, sid, dst_buf); } H5E_END_TRY if(ret >= 0) TEST_ERROR cb_unalign_nbytes = sizeof(src_buf[0]) + 1; H5E_BEGIN_TRY { - ret = H5Dscatter(scatter_error_cb_unalign, &cb_unalign_nbytes, H5T_NATIVE_INT, sid, dst_buf); + ret = H5Dscatter((H5D_scatter_func_t)scatter_error_cb_unalign, &cb_unalign_nbytes, H5T_NATIVE_INT, sid, dst_buf); } H5E_END_TRY if(ret >= 0) TEST_ERROR diff --git a/test/dt_arith.c b/test/dt_arith.c index 9f003a6..c3692d0 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); @@ -751,8 +751,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); @@ -801,8 +801,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); @@ -852,13 +852,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; @@ -869,13 +869,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); @@ -1044,11 +1044,11 @@ test_derived_flt(void) */ src_size = H5Tget_size(H5T_NATIVE_INT); endian = H5Tget_order(H5T_NATIVE_INT); - buf = (unsigned char*)malloc(nelmts * (MAX(src_size, size))); - saved_buf = (unsigned char*)malloc(nelmts * src_size); + buf = (unsigned char*)HDmalloc(nelmts * (MAX(src_size, size))); + saved_buf = (unsigned char*)HDmalloc(nelmts * src_size); HDmemset(buf, 0, nelmts * MAX(src_size, size)); HDmemset(saved_buf, 0, nelmts * src_size); - aligned = (int*)calloc((size_t)1, src_size); + aligned = (int*)HDcalloc((size_t)1, src_size); for(i = 0; i < nelmts * src_size; i++) buf[i] = saved_buf[i] = HDrand(); @@ -1105,9 +1105,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; @@ -1204,8 +1204,8 @@ test_derived_flt(void) src_size = H5Tget_size(tid2); dst_size = H5Tget_size(tid1); endian = H5Tget_order(tid2); - buf = (unsigned char*)malloc(nelmts*(MAX(src_size, dst_size))); - saved_buf = (unsigned char*)malloc(nelmts*src_size); + buf = (unsigned char*)HDmalloc(nelmts*(MAX(src_size, dst_size))); + saved_buf = (unsigned char*)HDmalloc(nelmts*src_size); HDmemset(buf, 0, nelmts*MAX(src_size, dst_size)); HDmemset(saved_buf, 0, nelmts*src_size); @@ -1268,8 +1268,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(); @@ -1301,9 +1301,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); @@ -1594,8 +1594,8 @@ test_derived_integer(void) goto error; } /* end if */ - free(buf); - free(saved_buf); + HDfree(buf); + HDfree(saved_buf); PASSED(); reset_hdf5(); /*print statistics*/ @@ -1603,8 +1603,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); @@ -2781,7 +2781,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) { @@ -2805,7 +2805,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; } diff --git a/test/dtypes.c b/test/dtypes.c index de64713..5826097 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(); @@ -1175,9 +1175,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 +1223,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(); @@ -1790,7 +1790,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(); @@ -1804,7 +1804,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; @@ -1983,10 +1983,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) @@ -4547,7 +4547,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; @@ -4569,7 +4569,7 @@ test_conv_enum_2(void) } /* Cleanup */ - free(data); + HDfree(data); H5Tclose(srctype); H5Tclose(dsttype); H5Tclose(oddsize); @@ -5387,7 +5387,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 +5406,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 +5425,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 +5543,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 +5656,8 @@ test_encode(void) goto error; } /* end if */ - free(cmpd_buf); - free(enum_buf); + HDfree(cmpd_buf); + HDfree(enum_buf); PASSED(); return 0; @@ -7062,7 +7062,7 @@ test_utf_ascii_conv(void) char *ascii_r = NULL; const char *ascii_w = "bar!"; char *utf8_r = NULL; - + char filename[1024]; char ascii2[4], utf8_2[4]; herr_t status; @@ -7095,7 +7095,8 @@ test_utf_ascii_conv(void) FAIL_STACK_ERROR /* Create a file */ - if((fid = H5Fcreate(FILENAME[10], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + h5_fixname(FILENAME[10], H5P_DEFAULT, filename, sizeof filename); + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a scalar dataspace for the dataset */ if((sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR diff --git a/test/h5test.c b/test/h5test.c index 32d78bd..30a3adf 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -751,7 +751,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 == ';') diff --git a/test/links.c b/test/links.c index 6aad164..f3414b4 100644 --- a/test/links.c +++ b/test/links.c @@ -4001,6 +4001,9 @@ external_set_elink_acc_flags(hid_t fapl, hbool_t new_format) /* Create a group through the external link using gapl (should succeed) */ if((group = H5Gcreate2(file1, "/ext_link/group", H5P_DEFAULT, H5P_DEFAULT, gapl)) < 0) TEST_ERROR + /* Close group */ + if(H5Gclose(group) < 0) TEST_ERROR + /* Unset elink access flags on gapl */ if(H5Pset_elink_acc_flags(gapl, H5F_ACC_DEFAULT) < 0) TEST_ERROR @@ -4028,8 +4031,7 @@ external_set_elink_acc_flags(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(ret != FAIL) TEST_ERROR - /* Close file1 and group */ - if(H5Gclose(group) < 0) TEST_ERROR + /* Close file1 */ if(H5Fclose(file1) < 0) TEST_ERROR /* Verify that H5Fcreate and H5Fopen reject H5F_ACC_DEFAULT */ diff --git a/test/ntypes.c b/test/ntypes.c index 0af3a3f..c52c08f 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -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/tarray.c b/test/tarray.c index 299c74e..e3999bb 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -637,7 +637,7 @@ test_array_compound_atomic(void) CHECK(mname, NULL, "H5Tget_member_name"); if(HDstrcmp(mname, "i") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); - free(mname); + HDfree(mname); /* Check the 1st field's offset */ off = H5Tget_member_offset(tid2, 0); @@ -656,7 +656,7 @@ test_array_compound_atomic(void) CHECK(mname, NULL, "H5Tget_member_name"); if(HDstrcmp(mname, "f") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); - free(mname); + HDfree(mname); /* Check the 2nd field's offset */ off = H5Tget_member_offset(tid2, 1); @@ -849,7 +849,7 @@ test_array_compound_array(void) CHECK(mname, NULL, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); - free(mname); + HDfree(mname); /* Check the 1st field's offset */ off=H5Tget_member_offset(tid2,0); @@ -868,7 +868,7 @@ test_array_compound_array(void) CHECK(mname, NULL, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); - free(mname); + HDfree(mname); /* Check the 2nd field's offset */ off=H5Tget_member_offset(tid2,1); @@ -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 */ @@ -1848,7 +1848,7 @@ test_compat(void) CHECK(mname, NULL, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); - free(mname); + HDfree(mname); /* Check the 1st field's offset */ off=H5Tget_member_offset(tid1,0); @@ -1867,7 +1867,7 @@ test_compat(void) CHECK(mname, NULL, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); - free(mname); + HDfree(mname); /* Check the 2nd field's offset */ off=H5Tget_member_offset(tid1,1); @@ -1886,7 +1886,7 @@ test_compat(void) CHECK(mname, NULL, "H5Tget_member_name"); if(HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); - free(mname); + HDfree(mname); /* Check the 3rd field's offset */ off=H5Tget_member_offset(tid1,2); @@ -1930,7 +1930,7 @@ test_compat(void) CHECK(mname, NULL, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); - if(mname) free(mname); + if(mname) HDfree(mname); /* Check the 1st field's offset */ off=H5Tget_member_offset(tid1,0); @@ -1949,7 +1949,7 @@ test_compat(void) CHECK(mname, NULL, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); - if(mname) free(mname); + if(mname) HDfree(mname); /* Check the 2nd field's offset */ off=H5Tget_member_offset(tid1,1); @@ -1994,7 +1994,7 @@ test_compat(void) CHECK(mname, NULL, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); - if(mname) free(mname); + if(mname) HDfree(mname); /* Check the 3rd field's offset */ off=H5Tget_member_offset(tid1,2); @@ -2039,7 +2039,7 @@ test_compat(void) CHECK(mname, NULL, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"d")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); - if(mname) free(mname); + if(mname) HDfree(mname); /* Check the 4th field's offset */ off=H5Tget_member_offset(tid1,3); diff --git a/test/tattr.c b/test/tattr.c index 6556e09..8774e18 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -829,7 +829,7 @@ test_attr_compound_read(hid_t fapl) HDstrcmp(fieldname, ATTR4_FIELDNAME2) || HDstrcmp(fieldname, ATTR4_FIELDNAME3))) TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname); - free(fieldname); + HDfree(fieldname); } /* end for */ offset = H5Tget_member_offset(type, 0); VERIFY(offset, attr4_field1_off, "H5Tget_member_offset"); diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index 569e938..b268661 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -89,5 +89,6 @@ else fi # Clean up temporary files/directories and leave -$RM $PLUGIN_LIBDIR2 +$RM $PLUGIN_LIBDIR1 $PLUGIN_LIBDIR2 + exit $exit_code diff --git a/test/tfile.c b/test/tfile.c index 48d5767..0bb20dd 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1042,6 +1042,40 @@ test_get_obj_ids(void) H5Fclose(fid); HDfree(oid_list); + + /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works + * when the file is closed first */ + fid = H5Fopen(FILE7, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* Open NDSETS datasets under the root group */ + for(n = 0; n < NDSETS; n++) { + sprintf(dname, "dataset%d", n); + dset[n] = H5Dopen2(fid, dname, H5P_DEFAULT); + CHECK(dset[n], FAIL, "H5Dcreate2"); + } + + /* Close the file first */ + H5Fclose(fid); + + /* Get the number of all opened objects */ + oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL); + CHECK(oid_count, FAIL, "H5Fget_obj_count"); + VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); + + oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); + 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); + CHECK(ret_count, FAIL, "H5Fget_obj_ids"); + VERIFY(ret_count, NDSETS, "H5Fget_obj_count"); + + /* Close all open objects with H5Oclose */ + for(n = 0; n < oid_count; n++) + H5Oclose(oid_list[n]); + + HDfree(oid_list); } /**************************************************************** diff --git a/test/tgenprop.c b/test/tgenprop.c index f304f11..5f8d8f5 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -88,7 +88,7 @@ test_genprop_basic_class(void) CHECK_PTR(name, "H5Pget_class_name"); if(HDstrcmp(name,CLASS1_NAME)!=0) TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME); - free(name); + HDfree(name); /* Check class parent */ cid2 = H5Pget_class_parent(cid1); @@ -119,7 +119,7 @@ test_genprop_basic_class(void) CHECK_PTR(name, "H5Pget_class_name"); if(HDstrcmp(name,CLASS2_NAME)!=0) TestErrPrintf("Class names don't match!, name=%s, CLASS2_NAME=%s\n",name,CLASS2_NAME); - free(name); + HDfree(name); /* Check class parent */ cid2 = H5Pget_class_parent(cid1); @@ -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); @@ -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; } diff --git a/test/tmisc.c b/test/tmisc.c index 3ade713..486bdba 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -1677,7 +1677,7 @@ test_misc8(void) /* Free the read & write buffers */ HDfree(wdata); #ifdef VERIFY_DATA - free(rdata); + HDfree(rdata); #endif /* VERIFY_DATA */ } /* end test_misc8() */ diff --git a/test/trefer.c b/test/trefer.c index 9031fdb..698e95a 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -90,9 +90,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); @@ -234,9 +234,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() */ /**************************************************************** @@ -271,9 +271,9 @@ test_reference_obj(void) 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); @@ -482,9 +482,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() */ /**************************************************************** @@ -763,10 +763,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() */ /**************************************************************** @@ -1048,10 +1048,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() */ /**************************************************************** diff --git a/test/tselect.c b/test/tselect.c index 1041ab3..8ca3c24 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -354,8 +354,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 { @@ -637,8 +637,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() */ /**************************************************************** @@ -750,8 +750,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() */ /**************************************************************** @@ -890,8 +890,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() */ /**************************************************************** @@ -5406,8 +5406,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() */ /**************************************************************** @@ -5537,8 +5537,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() */ /**************************************************************** @@ -5667,8 +5667,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() */ /**************************************************************** @@ -6440,8 +6440,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() */ /**************************************************************** @@ -7620,8 +7620,8 @@ test_select_none(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - free(wbuf); - free(rbuf); + HDfree(wbuf); + HDfree(rbuf); } /* test_select_none() */ /**************************************************************** diff --git a/test/tsohm.c b/test/tsohm.c index eb5f7c5..8ebfd52 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -3884,7 +3884,7 @@ test_sohm_external_dtype(void) CHECK_I(dset1_tid, "H5Dget_type"); /* Allocate space and initialize data */ - orig = (s1_t*)malloc(NX * NY * sizeof(s1_t)); + orig = (s1_t*)HDmalloc(NX * NY * sizeof(s1_t)); for(i=0; i<NX*NY; i++) { s_ptr = (s1_t*)orig + i; s_ptr->a = i*3 + 1; @@ -3963,7 +3963,7 @@ test_sohm_external_dtype(void) ret = H5Fclose(file2); CHECK_I(ret, "H5Fclose"); - free(orig); + HDfree(orig); } 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 0386352..7dfda16 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -605,7 +605,7 @@ void test_compound(hid_t fid, const char * string) readbuf = H5Tget_member_name(s1_tid, 0); ret = HDstrcmp(readbuf, string); VERIFY(ret, 0, "strcmp"); - free(readbuf); + HDfree(readbuf); /* Add the other fields to the datatype */ ret = H5Tinsert(s1_tid, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE); @@ -718,7 +718,7 @@ void test_opaque(hid_t UNUSED fid, const char * string) read_buf = H5Tget_tag(type_id); ret = strcmp(read_buf, string); VERIFY(ret, 0, "H5Tget_tag"); - free(read_buf); + HDfree(read_buf); ret = H5Tclose(type_id); CHECK(ret, FAIL, "H5Tclose"); |