summaryrefslogtreecommitdiffstats
path: root/test/tvltypes.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tvltypes.c')
-rw-r--r--test/tvltypes.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 1e0de1c..0a1f872 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -60,7 +60,7 @@ test_vltypes_alloc_custom(size_t size, void *mem_used)
* DEC Alpha to keep the alignment correct - QAK)
*/
- if ((ret_value = HDmalloc(extra + size)) != NULL) {
+ if ((ret_value = malloc(extra + size)) != NULL) {
*(size_t *)ret_value = size;
*(size_t *)mem_used += size;
} /* end if */
@@ -90,7 +90,7 @@ test_vltypes_free_custom(void *_mem, void *mem_used)
unsigned char *mem = ((unsigned char *)_mem) - extra; /* Pointer to actual block allocated */
*(size_t *)mem_used -= *(size_t *)((void *)mem);
- HDfree(mem);
+ free(mem);
} /* end if */
}
@@ -254,7 +254,7 @@ test_vltypes_vlen_atomic(void)
/* Allocate and initialize VL data to write */
for (i = 0; i < SPACE1_DIM1; i++) {
- wdata[i].p = HDmalloc((i + 1) * sizeof(unsigned int));
+ wdata[i].p = malloc((i + 1) * sizeof(unsigned int));
wdata[i].len = i + 1;
for (j = 0; j < (i + 1); j++)
((unsigned int *)wdata[i].p)[j] = i * 10 + j;
@@ -585,7 +585,7 @@ rewrite_vltypes_vlen_atomic(void)
/* Allocate and initialize VL data to write */
for (i = 0; i < SPACE1_DIM1; i++) {
- wdata[i].p = HDmalloc((i + increment) * sizeof(unsigned int));
+ wdata[i].p = malloc((i + increment) * sizeof(unsigned int));
wdata[i].len = i + increment;
for (j = 0; j < (i + increment); j++)
((unsigned int *)wdata[i].p)[j] = i * 20 + j;
@@ -747,7 +747,7 @@ test_vltypes_vlen_compound(void)
/* Allocate and initialize VL data to write */
for (i = 0; i < SPACE1_DIM1; i++) {
- wdata[i].p = HDmalloc((i + 1) * sizeof(s1));
+ wdata[i].p = malloc((i + 1) * sizeof(s1));
wdata[i].len = i + 1;
for (j = 0; j < (i + 1); j++) {
((s1 *)wdata[i].p)[j].i = (int)(i * 10 + j);
@@ -899,7 +899,7 @@ rewrite_vltypes_vlen_compound(void)
/* Allocate and initialize VL data to write */
for (i = 0; i < SPACE1_DIM1; i++) {
- wdata[i].p = HDmalloc((i + increment) * sizeof(s1));
+ wdata[i].p = malloc((i + increment) * sizeof(s1));
wdata[i].len = i + increment;
for (j = 0; j < (i + increment); j++) {
((s1 *)wdata[i].p)[j].i = (int)(i * 40 + j);
@@ -1048,17 +1048,17 @@ test_vltypes_compound_vlen_vlen(void)
MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n"));
/* Allocate and initialize VL data to write */
- wdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1);
- CHECK_PTR(wdata, "HDmalloc");
- rdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1);
- CHECK_PTR(rdata, "HDmalloc");
+ wdata = (s1 *)malloc(sizeof(s1) * SPACE3_DIM1);
+ CHECK_PTR(wdata, "malloc");
+ rdata = (s1 *)malloc(sizeof(s1) * SPACE3_DIM1);
+ CHECK_PTR(rdata, "malloc");
for (i = 0; i < SPACE3_DIM1; i++) {
wdata[i].i = (int)(i * 10);
wdata[i].f = (float)(i * 20) / 3.0F;
- wdata[i].v.p = HDmalloc((i + L1_INCM) * sizeof(hvl_t));
+ wdata[i].v.p = malloc((i + L1_INCM) * sizeof(hvl_t));
wdata[i].v.len = i + L1_INCM;
for (t1 = (hvl_t *)((wdata[i].v).p), j = 0; j < (i + L1_INCM); j++, t1++) {
- t1->p = HDmalloc((j + L2_INCM) * sizeof(unsigned int));
+ t1->p = malloc((j + L2_INCM) * sizeof(unsigned int));
t1->len = j + L2_INCM;
for (k = 0; k < j + L2_INCM; k++)
((unsigned int *)t1->p)[k] = i * 100 + j * 10 + k;
@@ -1190,8 +1190,8 @@ test_vltypes_compound_vlen_vlen(void)
CHECK(ret, FAIL, "H5Fclose");
/* Release buffers */
- HDfree(wdata);
- HDfree(rdata);
+ free(wdata);
+ free(rdata);
} /* end test_vltypes_compound_vlen_vlen() */
/****************************************************************
@@ -1238,11 +1238,11 @@ test_vltypes_compound_vlstr(void)
/* Allocate and initialize VL data to write */
for (i = 0; i < SPACE1_DIM1; i++) {
- wdata[i].v.p = (s2 *)HDmalloc((i + L3_INCM) * sizeof(s2));
+ wdata[i].v.p = (s2 *)malloc((i + L3_INCM) * sizeof(s2));
wdata[i].v.len = i + L3_INCM;
for (t1 = (s2 *)((wdata[i].v).p), j = 0; j < (i + L3_INCM); j++, t1++) {
HDstrcat(str, "m");
- t1->string = (char *)HDmalloc(HDstrlen(str) * sizeof(char) + 1);
+ t1->string = (char *)malloc(HDstrlen(str) * sizeof(char) + 1);
HDstrcpy(t1->string, str);
/*t1->color = red;*/
t1->color = blue;
@@ -1408,11 +1408,11 @@ test_vltypes_compound_vlstr(void)
/* Use this part for new data */
HDstrcpy(str, "bbbbbbbb\0");
for (i = 0; i < SPACE1_DIM1; i++) {
- wdata2[i].v.p = (s2 *)HDmalloc((i + 1) * sizeof(s2));
+ wdata2[i].v.p = (s2 *)malloc((i + 1) * sizeof(s2));
wdata2[i].v.len = i + 1;
for (t1 = (s2 *)(wdata2[i].v).p, j = 0; j < i + 1; j++, t1++) {
HDstrcat(str, "pp");
- t1->string = (char *)HDmalloc(HDstrlen(str) * sizeof(char) + 1);
+ t1->string = (char *)malloc(HDstrlen(str) * sizeof(char) + 1);
HDstrcpy(t1->string, str);
t1->color = green;
}
@@ -1526,7 +1526,7 @@ test_vltypes_compound_vlen_atomic(void)
for (i = 0; i < SPACE1_DIM1; i++) {
wdata[i].i = (int)(i * 10);
wdata[i].f = (float)(i * 20) / 3.0F;
- wdata[i].v.p = HDmalloc((i + 1) * sizeof(unsigned int));
+ wdata[i].v.p = malloc((i + 1) * sizeof(unsigned int));
wdata[i].v.len = i + 1;
for (j = 0; j < (i + 1); j++)
((unsigned int *)wdata[i].v.p)[j] = i * 10 + j;
@@ -1630,7 +1630,7 @@ test_vltypes_compound_vlen_atomic(void)
CHECK(dcpl_pid, FAIL, "H5Pcreate");
/* Set the fill value for the second dataset */
- HDmemset(&fill, 0, sizeof(s1));
+ memset(&fill, 0, sizeof(s1));
ret = H5Pset_fill_value(dcpl_pid, tid2, &fill);
CHECK(ret, FAIL, "H5Pset_fill_value");
@@ -1760,7 +1760,7 @@ rewrite_vltypes_compound_vlen_atomic(void)
for (i = 0; i < SPACE1_DIM1; i++) {
wdata[i].i = (int)(i * 40);
wdata[i].f = (float)(i * 50) / 3.0F;
- wdata[i].v.p = HDmalloc((i + increment) * sizeof(unsigned int));
+ wdata[i].v.p = malloc((i + increment) * sizeof(unsigned int));
wdata[i].v.len = i + increment;
for (j = 0; j < (i + increment); j++)
((unsigned int *)wdata[i].v.p)[j] = i * 60 + j;
@@ -1934,14 +1934,14 @@ test_vltypes_vlen_vlen_atomic(void)
/* Allocate and initialize VL data to write */
for (i = 0; i < SPACE1_DIM1; i++) {
- wdata[i].p = HDmalloc((i + 1) * sizeof(hvl_t));
+ wdata[i].p = malloc((i + 1) * sizeof(hvl_t));
if (wdata[i].p == NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i);
return;
} /* end if */
wdata[i].len = i + 1;
for (t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + 1); j++, t1++) {
- t1->p = HDmalloc((j + 1) * sizeof(unsigned int));
+ t1->p = malloc((j + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j);
return;
@@ -2135,14 +2135,14 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void)
/* Allocate and initialize VL data to write */
for (i = 0; i < SPACE1_DIM1; i++) {
- wdata[i].p = HDmalloc((i + increment) * sizeof(hvl_t));
+ wdata[i].p = malloc((i + increment) * sizeof(hvl_t));
if (wdata[i].p == NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i);
return;
} /* end if */
wdata[i].len = i + increment;
for (t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + increment); j++, t1++) {
- t1->p = HDmalloc((j + 1) * sizeof(unsigned int));
+ t1->p = malloc((j + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j);
return;
@@ -2315,14 +2315,14 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void)
/* Allocate and initialize VL data to write */
for (i = 0; i < SPACE1_DIM1; i++) {
- wdata[i].p = HDmalloc((i + increment) * sizeof(hvl_t));
+ wdata[i].p = malloc((i + increment) * sizeof(hvl_t));
if (wdata[i].p == NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i);
return;
} /* end if */
wdata[i].len = i + increment;
for (t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + increment); j++, t1++) {
- t1->p = HDmalloc((j + 1) * sizeof(unsigned int));
+ t1->p = malloc((j + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j);
return;
@@ -2591,8 +2591,8 @@ test_vltypes_fill_value(void)
CHECK(ret, FAIL, "H5Tclose");
/* Allocate space for the buffer to read data */
- rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct));
- CHECK_PTR(rbuf, "HDmalloc");
+ rbuf = (dtype1_struct *)malloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct));
+ CHECK_PTR(rbuf, "malloc");
/* Create the small & large dataspaces to use */
small_dspace_id = H5Screate_simple(SPACE4_RANK, small_dims, NULL);
@@ -2690,13 +2690,13 @@ test_vltypes_fill_value(void)
} break;
case H5D_VIRTUAL:
- HDassert(0 && "Invalid layout type!");
+ assert(0 && "Invalid layout type!");
break;
case H5D_LAYOUT_ERROR:
case H5D_NLAYOUTS:
default:
- HDassert(0 && "Unknown layout type!");
+ assert(0 && "Unknown layout type!");
break;
} /* end switch */
@@ -2798,13 +2798,13 @@ test_vltypes_fill_value(void)
break;
case H5D_VIRTUAL:
- HDassert(0 && "Invalid layout type!");
+ assert(0 && "Invalid layout type!");
break;
case H5D_LAYOUT_ERROR:
case H5D_NLAYOUTS:
default:
- HDassert(0 && "Unknown layout type!");
+ assert(0 && "Unknown layout type!");
break;
} /* end switch */
@@ -2832,7 +2832,7 @@ test_vltypes_fill_value(void)
CHECK(ret, FAIL, "H5Treclaim");
/* Clear the read buffer */
- HDmemset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
+ memset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
/* Read in non-contiguous selection from 'empty' dataset of fill value */
ret = H5Dread(dset_id, dtype1_id, dset_select_dspace_id, dset_select_dspace_id, xfer_pid, rbuf);
@@ -2890,7 +2890,7 @@ test_vltypes_fill_value(void)
CHECK(ret, FAIL, "H5Treclaim");
/* Clear the read buffer */
- HDmemset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
+ memset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
/* Read in non-contiguous selection from 'empty' dataset of fill value */
ret = H5Dread(dset_id, dtype1_id, dset_select_dspace_id, dset_select_dspace_id, xfer_pid, rbuf);
@@ -2985,13 +2985,13 @@ test_vltypes_fill_value(void)
break;
case H5D_VIRTUAL:
- HDassert(0 && "Invalid layout type!");
+ assert(0 && "Invalid layout type!");
break;
case H5D_LAYOUT_ERROR:
case H5D_NLAYOUTS:
default:
- HDassert(0 && "Unknown layout type!");
+ assert(0 && "Unknown layout type!");
break;
} /* end switch */
@@ -3045,7 +3045,7 @@ test_vltypes_fill_value(void)
CHECK(ret, FAIL, "H5Treclaim");
/* Clear the read buffer */
- HDmemset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
+ memset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
/* Read in non-contiguous selection from dataset */
ret = H5Dread(dset_id, dtype1_id, dset_select_dspace_id, dset_select_dspace_id, xfer_pid, rbuf);
@@ -3133,7 +3133,7 @@ test_vltypes_fill_value(void)
CHECK(ret, FAIL, "H5Treclaim");
/* Clear the read buffer */
- HDmemset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
+ memset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
/* Read in non-contiguous selection from dataset */
ret = H5Dread(dset_id, dtype1_id, dset_select_dspace_id, dset_select_dspace_id, xfer_pid, rbuf);
@@ -3212,7 +3212,7 @@ test_vltypes_fill_value(void)
CHECK(ret, FAIL, "H5Tclose");
/* Release buffer */
- HDfree(rbuf);
+ free(rbuf);
} /* end test_vltypes_fill_value() */
/****************************************************************