summaryrefslogtreecommitdiffstats
path: root/test/page_buffer.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/page_buffer.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/page_buffer.c')
-rw-r--r--test/page_buffer.c102
1 files changed, 51 insertions, 51 deletions
diff --git a/test/page_buffer.c b/test/page_buffer.c
index a6f7f0a..aed35ef 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -104,7 +104,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl)
FAIL_STACK_ERROR;
num_elements = NX * NY;
- if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL)
+ if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL)
TEST_ERROR;
for (i = 0; i < (int)num_elements; i++)
data[i] = i;
@@ -150,7 +150,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl)
if (H5Dclose(dset_id) < 0)
FAIL_STACK_ERROR;
- HDmemset(data, 0, (size_t)num_elements * sizeof(int));
+ memset(data, 0, (size_t)num_elements * sizeof(int));
if ((dset_id = H5Dopen2(grp_id, dset_name, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR;
if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
@@ -160,7 +160,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl)
for (j = 0; j < num_elements; j++) {
if (data[j] != j) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
FAIL_STACK_ERROR;
}
}
@@ -185,7 +185,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl)
if (H5Sclose(filespace) < 0)
FAIL_STACK_ERROR;
- HDfree(data);
+ free(data);
return 0;
error:
@@ -196,7 +196,7 @@ error:
H5Gclose(grp_id);
H5Fclose(file_id);
if (data)
- HDfree(data);
+ free(data);
}
H5E_END_TRY;
return (1);
@@ -253,7 +253,7 @@ open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size
FAIL_STACK_ERROR;
num_elements = NX * NY;
- if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL)
+ if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL)
TEST_ERROR;
for (i = 0; i < NUM_DSETS; i++) {
@@ -270,7 +270,7 @@ open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size
for (j = 0; j < num_elements; j++) {
if (data[j] != j) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
FAIL_STACK_ERROR;
}
}
@@ -280,7 +280,7 @@ open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size
FAIL_STACK_ERROR;
if (H5Fclose(file_id) < 0)
FAIL_STACK_ERROR;
- HDfree(data);
+ free(data);
return 0;
@@ -290,7 +290,7 @@ error:
H5Gclose(grp_id);
H5Fclose(file_id);
if (data)
- HDfree(data);
+ free(data);
}
H5E_END_TRY;
return 1;
@@ -324,7 +324,7 @@ set_multi_split(const char *env_h5_drvr, hid_t fapl, hsize_t pagesize)
if (split || multi) {
- HDmemset(memb_name, 0, sizeof memb_name);
+ memset(memb_name, 0, sizeof memb_name);
/* Get current split settings */
if (H5Pget_fapl_multi(fapl, memb_map, memb_fapl_arr, memb_name, memb_addr, &relax) < 0)
@@ -348,7 +348,7 @@ set_multi_split(const char *env_h5_drvr, hid_t fapl, hsize_t pagesize)
/* Free memb_name */
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
- HDfree(memb_name[mt]);
+ free(memb_name[mt]);
} /* end if */
@@ -580,7 +580,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
if (set_multi_split(env_h5_drvr, fapl, sizeof(int) * 200) != 0)
TEST_ERROR;
- if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL)
+ if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL)
TEST_ERROR;
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
@@ -673,7 +673,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
for (i = 0; i < 400; i++) {
if (data[i] != -1) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
FAIL_STACK_ERROR;
}
}
@@ -687,7 +687,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
for (i = 0; i < 1; i++) {
if (data[i] != -1) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
TEST_ERROR;
}
}
@@ -702,7 +702,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
for (i = 0; i < 100; i++) {
if (data[i] != i + 350) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
TEST_ERROR;
}
}
@@ -717,13 +717,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
while (i < 800) {
if ((i >= 100 && i < 300) || (i >= 600)) {
if (data[i] != i) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
TEST_ERROR;
}
}
else {
if (data[i] != -1) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
TEST_ERROR;
}
}
@@ -739,7 +739,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
for (i = 0; i < 800; i++) {
if (data[i] != i) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
TEST_ERROR;
}
}
@@ -765,13 +765,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
while (i < 1000) {
if (i < 400) {
if (data[i] != i) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
TEST_ERROR;
}
}
else {
if (data[i] != 0) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
TEST_ERROR;
}
}
@@ -786,7 +786,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
if (H5Pclose(fapl) < 0)
FAIL_STACK_ERROR;
- HDfree(data);
+ free(data);
PASSED();
return 0;
@@ -798,7 +798,7 @@ error:
H5Pclose(fcpl);
H5Fclose(file_id);
if (data)
- HDfree(data);
+ free(data);
}
H5E_END_TRY;
return 1;
@@ -848,7 +848,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
if (set_multi_split(env_h5_drvr, fapl, sizeof(int) * 200) != 0)
TEST_ERROR;
- if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL)
+ if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL)
TEST_ERROR;
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
@@ -952,7 +952,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
for (i = 0; i < 1; i++) {
if (data[i] != -1) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
TEST_ERROR;
} /* end if */
} /* end for */
@@ -979,7 +979,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
for (i = 0; i < 100; i++) {
if (data[i] != i + 350) {
- HDfprintf(stderr, "Read different values than written\n");
+ fprintf(stderr, "Read different values than written\n");
TEST_ERROR;
} /* end if */
} /* end for */
@@ -1028,7 +1028,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
if (H5Pclose(fapl) < 0)
FAIL_STACK_ERROR;
- HDfree(data);
+ free(data);
PASSED();
return 0;
@@ -1040,7 +1040,7 @@ error:
H5Pclose(fcpl);
H5Fclose(file_id);
if (data)
- HDfree(data);
+ free(data);
}
H5E_END_TRY;
return 1;
@@ -1083,7 +1083,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
H5F_t *f = NULL;
TESTING("Minimum Metadata threshold Processing");
- HDprintf("\n");
+ printf("\n");
h5_fixname(FILENAME[0], orig_fapl, filename, sizeof(filename));
if ((fapl = H5Pcopy(orig_fapl)) < 0)
@@ -1092,7 +1092,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if (set_multi_split(env_h5_drvr, fapl, sizeof(int) * 200) != 0)
TEST_ERROR;
- if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL)
+ if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL)
TEST_ERROR;
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
@@ -1104,7 +1104,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if (H5Pset_file_space_page_size(fcpl, sizeof(int) * 200) < 0)
FAIL_STACK_ERROR;
- HDprintf("\tMinimum metadata threshold = 100%%\n");
+ printf("\tMinimum metadata threshold = 100%%\n");
/* keep 5 pages at max in the page buffer and 5 meta page minimum */
if (H5Pset_page_buffer_size(fapl, sizeof(int) * 1000, 100, 0) < 0)
@@ -1121,9 +1121,9 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
/* opening the file inserts one or more pages into the page buffer.
* Get the raw and meta counts now, so we can adjust tests accordingly.
*/
- HDassert(f);
- HDassert(f->shared);
- HDassert(f->shared->page_buf);
+ assert(f);
+ assert(f->shared);
+ assert(f->shared->page_buf);
base_raw_cnt = f->shared->page_buf->raw_count;
base_meta_cnt = f->shared->page_buf->meta_count;
@@ -1235,7 +1235,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if (H5Fclose(file_id) < 0)
FAIL_STACK_ERROR;
- HDprintf("\tMinimum raw data threshold = 100%%\n");
+ printf("\tMinimum raw data threshold = 100%%\n");
page_count = 0;
@@ -1255,9 +1255,9 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
/* opening the file inserts one or more pages into the page buffer.
* Get the raw and meta counts now, so we can adjust tests accordingly.
*/
- HDassert(f);
- HDassert(f->shared);
- HDassert(f->shared->page_buf);
+ assert(f);
+ assert(f->shared);
+ assert(f->shared->page_buf);
base_raw_cnt = f->shared->page_buf->raw_count;
base_meta_cnt = f->shared->page_buf->meta_count;
@@ -1365,7 +1365,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if (H5Fclose(file_id) < 0)
FAIL_STACK_ERROR;
- HDprintf("\tMinimum metadata threshold = 40%%, Minimum rawdata threshold = 40%%\n");
+ printf("\tMinimum metadata threshold = 40%%, Minimum rawdata threshold = 40%%\n");
page_count = 0;
/* keep 5 pages at max in the page buffer 2 meta pages, 2 raw pages
* minimum
@@ -1510,7 +1510,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if (H5Fclose(file_id) < 0)
FAIL_STACK_ERROR;
- HDprintf("\tMinimum metadata threshold = 20%%\n");
+ printf("\tMinimum metadata threshold = 20%%\n");
page_count = 0;
/* keep 5 pages at max in the page buffer and 1 meta page minimum */
if (H5Pset_page_buffer_size(fapl, sizeof(int) * 1000, 39, 0) < 0)
@@ -1646,7 +1646,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if (H5Pclose(fapl) < 0)
FAIL_STACK_ERROR;
- HDfree(data);
+ free(data);
PASSED();
@@ -1660,7 +1660,7 @@ error:
H5Pclose(fcpl);
H5Fclose(file_id);
if (data)
- HDfree(data);
+ free(data);
}
H5E_END_TRY;
@@ -1711,7 +1711,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
if (set_multi_split(env_h5_drvr, fapl, sizeof(int) * 200) != 0)
TEST_ERROR;
- if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL)
+ if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL)
TEST_ERROR;
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
@@ -1738,9 +1738,9 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
* Get the raw and meta counts now, so we can adjust the expected
* statistics accordingly.
*/
- HDassert(f);
- HDassert(f->shared);
- HDassert(f->shared->page_buf);
+ assert(f);
+ assert(f->shared);
+ assert(f->shared->page_buf);
base_raw_cnt = f->shared->page_buf->raw_count;
base_meta_cnt = f->shared->page_buf->meta_count;
@@ -1938,7 +1938,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
if (H5Pclose(fapl) < 0)
FAIL_STACK_ERROR;
- HDfree(data);
+ free(data);
PASSED();
return 0;
@@ -1950,7 +1950,7 @@ error:
H5Pclose(fcpl);
H5Fclose(file_id);
if (data)
- HDfree(data);
+ free(data);
}
H5E_END_TRY;
@@ -2111,7 +2111,7 @@ main(void)
SKIPPED();
HDputs("Skip page buffering test because paged aggregation is disabled for multi/split drivers");
- HDexit(EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
} /* end if */
if ((fapl = h5_fileaccess()) < 0) {
@@ -2151,10 +2151,10 @@ main(void)
HDputs("All Page Buffering tests passed.");
- HDexit(EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
error:
- HDprintf("***** %d Page Buffering TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
+ printf("***** %d Page Buffering TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
H5E_BEGIN_TRY
{
@@ -2165,5 +2165,5 @@ error:
if (api_ctx_pushed)
H5CX_pop(FALSE);
- HDexit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
} /* main() */