summaryrefslogtreecommitdiffstats
path: root/test/freespace.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-07-27 20:43:30 (GMT)
committerGitHub <noreply@github.com>2023-07-27 20:43:30 (GMT)
commit1e91d96fa02466ffe451319bdac1005f84dc7993 (patch)
tree4de04ef502c313dfd766497b20235188761146c0 /test/freespace.c
parent95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (diff)
downloadhdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.zip
hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.gz
hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.bz2
Brings over most of the HD prefix removal (#3293)
Diffstat (limited to 'test/freespace.c')
-rw-r--r--test/freespace.c195
1 files changed, 97 insertions, 98 deletions
diff --git a/test/freespace.c b/test/freespace.c
index bc41044..9c9a2f2 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -198,8 +198,8 @@ TEST_sect_init_cls(H5FS_section_class_t *cls, void *_udata)
unsigned *init_flags;
/* Check arguments. */
- HDassert(cls);
- HDassert(_udata);
+ assert(cls);
+ assert(_udata);
init_flags = (unsigned *)_udata;
cls->flags |= *init_flags;
@@ -220,10 +220,10 @@ TEST_sect_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_info_t
htri_t ret_value; /* Return value */
/* Check arguments. */
- HDassert(sect1);
- HDassert(sect2);
- HDassert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */
- HDassert(H5F_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr));
+ assert(sect1);
+ assert(sect2);
+ assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */
+ assert(H5F_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr));
/* Check if second section adjoins first section */
ret_value = H5F_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr);
@@ -242,15 +242,15 @@ TEST_sect_merging(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, voi
herr_t ret_value = SUCCEED; /* Return value */
/* Check arguments. */
- HDassert(sect1);
- HDassert(((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE) ||
- ((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE_NEW) ||
- ((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE_NONE));
- HDassert(sect2);
- HDassert((sect2->sect_info.type == TEST_FSPACE_SECT_TYPE) ||
- (sect2->sect_info.type == TEST_FSPACE_SECT_TYPE_NEW) ||
- (sect2->sect_info.type == TEST_FSPACE_SECT_TYPE_NONE));
- HDassert(H5F_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr));
+ assert(sect1);
+ assert(((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE) ||
+ ((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE_NEW) ||
+ ((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE_NONE));
+ assert(sect2);
+ assert((sect2->sect_info.type == TEST_FSPACE_SECT_TYPE) ||
+ (sect2->sect_info.type == TEST_FSPACE_SECT_TYPE_NEW) ||
+ (sect2->sect_info.type == TEST_FSPACE_SECT_TYPE_NONE));
+ assert(H5F_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr));
/* Add second section's size to first section */
(*sect1)->sect_info.size += sect2->sect_info.size;
@@ -269,7 +269,7 @@ static herr_t
TEST_sect_free(H5FS_section_info_t *sect)
{
/* Release the section */
- HDfree(sect);
+ free(sect);
return 0;
} /* TEST_sect_free() */
@@ -334,8 +334,8 @@ TEST_sects_cb(H5FS_section_info_t *_sect, void *_udata)
TEST_iter_ud_t *udata = (TEST_iter_ud_t *)_udata;
herr_t ret_value = SUCCEED; /* Return value */
- HDassert(sect);
- HDassert(udata);
+ assert(sect);
+ assert(udata);
udata->tot_size += sect->sect_info.size;
udata->tot_sect_count += 1;
@@ -363,7 +363,7 @@ TEST_set_eoa(haddr_t val)
static void
init_cparam(H5FS_create_t *cparam)
{
- HDmemset(cparam, 0, sizeof(H5FS_create_t));
+ memset(cparam, 0, sizeof(H5FS_create_t));
/* Set the free space creation parameters */
cparam->shrink_percent = TEST_FSPACE_SHRINK;
@@ -399,28 +399,27 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, frspace_state_t *state)
FAIL_STACK_ERROR;
if (frspace_stats.tot_space != state->tot_space) {
- HDfprintf(stdout, "frspace_stats.tot_space = %" PRIuHSIZE ", state->tot_space = %" PRIuHSIZE "\n",
- frspace_stats.tot_space, state->tot_space);
+ fprintf(stdout, "frspace_stats.tot_space = %" PRIuHSIZE ", state->tot_space = %" PRIuHSIZE "\n",
+ frspace_stats.tot_space, state->tot_space);
TEST_ERROR;
} /* end if */
if (frspace_stats.tot_sect_count != state->tot_sect_count) {
- HDfprintf(stdout,
- "frspace_stats.tot_sect_count = %" PRIuHSIZE ", state->tot_sect_count = %" PRIuHSIZE "\n",
- frspace_stats.tot_sect_count, state->tot_sect_count);
+ fprintf(stdout,
+ "frspace_stats.tot_sect_count = %" PRIuHSIZE ", state->tot_sect_count = %" PRIuHSIZE "\n",
+ frspace_stats.tot_sect_count, state->tot_sect_count);
TEST_ERROR;
} /* end if */
if (frspace_stats.serial_sect_count != state->serial_sect_count) {
- HDfprintf(stdout,
- "frspace_stats.serial_sect_count = %" PRIuHSIZE ", state->serial_sect_count = %" PRIuHSIZE
- "\n",
- frspace_stats.serial_sect_count, state->serial_sect_count);
+ fprintf(stdout,
+ "frspace_stats.serial_sect_count = %" PRIuHSIZE ", state->serial_sect_count = %" PRIuHSIZE
+ "\n",
+ frspace_stats.serial_sect_count, state->serial_sect_count);
TEST_ERROR;
} /* end if */
if (frspace_stats.ghost_sect_count != state->ghost_sect_count) {
- HDfprintf(stdout,
- "frspace_stats.ghost_sect_count = %" PRIuHSIZE ", state->ghost_sect_count = %" PRIuHSIZE
- "\n",
- frspace_stats.ghost_sect_count, state->ghost_sect_count);
+ fprintf(stdout,
+ "frspace_stats.ghost_sect_count = %" PRIuHSIZE ", state->ghost_sect_count = %" PRIuHSIZE "\n",
+ frspace_stats.ghost_sect_count, state->ghost_sect_count);
TEST_ERROR;
} /* end if */
@@ -493,11 +492,11 @@ test_fs_create(hid_t fapl)
if (frsp->nclasses != nclasses)
TEST_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
if (check_stats(f, frsp, &state))
TEST_ERROR;
- HDmemset(&test_cparam, 0, sizeof(H5FS_create_t));
+ memset(&test_cparam, 0, sizeof(H5FS_create_t));
if (H5FS__get_cparam_test(frsp, &test_cparam) < 0)
FAIL_STACK_ERROR;
if (H5FS__cmp_cparam_test(&cparam, &test_cparam))
@@ -633,7 +632,7 @@ test_fs_sect_add(hid_t fapl)
if (!H5F_addr_defined(fs_addr))
TEST_ERROR;
- if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE,
@@ -642,7 +641,7 @@ test_fs_sect_add(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -699,7 +698,7 @@ test_fs_sect_add(hid_t fapl)
TEST_ERROR;
/* Create free list section node */
- if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE,
@@ -708,7 +707,7 @@ test_fs_sect_add(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, 0, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node->sect_info.size;
state.tot_sect_count += 1;
state.ghost_sect_count += 1;
@@ -773,7 +772,7 @@ test_fs_sect_add(hid_t fapl)
if (!H5F_addr_defined(fs_addr))
TEST_ERROR;
- if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
/*
@@ -786,7 +785,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR;
/* nothing in free-space */
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
if (check_stats(f, frsp, &state))
TEST_ERROR;
@@ -843,7 +842,7 @@ test_fs_sect_add(hid_t fapl)
if (!H5F_addr_defined(fs_addr))
TEST_ERROR;
- if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
/*
@@ -855,7 +854,7 @@ test_fs_sect_add(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_DESERIALIZING, &can_shrink) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -966,7 +965,7 @@ test_fs_sect_find(hid_t fapl)
if (!H5F_addr_defined(fs_addr))
TEST_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
if (check_stats(f, frsp, &state))
TEST_ERROR;
@@ -1002,7 +1001,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE,
@@ -1011,7 +1010,7 @@ test_fs_sect_find(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -1022,7 +1021,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section C
*/
- if (NULL == (sect_node3 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node3 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE,
@@ -1041,7 +1040,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE,
@@ -1060,7 +1059,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section D
*/
- if (NULL == (sect_node4 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node4 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE,
@@ -1129,7 +1128,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE,
@@ -1138,7 +1137,7 @@ test_fs_sect_find(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -1149,7 +1148,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE,
@@ -1208,7 +1207,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE,
@@ -1217,7 +1216,7 @@ test_fs_sect_find(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -1356,7 +1355,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section C
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE,
@@ -1365,7 +1364,7 @@ test_fs_sect_merge(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += TEST_SECT_SIZE50;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -1376,7 +1375,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE,
@@ -1394,7 +1393,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node3 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node3 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE,
@@ -1412,7 +1411,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section D
*/
- if (NULL == (sect_node4 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node4 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE,
@@ -1485,7 +1484,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE,
@@ -1494,7 +1493,7 @@ test_fs_sect_merge(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += TEST_SECT_SIZE30;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -1505,7 +1504,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE,
@@ -1588,7 +1587,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE,
@@ -1597,7 +1596,7 @@ test_fs_sect_merge(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += TEST_SECT_SIZE10;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -1608,7 +1607,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30,
@@ -1628,7 +1627,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section C
*/
- if (NULL == (sect_node3 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node3 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50,
@@ -1646,7 +1645,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section D
*/
- if (NULL == (sect_node4 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node4 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE,
@@ -1834,7 +1833,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section A that allow shrinking but its section class type does not define "can_shrink"
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50,
@@ -1844,7 +1843,7 @@ test_fs_sect_shrink(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -1869,7 +1868,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Re-add section A that allow shrinking and its section class type defines "can_shrink"
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE,
@@ -1880,7 +1879,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR;
/* should have nothing in free-space */
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
if (check_stats(f, frsp, &state))
TEST_ERROR;
@@ -1936,7 +1935,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE,
@@ -1945,7 +1944,7 @@ test_fs_sect_shrink(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -1956,7 +1955,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE,
@@ -2036,7 +2035,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE,
@@ -2045,7 +2044,7 @@ test_fs_sect_shrink(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -2056,7 +2055,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE,
@@ -2066,7 +2065,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR;
/* section A & B are merged and then strunk, so there is nothing in free-space */
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
if (check_stats(f, frsp, &state))
TEST_ERROR;
@@ -2178,7 +2177,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE,
@@ -2187,7 +2186,7 @@ test_fs_sect_change_class(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += TEST_SECT_SIZE30;
state.tot_sect_count += 1;
state.ghost_sect_count += 1;
@@ -2198,7 +2197,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50,
@@ -2282,7 +2281,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE,
@@ -2294,7 +2293,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50,
@@ -2306,7 +2305,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section C
*/
- if (NULL == (sect_node3 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node3 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80,
@@ -2466,7 +2465,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE,
@@ -2475,7 +2474,7 @@ test_fs_sect_extend(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -2486,7 +2485,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE,
@@ -2543,7 +2542,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE,
@@ -2552,7 +2551,7 @@ test_fs_sect_extend(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -2563,7 +2562,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE,
@@ -2617,7 +2616,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE,
@@ -2626,7 +2625,7 @@ test_fs_sect_extend(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -2637,7 +2636,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE,
@@ -2692,7 +2691,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section A
*/
- if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE,
@@ -2701,7 +2700,7 @@ test_fs_sect_extend(hid_t fapl)
if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR;
- HDmemset(&state, 0, sizeof(frspace_state_t));
+ memset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node1->sect_info.size;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
@@ -2712,7 +2711,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section B
*/
- if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE,
@@ -2823,7 +2822,7 @@ test_fs_sect_iterate(hid_t fapl)
TEST_ERROR;
for (i = 1; i <= NUM_SECTIONS; i++) {
- if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
+ if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR;
sect_size = (unsigned)((i - 1) % 9) + 1;
@@ -2919,7 +2918,7 @@ main(void)
api_ctx_pushed = FALSE;
h5_cleanup(FILENAME, fapl);
- HDexit(EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
error:
HDputs("*** TESTS FAILED ***");
@@ -2932,5 +2931,5 @@ error:
if (api_ctx_pushed)
H5CX_pop(FALSE);
- HDexit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
} /* main() */