summaryrefslogtreecommitdiffstats
path: root/hl/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2013-10-31 04:20:36 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2013-10-31 04:20:36 (GMT)
commite6cace9ee46e903a8612aba7d9d1d72fa0968217 (patch)
treeac7d07ea06d3d5ac73e34bc54ff17620a4d083fe /hl/test
parent2eb24b16dac78b3e27769c20502299475fb8dde6 (diff)
downloadhdf5-e6cace9ee46e903a8612aba7d9d1d72fa0968217.zip
hdf5-e6cace9ee46e903a8612aba7d9d1d72fa0968217.tar.gz
hdf5-e6cace9ee46e903a8612aba7d9d1d72fa0968217.tar.bz2
[svn-r24376] Updated all code to use HDmalloc, HDcalloc, and HDfree.
Prep work for adding a memory free function, part of HDFFV-8551. Tested on: 32-bit LE linux (jam) * with C++, Fortran * with thread safety on These are minor changes (almost entirely renaming foo functions to HDfoo) that don't change functionality. This should not require a full commit test.
Diffstat (limited to 'hl/test')
-rw-r--r--hl/test/gen_test_ds.c4
-rw-r--r--hl/test/test_dset_opt.c10
-rw-r--r--hl/test/test_file_image.c10
3 files changed, 12 insertions, 12 deletions
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index a60a560..2fc8140 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -255,13 +255,13 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc
if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if(H5DSis_attached(did, dsid, idx) == 1) {
if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) {
- name_out = (char*)malloc((size_t)name_len * sizeof (char));
+ name_out = (char*)HDmalloc((size_t)name_len * sizeof (char));
if(name_out != NULL) {
if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) >= 0) {
if(strcmp(scalename,name_out)==0) {
ret_value = SUCCEED;
}
- free(name_out);
+ HDfree(name_out);
name_out=NULL;
}
}
diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c
index 9a0ffb0..08d1c46 100644
--- a/hl/test/test_dset_opt.c
+++ b/hl/test/test_dset_opt.c
@@ -176,7 +176,7 @@ test_direct_chunk_write (hid_t file)
direct_buf[i][j] = n++;
/* Allocate output (compressed) buffer */
- outbuf = malloc(z_dst_nbytes);
+ outbuf = HDmalloc(z_dst_nbytes);
z_dst = (Bytef *)outbuf;
/* Perform compression from the source to the destination buffer */
@@ -206,7 +206,7 @@ test_direct_chunk_write (hid_t file)
}
if(outbuf)
- free(outbuf);
+ HDfree(outbuf);
if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
goto error;
@@ -249,7 +249,7 @@ test_direct_chunk_write (hid_t file)
direct_buf[i][j] = i + j;
/* Allocate output (compressed) buffer */
- outbuf = malloc(z_dst_nbytes);
+ outbuf = HDmalloc(z_dst_nbytes);
z_dst = (Bytef *)outbuf;
/* Perform compression from the source to the destination buffer */
@@ -280,7 +280,7 @@ test_direct_chunk_write (hid_t file)
}
if(outbuf)
- free(outbuf);
+ HDfree(outbuf);
if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
goto error;
@@ -329,7 +329,7 @@ error:
} H5E_END_TRY;
if(outbuf)
- free(outbuf);
+ HDfree(outbuf);
return 1;
}
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index 9729421..831fa23 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -77,23 +77,23 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array of pointers for each of the open images */
- if (NULL == (buf_ptr = (void **)malloc(sizeof(void *) * open_images)))
+ if (NULL == (buf_ptr = (void **)HDmalloc(sizeof(void *) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the name of each of the open images */
- if (NULL == (filename = (char **)malloc(sizeof(char *) * open_images)))
+ if (NULL == (filename = (char **)HDmalloc(sizeof(char *) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the size of each of the open images */
- if (NULL == (buf_size = (ssize_t *)malloc(sizeof(ssize_t) * open_images)))
+ if (NULL == (buf_size = (ssize_t *)HDmalloc(sizeof(ssize_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array for each of the file identifiers */
- if (NULL == (file_id = (hid_t *)malloc(sizeof(hid_t) * open_images)))
+ if (NULL == (file_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array for each of the dataset identifiers */
- if (NULL == (dset_id = (hid_t *)malloc(sizeof(hid_t) * open_images)))
+ if (NULL == (dset_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
TESTING("get file images");