diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-06-28 00:42:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 00:42:48 (GMT) |
commit | d278ce1f21903c33c6b28e8acb827e94275d4421 (patch) | |
tree | d52c322015ac8ce3b8fb992958ab8be1f13d4886 /hl/test | |
parent | 942739e6fbea0ebf736c35f461e1386396b54e11 (diff) | |
download | hdf5-d278ce1f21903c33c6b28e8acb827e94275d4421.zip hdf5-d278ce1f21903c33c6b28e8acb827e94275d4421.tar.gz hdf5-d278ce1f21903c33c6b28e8acb827e94275d4421.tar.bz2 |
Remove HD/hbool_t from high-level lib (#3183)
Diffstat (limited to 'hl/test')
-rw-r--r-- | hl/test/gen_test_ds.c | 16 | ||||
-rw-r--r-- | hl/test/gen_test_ld.c | 6 | ||||
-rw-r--r-- | hl/test/h5hltest.h | 8 | ||||
-rw-r--r-- | hl/test/test_ds.c | 472 | ||||
-rw-r--r-- | hl/test/test_dset_append.c | 14 | ||||
-rw-r--r-- | hl/test/test_file_image.c | 72 | ||||
-rw-r--r-- | hl/test/test_h5do_compat.c | 10 | ||||
-rw-r--r-- | hl/test/test_image.c | 158 | ||||
-rw-r--r-- | hl/test/test_ld.c | 60 | ||||
-rw-r--r-- | hl/test/test_lite.c | 223 | ||||
-rw-r--r-- | hl/test/test_packet.c | 14 | ||||
-rw-r--r-- | hl/test/test_packet_vlen.c | 161 | ||||
-rw-r--r-- | hl/test/test_table.c | 63 |
13 files changed, 637 insertions, 640 deletions
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c index 7b45694..438a35a 100644 --- a/hl/test/gen_test_ds.c +++ b/hl/test/gen_test_ds.c @@ -79,12 +79,12 @@ main(int argc, char **argv) char filename[65]; if (argc < 2 || !argv[0] || !argv[1]) { - HDprintf("Usage: gen_test [le | be]\n"); + printf("Usage: gen_test [le | be]\n"); return 1; } if (argv[1] && (strcmp("le", argv[1]) != 0) && (strcmp("be", argv[1]) != 0)) { - HDprintf("Usage: gen_test [le | be]\n"); + printf("Usage: gen_test [le | be]\n"); return 1; } @@ -104,11 +104,11 @@ main(int argc, char **argv) if (nerrors) goto error; - HDprintf("Dimension scales file generation passed.\n"); + printf("Dimension scales file generation passed.\n"); return 0; error: - HDprintf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n", nerrors); + printf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n", nerrors); return 1; } @@ -192,11 +192,11 @@ test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx) if (H5DSis_attached(did, dsid, idx) == 0) { if (H5DSattach_scale(did, dsid, idx) >= 0) { if (H5DSis_attached(did, dsid, idx) > 0) { - /* HDprintf(" scale attached "); */ + /* printf(" scale attached "); */ ret_value = SUCCEED; } else if (H5DSis_attached(did, dsid, idx) == 0) { - HDprintf(" scale not attached "); + printf(" scale not attached "); } } } @@ -260,13 +260,13 @@ test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename 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 *)HDmalloc((size_t)name_len * sizeof(char)); + name_out = (char *)malloc((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; } - HDfree(name_out); + free(name_out); name_out = NULL; } } diff --git a/hl/test/gen_test_ld.c b/hl/test/gen_test_ld.c index 8eacf55..7eefd5c 100644 --- a/hl/test/gen_test_ld.c +++ b/hl/test/gen_test_ld.c @@ -103,7 +103,7 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m goto done; /* Set up dataset's creation properties */ - if (!HDstrcmp(dname, DSET_NONE)) + if (!strcmp(dname, DSET_NONE)) dcpl = H5P_DEFAULT; else { hsize_t chunk_dims[H5S_MAX_RANK]; /* Dimension sizes for chunks */ @@ -116,11 +116,11 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m goto done; } /* end else */ - if (!HDstrcmp(dname, DSET_ALLOC_LATE)) { + if (!strcmp(dname, DSET_ALLOC_LATE)) { if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto done; } /* end if */ - else if (!HDstrcmp(dname, DSET_ALLOC_EARLY)) { + else if (!strcmp(dname, DSET_ALLOC_EARLY)) { if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto done; } /* end if */ diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h index f3df26a..2faa492 100644 --- a/hl/test/h5hltest.h +++ b/hl/test/h5hltest.h @@ -29,13 +29,13 @@ /* Macros used in HL tests */ #define HL_TESTING2(WHAT) \ do { \ - HDprintf("Testing %-62s", WHAT); \ - HDfflush(stdout); \ + printf("Testing %-62s", WHAT); \ + fflush(stdout); \ } while (0) #define HL_TESTING3(WHAT) \ do { \ - HDprintf("Testing %-62s", WHAT); \ - HDfflush(stdout); \ + printf("Testing %-62s", WHAT); \ + fflush(stdout); \ } while (0) /* Implements verbose 'assert' with 'goto error' exit */ diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 9792441..f85ed81 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -214,11 +214,11 @@ main(void) if (nerrors) goto error; - HDprintf("All dimension scales tests passed.\n"); + printf("All dimension scales tests passed.\n"); return 0; error: - HDprintf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); + printf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } @@ -245,7 +245,7 @@ create_test_file(const char *fileext) { char filename[65]; - HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); + snprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); return H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); } @@ -255,7 +255,7 @@ open_test_file(const char *fileext) { char filename[65]; - HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); + snprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); } @@ -284,7 +284,7 @@ create_char_dataset(hid_t fid, const char *dsidx, int fulldims) char s33_wbuf[DIM3_SIZE] = {6, 6, 6, 12, 12, 12, 53, 53, 53, 120, 120, 120}; char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if (H5LTmake_dataset_char(fid, name, rank, dims, NULL) >= 0) { @@ -338,7 +338,7 @@ create_short_dataset(hid_t fid, const char *dsidx, int fulldims) short s33_wbuf[DIM3_SIZE] = {6, 6, 6, 12, 12, 12, 53, 53, 53, 140, 140, 140}; char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if (H5LTmake_dataset_short(fid, name, rank, dims, NULL) >= 0) { @@ -387,7 +387,7 @@ create_int_dataset(hid_t fid, const char *dsidx, int fulldims) int s22_wbuf[DIM2_SIZE] = {5, 10, 50, 300}; char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if (H5LTmake_dataset_int(fid, name, rank, dims, NULL) >= 0) { @@ -497,7 +497,7 @@ create_float_dataset(hid_t fid, const char *dsidx, int fulldims) float s22_wbuf[DIM2_SIZE] = {5, 10, 50, 300}; char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if (H5LTmake_dataset_float(fid, name, rank, dims, NULL) >= 0) { @@ -533,14 +533,14 @@ create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -560,14 +560,14 @@ create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -575,7 +575,7 @@ create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -595,14 +595,14 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -610,7 +610,7 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -618,7 +618,7 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -638,14 +638,14 @@ create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -665,14 +665,14 @@ create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -680,7 +680,7 @@ create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -700,14 +700,14 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -715,7 +715,7 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -723,7 +723,7 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -742,14 +742,14 @@ create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -769,14 +769,14 @@ create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -784,7 +784,7 @@ create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -804,14 +804,14 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -819,7 +819,7 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -827,7 +827,7 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -847,14 +847,14 @@ create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -874,14 +874,14 @@ create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -889,7 +889,7 @@ create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -909,14 +909,14 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -924,7 +924,7 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -932,7 +932,7 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -952,14 +952,14 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -967,7 +967,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -975,7 +975,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -983,7 +983,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s4_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s4_wbuf) < 0) @@ -1003,14 +1003,14 @@ create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -1030,14 +1030,14 @@ create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -1045,7 +1045,7 @@ create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -1065,14 +1065,14 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -1080,7 +1080,7 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -1088,7 +1088,7 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -1111,7 +1111,7 @@ test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx) ret_value = SUCCEED; } else if (H5DSis_attached(did, dsid, idx) == 0) { - HDprintf(" scale not attached "); + printf(" scale not attached "); } } } @@ -1175,13 +1175,13 @@ test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename 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 *)HDmalloc(((size_t)name_len + 1) * sizeof(char)); + name_out = (char *)malloc(((size_t)name_len + 1) * sizeof(char)); if (name_out != NULL) { if (H5DSget_scale_name(dsid, name_out, (size_t)name_len + 1) >= 0) { - if (HDstrncmp(scalename, name_out, (size_t)name_len) == 0) { + if (strncmp(scalename, name_out, (size_t)name_len) == 0) { ret_value = SUCCEED; } - HDfree(name_out); + free(name_out); name_out = NULL; } } @@ -1219,14 +1219,14 @@ test_detachscales(void) /* make datasets; they are three dimensional*/ for (i = 0; i < 2; i++) { - HDsnprintf(dname, sizeof(dname), "D%d", i); + snprintf(dname, sizeof(dname), "D%d", i); if (H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0) goto out; } /* create datasets and make them dim. scales */ for (i = 0; i < 4; i++) { - HDsnprintf(dname, sizeof(dname), "DS%d", i); + snprintf(dname, sizeof(dname), "DS%d", i); if (H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0) goto out; } @@ -1234,7 +1234,7 @@ test_detachscales(void) two scales attached */ if ((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) { for (i = 0; i < 4; i++) { - HDsnprintf(dname, sizeof(dname), "DS%d", i); + snprintf(dname, sizeof(dname), "DS%d", i); if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, (unsigned int)i % 3) < 0) @@ -1251,7 +1251,7 @@ test_detachscales(void) /* attach scales to the second dataset */ if ((did = H5Dopen2(fid, "D1", H5P_DEFAULT)) >= 0) { for (i = 0; i < 3; i++) { - HDsnprintf(dname, sizeof(dname), "DS%d", i); + snprintf(dname, sizeof(dname), "DS%d", i); if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, (unsigned int)i) < 0) @@ -1272,7 +1272,7 @@ test_detachscales(void) goto out; for (i = 0; i < 2; i++) { - HDsnprintf(dname, sizeof(dname), "D%d", i); + snprintf(dname, sizeof(dname), "D%d", i); if ((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if (H5DSdetach_scale(did, dsid, (unsigned int)0) < 0) @@ -1302,7 +1302,7 @@ test_detachscales(void) sure that attribute "DIMENSION_LIST" doesn't exist anymore */ if ((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) { for (i = 1; i < 4; i++) { - HDsnprintf(dname, sizeof(dname), "DS%d", i); + snprintf(dname, sizeof(dname), "DS%d", i); if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if (H5DSdetach_scale(did, dsid, (unsigned int)i % 3) < 0) @@ -1346,7 +1346,7 @@ test_char_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); HL_TESTING2("test_char_attachscales"); @@ -1358,15 +1358,15 @@ test_char_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1402,7 +1402,7 @@ test_short_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); HL_TESTING2("test_short_attachscales"); @@ -1414,39 +1414,39 @@ test_short_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1482,7 +1482,7 @@ test_int_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); HL_TESTING2("test_int_attachscales"); @@ -1494,23 +1494,23 @@ test_int_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1546,7 +1546,7 @@ test_long_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); HL_TESTING2("test_long_attachscales"); @@ -1558,19 +1558,19 @@ test_long_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1606,7 +1606,7 @@ test_duplicatelong_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); HL_TESTING2("test_duplicatelong_attachscales"); @@ -1618,19 +1618,19 @@ test_duplicatelong_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1666,7 +1666,7 @@ test_float_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); HL_TESTING2("test_float_attachscales"); @@ -1678,23 +1678,23 @@ test_float_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1731,7 +1731,7 @@ test_numberofscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); HL_TESTING2("test_numberofscales"); @@ -1757,7 +1757,7 @@ test_numberofscales(const char *fileext) else goto out; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b"); /* make a dataset */ if (create_int_dataset(fid, "b", 1) < 0) @@ -1765,7 +1765,7 @@ test_numberofscales(const char *fileext) /* make a DS dataset for the first dimension */ if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; @@ -1814,31 +1814,31 @@ test_char_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set char scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); + snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1878,79 +1878,79 @@ test_short_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set short scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1990,47 +1990,47 @@ test_int_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set int scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -2070,39 +2070,39 @@ test_long_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set long scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2142,39 +2142,39 @@ test_samelong_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set same long scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2214,47 +2214,47 @@ test_float_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set float scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -2371,7 +2371,7 @@ test_simple(void) char snames[3]; int i, j; - HDprintf("Testing API functions\n"); + printf("Testing API functions\n"); /*------------------------------------------------------------------------- * create a file for the test @@ -2983,10 +2983,10 @@ test_simple(void) if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) goto out; for (i = 0; i < 5; i++) { - HDsnprintf(dname, sizeof(dname), "dset_%d", i); + snprintf(dname, sizeof(dname), "dset_%d", i); if ((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - HDsnprintf(sname, sizeof(sname), "ds_%d", i); + snprintf(sname, sizeof(sname), "ds_%d", i); if ((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if (H5DSset_scale(dsid, "scale") < 0) @@ -3003,11 +3003,11 @@ test_simple(void) */ for (i = 0; i < 5; i++) { - HDsnprintf(dname, sizeof(dname), "dset_%d", i); + snprintf(dname, sizeof(dname), "dset_%d", i); if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0) goto out; for (j = 0; j < 5; j++) { - HDsnprintf(sname, sizeof(sname), "ds_%d", j); + snprintf(sname, sizeof(sname), "ds_%d", j); if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, DIM0) < 0) @@ -3025,11 +3025,11 @@ test_simple(void) */ for (i = 0; i < 5; i++) { - HDsnprintf(dname, sizeof(dname), "dset_%d", i); + snprintf(dname, sizeof(dname), "dset_%d", i); if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0) goto out; for (j = 0; j < 5; j++) { - HDsnprintf(sname, sizeof(sname), "ds_%d", j); + snprintf(sname, sizeof(sname), "ds_%d", j); if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0) goto out; if (H5DSdetach_scale(did, dsid, DIM0) < 0) @@ -3047,11 +3047,11 @@ test_simple(void) */ for (i = 0; i < 5; i++) { - HDsnprintf(dname, sizeof(dname), "dset_%d", i); + snprintf(dname, sizeof(dname), "dset_%d", i); if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0) goto out; for (j = 0; j < 5; j++) { - HDsnprintf(sname, sizeof(sname), "ds_%d", j); + snprintf(sname, sizeof(sname), "ds_%d", j); if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, DIM0) < 0) @@ -3145,9 +3145,9 @@ test_simple(void) goto out; if (H5DSget_label(did, DIM1, dim1_label, sizeof(dim1_label)) < 0) goto out; - if (HDstrncmp(DIM0_LABEL, dim0_label, sizeof(dim0_label)) != 0) + if (strncmp(DIM0_LABEL, dim0_label, sizeof(dim0_label)) != 0) goto out; - if (HDstrncmp(DIM1_LABEL, dim1_label, sizeof(dim1_label)) != 0) + if (strncmp(DIM1_LABEL, dim1_label, sizeof(dim1_label)) != 0) goto out; /*------------------------------------------------------------------------- @@ -3161,24 +3161,24 @@ test_simple(void) goto out; /* allocate */ - dim0_labeld = (char *)HDmalloc((size_t)dim0_label_size * sizeof(char)); - dim1_labeld = (char *)HDmalloc((size_t)dim1_label_size * sizeof(char)); + dim0_labeld = (char *)malloc((size_t)dim0_label_size * sizeof(char)); + dim1_labeld = (char *)malloc((size_t)dim1_label_size * sizeof(char)); if (dim0_labeld == NULL || dim1_labeld == NULL) goto out; if (H5DSget_label(did, DIM0, dim0_labeld, (size_t)dim0_label_size) < 0) goto out; if (H5DSget_label(did, DIM1, dim1_labeld, (size_t)dim1_label_size) < 0) goto out; - if (HDstrncmp(DIM0_LABEL, dim0_labeld, (size_t)(dim0_label_size - 1)) != 0) + if (strncmp(DIM0_LABEL, dim0_labeld, (size_t)(dim0_label_size - 1)) != 0) goto out; - if (HDstrncmp(DIM1_LABEL, dim1_labeld, (size_t)(dim1_label_size - 1)) != 0) + if (strncmp(DIM1_LABEL, dim1_labeld, (size_t)(dim1_label_size - 1)) != 0) goto out; if (dim0_labeld) { - HDfree(dim0_labeld); + free(dim0_labeld); dim0_labeld = NULL; } if (dim1_labeld) { - HDfree(dim1_labeld); + free(dim1_labeld); dim1_labeld = NULL; } @@ -3191,9 +3191,9 @@ test_simple(void) goto out; if (H5DSget_label(did, DIM1, dim1_labels, sizeof(dim1_labels)) < 0) goto out; - if (HDstrncmp(DIM0_LABEL, dim0_labels, sizeof(dim0_labels) - 1) != 0) + if (strncmp(DIM0_LABEL, dim0_labels, sizeof(dim0_labels) - 1) != 0) goto out; - if (HDstrncmp(DIM1_LABEL, dim1_labels, sizeof(dim1_labels) - 1) != 0) + if (strncmp(DIM1_LABEL, dim1_labels, sizeof(dim1_labels) - 1) != 0) goto out; if (H5Dclose(did)) goto out; @@ -3225,7 +3225,7 @@ test_simple(void) goto out; /* allocate a buffer */ - name_out = (char *)HDmalloc(((size_t)name_len + 1) * sizeof(char)); + name_out = (char *)malloc(((size_t)name_len + 1) * sizeof(char)); if (name_out == NULL) goto out; @@ -3233,10 +3233,10 @@ test_simple(void) if (H5DSget_scale_name(dsid, name_out, (size_t)name_len + 1) < 0) goto out; - if (HDstrncmp("Latitude set 0", name_out, (size_t)name_len) != 0) + if (strncmp("Latitude set 0", name_out, (size_t)name_len) != 0) goto out; if (name_out) { - HDfree(name_out); + free(name_out); name_out = NULL; } @@ -3249,7 +3249,7 @@ test_simple(void) if (H5DSget_scale_name(dsid, sname, sizeof(sname)) < 0) goto out; - if (HDstrncmp("Latitude set 0", sname, sizeof(sname)) != 0) + if (strncmp("Latitude set 0", sname, sizeof(sname)) != 0) goto out; /*------------------------------------------------------------------------- @@ -3261,7 +3261,7 @@ test_simple(void) if (H5DSget_scale_name(dsid, snames, sizeof(snames)) < 0) goto out; - if (HDstrncmp("Latitude set 0", snames, sizeof(snames) - 1) != 0) + if (strncmp("Latitude set 0", snames, sizeof(snames) - 1) != 0) goto out; if (H5Dclose(dsid)) goto out; @@ -3497,7 +3497,7 @@ test_simple(void) goto out; break; default: - HDassert(0); + assert(0); break; } /*switch*/ } /*for*/ @@ -3627,7 +3627,7 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) goto out; if (nelmts) { - buf = (char *)HDmalloc(((size_t)nelmts * size)); + buf = (char *)malloc(((size_t)nelmts * size)); if (buf == NULL) goto out; if (H5Dread(scale_id, mtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) @@ -3635,7 +3635,7 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) for (i = 0; i < nelmts; i++) { if (buf[i] != data[i]) { - HDprintf("read and write buffers differ\n"); + printf("read and write buffers differ\n"); goto out; } } @@ -3649,7 +3649,7 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) if (H5Tclose(mtid) < 0) goto out; if (buf) - HDfree(buf); + free(buf); return ret; @@ -3661,7 +3661,7 @@ out: H5Tclose(tid); H5Tclose(mtid); if (buf) { - HDfree(buf); + free(buf); } } H5E_END_TRY @@ -3839,7 +3839,7 @@ test_errors(void) hid_t sidds = -1; /* space ID */ hsize_t pal_dims[] = {9, 3}; - HDprintf("Testing error conditions\n"); + printf("Testing error conditions\n"); /*------------------------------------------------------------------------- * create a file, spaces, dataset and group ids @@ -4213,7 +4213,7 @@ test_iterators(void) char dname[30]; /* dataset name */ int i; - HDprintf("Testing iterators\n"); + printf("Testing iterators\n"); /*------------------------------------------------------------------------- * create a file, spaces, dataset and group ids @@ -4291,7 +4291,7 @@ test_iterators(void) for (i = 0; i < 100; i++) { /* make a DS */ - HDsnprintf(dname, sizeof(dname), "ds_%d", i); + snprintf(dname, sizeof(dname), "ds_%d", i); if (H5LTmake_dataset_int(fid, dname, rankds, s1_dim, NULL) < 0) goto out; /* open */ @@ -4403,7 +4403,7 @@ test_rank(void) float buff[1] = {1}; int i; - HDprintf("Testing ranks\n"); + printf("Testing ranks\n"); /*------------------------------------------------------------------------- * create a file, a dataset, scales @@ -4441,7 +4441,7 @@ test_rank(void) goto out; for (i = 0; i < 3; i++) { - HDsnprintf(name, sizeof(name), "ds_a_%d", i); + snprintf(name, sizeof(name), "ds_a_%d", i); if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, (unsigned)i) < 0) @@ -4468,7 +4468,7 @@ test_rank(void) goto out; for (i = 0; i < 3; i++) { - HDsnprintf(name, sizeof(name), "ds_a_%d", i); + snprintf(name, sizeof(name), "ds_a_%d", i); if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) goto out; if (H5DSdetach_scale(did, dsid, (unsigned)i) < 0) @@ -4494,7 +4494,7 @@ test_rank(void) goto out; for (i = 0; i < 3; i++) { - HDsnprintf(name, sizeof(name), "ds_a_%d", i); + snprintf(name, sizeof(name), "ds_a_%d", i); if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) goto out; if (H5DSset_scale(dsid, name) < 0) @@ -4511,9 +4511,9 @@ test_rank(void) goto out; if (H5DSget_label(did, (unsigned)i, namel, sizeof(namel)) < 0) goto out; - if (HDstrncmp(name, names, sizeof(names)) != 0) + if (strncmp(name, names, sizeof(names)) != 0) goto out; - if (HDstrncmp(name, namel, sizeof(namel)) != 0) + if (strncmp(name, namel, sizeof(namel)) != 0) goto out; } @@ -4610,7 +4610,7 @@ test_types(void) const char *s1_str = "ABC"; const char *s2_str = "ABCD"; - HDprintf("Testing scales with several datatypes\n"); + printf("Testing scales with several datatypes\n"); /*------------------------------------------------------------------------- * create a file for the test @@ -4788,7 +4788,7 @@ test_data(void) hsize_t londims[1]; /* array to hold dimensions */ float fill = -99; /* fill value */ - HDprintf("Testing reading ASCII data and generate HDF5 data with scales\n"); + printf("Testing reading ASCII data and generate HDF5 data with scales\n"); /*------------------------------------------------------------------------- * create a file for the test @@ -4818,7 +4818,7 @@ test_data(void) if (H5LTmake_dataset_float(fid, "lat", 1, latdims, latbuf) < 0) goto out; - HDfree(latbuf); + free(latbuf); latbuf = NULL; /* read the longitude */ @@ -4829,7 +4829,7 @@ test_data(void) if (H5LTmake_dataset_float(fid, "lon", 1, londims, lonbuf) < 0) goto out; - HDfree(lonbuf); + free(lonbuf); lonbuf = NULL; /* make a dataset for the data. a fill value is set */ @@ -4849,7 +4849,7 @@ test_data(void) if (H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, vals) < 0) goto out; - HDfree(vals); + free(vals); vals = NULL; if (H5Dclose(did) < 0) @@ -4924,11 +4924,11 @@ out: H5_FAILED(); if (latbuf) - HDfree(latbuf); + free(latbuf); if (lonbuf) - HDfree(lonbuf); + free(lonbuf); if (vals) - HDfree(vals); + free(vals); return FAIL; } @@ -4957,44 +4957,44 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf) const char *data_file = H5_get_srcdir_filename(fname); /* read first data file */ - f = HDfopen(data_file, "r"); + f = fopen(data_file, "r"); if (f == NULL) { - HDprintf("Could not open file %s\n", data_file); + printf("Could not open file %s\n", data_file); return -1; } for (i = 0, nelms = 1; i < ndims; i++) { - if (HDfscanf(f, "%s %u", str, &j) && HDferror(f)) { - HDprintf("fscanf error in file %s\n", data_file); - HDfclose(f); + if (fscanf(f, "%s %u", str, &j) && ferror(f)) { + printf("fscanf error in file %s\n", data_file); + fclose(f); return -1; } /* end if */ - if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s\n", data_file); - HDfclose(f); + if (fscanf(f, "%d", &n) < 0 && ferror(f)) { + printf("fscanf error in file %s\n", data_file); + fclose(f); return -1; } /* end if */ dims[i] = (hsize_t)n; nelms *= (size_t)n; } - *buf = (float *)HDmalloc(nelms * sizeof(float)); + *buf = (float *)malloc(nelms * sizeof(float)); if (*buf == NULL) { - HDprintf("memory allocation failed\n"); - HDfclose(f); + printf("memory allocation failed\n"); + fclose(f); return -1; } for (j = 0; j < nelms; j++) { - if (HDfscanf(f, "%f", &val) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s\n", data_file); - HDfclose(f); + if (fscanf(f, "%f", &val) < 0 && ferror(f)) { + printf("fscanf error in file %s\n", data_file); + fclose(f); return -1; } /* end if */ (*buf)[j] = val; } - HDfclose(f); + fclose(f); return 1; } @@ -5018,7 +5018,7 @@ test_errors2(void) int nscales; /* number of scales in DIM */ int count; /* visitor data */ - HDprintf("Testing parameter errors\n"); + printf("Testing parameter errors\n"); /*------------------------------------------------------------------------- * create a file, a dataset, scales @@ -5100,7 +5100,7 @@ test_errors2(void) goto out; if ((label_len = H5DSget_label(did, 0, NULL, 0)) < 0) goto out; - if (label_len != HDstrlen("label")) + if (label_len != strlen("label")) goto out; if (H5DSget_label(did, 0, lbuf, sizeof(lbuf)) < 0) goto out; diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index b287d25..9b67348 100644 --- a/hl/test/test_dset_append.c +++ b/hl/test/test_dset_append.c @@ -251,7 +251,7 @@ test_dataset_append_rows_columns(hid_t fid) TEST_ERROR; /* Clear the buffer */ - HDmemset(rbuf, 0, sizeof(rbuf)); + memset(rbuf, 0, sizeof(rbuf)); /* Close the dataset */ if (H5Dclose(did) < 0) @@ -387,7 +387,7 @@ test_dataset_append_rows(hid_t fid) TEST_ERROR; /* Clear the buffer */ - HDmemset(rbuf, 0, sizeof(rbuf)); + memset(rbuf, 0, sizeof(rbuf)); /* Close the dataset */ if (H5Dclose(did) < 0) @@ -524,7 +524,7 @@ test_dataset_append_columns(hid_t fid) TEST_ERROR; /* Clear the buffer */ - HDmemset(rbuf, 0, sizeof(rbuf)); + memset(rbuf, 0, sizeof(rbuf)); /* Close the dataset */ if (H5Dclose(did) < 0) @@ -687,7 +687,7 @@ test_dataset_append_BUG1(hid_t fid) if (buf[i][j] != rbuf[i][j]) TEST_ERROR; - HDmemset(rbuf, 0, sizeof(rbuf)); + memset(rbuf, 0, sizeof(rbuf)); /* Close the dataset */ if (H5Dclose(did) < 0) @@ -850,7 +850,7 @@ test_dataset_append_BUG2(hid_t fid) if (buf[i][j] != rbuf[i][j]) TEST_ERROR; - HDmemset(rbuf, 0, sizeof(rbuf)); + memset(rbuf, 0, sizeof(rbuf)); /* Close the dataset */ if (H5Dclose(did) < 0) @@ -1009,7 +1009,7 @@ test_dataset_append_less(hid_t fid) TEST_ERROR; /* Clear the buffer */ - HDmemset(rbuf, 0, sizeof(rbuf)); + memset(rbuf, 0, sizeof(rbuf)); /* Close the dataset */ if (H5Dclose(did) < 0) @@ -1166,7 +1166,7 @@ test_dataset_append_vary(hid_t fid) TEST_ERROR; /* Clear the dataset */ - HDmemset(rbuf, 0, sizeof(rbuf)); + memset(rbuf, 0, sizeof(rbuf)); /* Close the dataset */ if (H5Dclose(did) < 0) diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c index 0a10e36..9cb7f45 100644 --- a/hl/test/test_file_image.c +++ b/hl/test/test_file_image.c @@ -76,27 +76,27 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) VERIFY(nflags > 0, "The number of flag combinations must be greater than 0"); /* allocate array of flags for open images */ - if (NULL == (input_flags = (unsigned *)HDmalloc(sizeof(unsigned) * open_images))) + if (NULL == (input_flags = (unsigned *)malloc(sizeof(unsigned) * open_images))) FAIL_PUTS_ERROR("malloc() failed"); /* allocate array of pointers for each of the open images */ - if (NULL == (buf_ptr = (void **)HDmalloc(sizeof(void *) * open_images))) + if (NULL == (buf_ptr = (void **)malloc(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 **)HDcalloc(1, sizeof(char *) * open_images))) + if (NULL == (filename = (char **)calloc(1, 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 *)HDmalloc(sizeof(ssize_t) * open_images))) + if (NULL == (buf_size = (ssize_t *)malloc(sizeof(ssize_t) * open_images))) FAIL_PUTS_ERROR("malloc() failed"); /* allocate array for each of the file identifiers */ - if (NULL == (file_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images))) + if (NULL == (file_id = (hid_t *)malloc(sizeof(hid_t) * open_images))) FAIL_PUTS_ERROR("malloc() failed"); /* allocate array for each of the dataset identifiers */ - if (NULL == (dset_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images))) + if (NULL == (dset_id = (hid_t *)malloc(sizeof(hid_t) * open_images))) FAIL_PUTS_ERROR("malloc() failed"); HL_TESTING2("get file images"); @@ -109,12 +109,12 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) /* allocate name buffer for image i */ size_t filenamelength = sizeof(char) * 32; - filename[i] = (char *)HDmalloc(filenamelength); + filename[i] = (char *)malloc(filenamelength); if (!filename[i]) - FAIL_PUTS_ERROR("HDmalloc() failed"); + FAIL_PUTS_ERROR("malloc() failed"); /* create file name */ - HDsnprintf(filename[i], filenamelength, "image_file%d.h5", (int)i); + snprintf(filename[i], filenamelength, "image_file%d.h5", (int)i); /* create file */ if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -169,7 +169,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) FAIL_PUTS_ERROR("H5Fget_file_image() failed"); /* allocate buffer for the file image i */ - if (NULL == (buf_ptr[i] = (void *)HDmalloc((size_t)buf_size[i]))) + if (NULL == (buf_ptr[i] = (void *)malloc((size_t)buf_size[i]))) FAIL_PUTS_ERROR("malloc() failed"); /* buffer for file image 2 is filled with counter data (non-valid image) */ @@ -233,28 +233,28 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) */ if (input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW && !(input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY)) { - void *tmp_ptr = HDmalloc((size_t)buf_size[i]); + void *tmp_ptr = malloc((size_t)buf_size[i]); if (!tmp_ptr) FAIL_PUTS_ERROR("buffer allocation failed"); /* Copy vfd buffer to a temporary buffer */ - HDmemcpy(tmp_ptr, (void *)*core_buf_ptr_ptr, (size_t)buf_size[i]); + memcpy(tmp_ptr, (void *)*core_buf_ptr_ptr, (size_t)buf_size[i]); /* Clear status_flags in the superblock for the vfd buffer: file locking is using status_flags */ - HDmemset((uint8_t *)tmp_ptr + SUPER_STATUS_FLAGS_OFF_V0_V1, (int)0, - (size_t)SUPER_STATUS_FLAGS_SIZE_V0_V1); + memset((uint8_t *)tmp_ptr + SUPER_STATUS_FLAGS_OFF_V0_V1, (int)0, + (size_t)SUPER_STATUS_FLAGS_SIZE_V0_V1); /* Does the comparison */ - if (HDmemcmp(tmp_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0) + if (memcmp(tmp_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0) FAIL_PUTS_ERROR("comparison of TMP vfd and user buffer failed"); /* Free the temporary buffer */ if (tmp_ptr) - HDfree(tmp_ptr); + free(tmp_ptr); } else { /* test whether the contents of the user buffer and driver buffer */ /* are equal. */ - if (HDmemcmp(*core_buf_ptr_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0) + if (memcmp(*core_buf_ptr_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0) FAIL_PUTS_ERROR("comparison of vfd and user buffer failed"); } } /* end else */ @@ -268,7 +268,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) for (i = 0; i < open_images; i++) { /* if opening the file image failed, continue next iteration */ if (file_id[i] < 0) { - HDassert(i == 2); + assert(i == 2); continue; } /* end if */ @@ -324,7 +324,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) for (i = 0; i < open_images; i++) { /* if opening the file image failed, continue next iteration */ if (file_id[i] < 0) { - HDassert(i == 2); + assert(i == 2); continue; } /* end if */ @@ -508,20 +508,20 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) if (!(input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY) || (input_flags[i] & H5LT_FILE_IMAGE_DONT_RELEASE)) { VERIFY(buf_ptr[i] != NULL, "buffer pointer must be non NULL"); - HDfree(buf_ptr[i]); + free(buf_ptr[i]); } /* end if */ } /* end for */ /* release temporary working buffers */ for (i = 0; i < open_images; i++) - HDfree(filename[i]); - HDfree(filename); - HDfree(file_id); - HDfree(dset_id); - HDfree(buf_ptr); - HDfree(buf_size); - HDfree(input_flags); + free(filename[i]); + free(filename); + free(file_id); + free(dset_id); + free(buf_ptr); + free(buf_size); + free(input_flags); PASSED(); @@ -532,14 +532,14 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) error: if (filename) { for (i = 0; i < open_images; i++) - HDfree(filename[i]); - HDfree(filename); + free(filename[i]); + free(filename); } - HDfree(file_id); - HDfree(dset_id); - HDfree(buf_ptr); - HDfree(buf_size); - HDfree(input_flags); + free(file_id); + free(dset_id); + free(buf_ptr); + free(buf_size); + free(input_flags); H5_FAILED(); return -1; @@ -572,10 +572,10 @@ main(void) if (nerrors) goto error; - HDprintf("File image tests passed.\n"); + printf("File image tests passed.\n"); return 0; error: - HDprintf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); + printf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } diff --git a/hl/test/test_h5do_compat.c b/hl/test/test_h5do_compat.c index 2610c33..3d26f7e 100644 --- a/hl/test/test_h5do_compat.c +++ b/hl/test/test_h5do_compat.c @@ -192,7 +192,7 @@ test_direct_chunk_read(hid_t did) TEST_ERROR; /* Read the raw chunk back */ - HDmemset(chunk_data, 0, CHUNK_NX * sizeof(int)); + memset(chunk_data, 0, CHUNK_NX * sizeof(int)); filter_mask = UINT_MAX; offset[0] = (hsize_t)i * CHUNK_NX; if (H5DOread_chunk(did, H5P_DEFAULT, offset, &filter_mask, chunk_data) < 0) @@ -247,8 +247,8 @@ main(void) { #ifdef H5_NO_DEPRECATED_SYMBOLS - HDputs("Direct chunk read/write wrapper tests SKIPPED."); - HDputs("(Backward compatibility not configured)"); + puts("Direct chunk read/write wrapper tests SKIPPED."); + puts("(Backward compatibility not configured)"); return EXIT_SUCCESS; #else @@ -275,11 +275,11 @@ main(void) if (nerrors) goto error; - HDputs("All direct chunk read/write wrapper tests passed."); + puts("All direct chunk read/write wrapper tests passed."); return EXIT_SUCCESS; error: - HDputs("*** TESTS FAILED ***"); + puts("*** TESTS FAILED ***"); return EXIT_FAILURE; #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end main() */ diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 8a67883..b9f290e 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -71,11 +71,11 @@ main(void) if (nerrors) goto error; - HDprintf("All image tests passed.\n"); + printf("All image tests passed.\n"); return 0; error: - HDprintf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); + printf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } @@ -111,14 +111,14 @@ test_simple(void) hsize_t pal_dims_out[2]; /* palette dimensions */ /* Allocate image buffers */ - buf1 = (unsigned char *)HDmalloc(WIDTH * HEIGHT); - HDassert(buf1); - buf2 = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3); - HDassert(buf2); - buf1_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT); - HDassert(buf1_out); - buf2_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3); - HDassert(buf2_out); + buf1 = (unsigned char *)malloc(WIDTH * HEIGHT); + assert(buf1); + buf2 = (unsigned char *)malloc(WIDTH * HEIGHT * 3); + assert(buf2); + buf1_out = (unsigned char *)malloc(WIDTH * HEIGHT); + assert(buf1_out); + buf2_out = (unsigned char *)malloc(WIDTH * HEIGHT * 3); + assert(buf2_out); /* create an image */ space = WIDTH * HEIGHT / PAL_ENTRIES; @@ -274,13 +274,13 @@ test_simple(void) */ if (buf1) - HDfree(buf1); + free(buf1); if (buf2) - HDfree(buf2); + free(buf2); if (buf1_out) - HDfree(buf1_out); + free(buf1_out); if (buf2_out) - HDfree(buf2_out); + free(buf2_out); /* Close the file. */ if (H5Fclose(fid) < 0) @@ -293,13 +293,13 @@ test_simple(void) /* error zone, gracefully close */ out: if (buf1) - HDfree(buf1); + free(buf1); if (buf2) - HDfree(buf2); + free(buf2); if (buf1_out) - HDfree(buf1_out); + free(buf1_out); if (buf2_out) - HDfree(buf2_out); + free(buf2_out); H5E_BEGIN_TRY { H5Fclose(fid); @@ -329,7 +329,7 @@ test_data(void) if ((fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - HDprintf("Testing read ascii image data and generate images\n"); + printf("Testing read ascii image data and generate images\n"); /*------------------------------------------------------------------------- * read 8bit image data @@ -480,7 +480,7 @@ test_data(void) goto out; /* Release memory buffer */ - HDfree(image_data); + free(image_data); return 0; @@ -488,7 +488,7 @@ test_data(void) out: /* Release memory buffer */ if (image_data) - HDfree(image_data); + free(image_data); H5E_BEGIN_TRY { @@ -531,16 +531,16 @@ test_generate(void) if ((fid = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - HDprintf("Testing read and process data and make indexed images\n"); + printf("Testing read and process data and make indexed images\n"); /*------------------------------------------------------------------------- * read data; the file data format is described below *------------------------------------------------------------------------- */ - f = HDfopen(data_file, "r"); + f = fopen(data_file, "r"); if (f == NULL) { - HDprintf("Could not find file %s. Try set $srcdir \n", data_file); + printf("Could not find file %s. Try set $srcdir \n", data_file); goto out; } @@ -579,12 +579,12 @@ test_generate(void) ! */ - if (HDfscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -606,21 +606,21 @@ test_generate(void) if (n_elements > INT_MAX / (int)sizeof(float)) goto out; - data = (float *)HDmalloc((size_t)n_elements * sizeof(float)); + data = (float *)malloc((size_t)n_elements * sizeof(float)); if (NULL == data) goto out; - image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char)); + image_data = (unsigned char *)malloc((size_t)n_elements * sizeof(unsigned char)); if (NULL == image_data) goto out; for (i = 0; i < n_elements; i++) { - if (HDfscanf(f, "%f ", &value) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%f ", &value) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ data[i] = value; } - HDfclose(f); + fclose(f); f = NULL; /*------------------------------------------------------------------------- @@ -712,8 +712,8 @@ test_generate(void) goto out; /* Release memory buffers */ - HDfree(data); - HDfree(image_data); + free(data); + free(image_data); /* Indicate success */ return 0; @@ -722,9 +722,9 @@ test_generate(void) out: /* Release memory buffers */ if (data) - HDfree(data); + free(data); if (image_data) - HDfree(image_data); + free(image_data); H5E_BEGIN_TRY { @@ -732,7 +732,7 @@ out: } H5E_END_TRY if (f) - HDfclose(f); + fclose(f); H5_FAILED(); return retval; } @@ -773,38 +773,38 @@ read_data(const char *fname, /*IN*/ *------------------------------------------------------------------------- */ - if (NULL == (f = HDfopen(data_file, "r"))) { - HDprintf("Could not open file %s. Try set $srcdir \n", data_file); + if (NULL == (f = fopen(data_file, "r"))) { + printf("Could not open file %s. Try set $srcdir \n", data_file); goto out; } - if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%s", str) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%d", &color_planes) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%d", &color_planes) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%s", str) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%d", &h) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%d", &h) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%s", str) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%d", &w) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%d", &w) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -825,10 +825,10 @@ read_data(const char *fname, /*IN*/ /* Release the buffer, if it was previously allocated */ if (image_data) - HDfree(image_data); + free(image_data); /* Allocate the image data buffer */ - image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char)); + image_data = (unsigned char *)malloc((size_t)n_elements * sizeof(unsigned char)); if (NULL == image_data) goto out; @@ -837,8 +837,8 @@ read_data(const char *fname, /*IN*/ /* Read data elements */ for (i = 0; i < n_elements; i++) { - if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + if (fscanf(f, "%d", &n) < 0 && ferror(f)) { + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ image_data[i] = (unsigned char)n; @@ -849,7 +849,7 @@ read_data(const char *fname, /*IN*/ out: if (f) - HDfclose(f); + fclose(f); return ret_val; } /* end read_data() */ @@ -889,40 +889,40 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size) return -1; /* open the input file */ - if (!(file = HDfopen(data_file, "r"))) { - HDprintf("Could not open file %s. Try set $srcdir \n", data_file); + if (!(file = fopen(data_file, "r"))) { + printf("Could not open file %s. Try set $srcdir \n", data_file); return -1; } /* read the file ident string */ - if (HDfgets(buffer, sizeof(buffer), file) == NULL) { - HDfclose(file); + if (fgets(buffer, sizeof(buffer), file) == NULL) { + fclose(file); return -1; } /* ensure it matches the palette file ident string */ - if (HDstrncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && - HDstrncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0) { - HDfclose(file); + if (strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && + strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0) { + fclose(file); return -1; } /* read the version string */ - if (HDfgets(buffer, sizeof(buffer), file) == NULL) { - HDfclose(file); + if (fgets(buffer, sizeof(buffer), file) == NULL) { + fclose(file); return -1; } /* ensure it matches the palette file version string */ - if (HDstrncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && - HDstrncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0) { - HDfclose(file); + if (strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && + strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0) { + fclose(file); return -1; } /* read the number of colors */ - if (HDfgets(buffer, sizeof(buffer), file) == NULL) { - HDfclose(file); + if (fgets(buffer, sizeof(buffer), file) == NULL) { + fclose(file); return -1; } @@ -930,27 +930,27 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size) check for missing version or number of colors in this case it reads the first entry */ - if (HDstrlen(buffer) > 4) { - HDfclose(file); + if (strlen(buffer) > 4) { + fclose(file); return -1; } - if (HDsscanf(buffer, "%u", &nentries) != 1) { - HDfclose(file); + if (sscanf(buffer, "%u", &nentries) != 1) { + fclose(file); return -1; } /* ensure there are a sensible number of colors in the palette */ if ((nentries > 256) || (nentries > palette_size)) { - HDfclose(file); + fclose(file); return (-1); } /* read the palette entries */ for (u = 0; u < nentries; u++) { /* extract the red, green and blue color components. */ - if (HDfscanf(file, "%u %u %u", &red, &green, &blue) != 3) { - HDfclose(file); + if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) { + fclose(file); return -1; } /* store this palette entry */ @@ -960,7 +960,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size) } /* close file */ - HDfclose(file); + fclose(file); return (int)nentries; } diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index 78af519..b0579d5 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -1037,10 +1037,10 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields) /* Loop through different variations of extending the dataset */ for (i = 0; i < ONE_NTESTS; i++) { - HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1)); - HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2)); - HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int)); + memset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1)); + memset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2)); + memset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); + memset(iibuf, 0, TEST_BUF_SIZE * sizeof(int)); ext_dims[0] = (hsize_t)((int)prev_dims[0] + one_tests[i]); @@ -1049,27 +1049,27 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields) FAIL_STACK_ERROR; /* Initialize data */ - if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { + if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) { if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0) FAIL_STACK_ERROR; } /* end if */ - else if (!HDstrcmp(dname, DSET_ONE)) { + else if (!strcmp(dname, DSET_ONE)) { if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) FAIL_STACK_ERROR; } /* end if */ /* There are changes in dimension sizes */ if (one_tests[i] > 0) { - if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { + if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) { if (fields) { - if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) { + if (!strcmp(fields, VALID_FIELDS1) || !strcmp(fields, VALID_ESC_FIELDS1)) { /* Retrieve the elmemts in BUF */ if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0) TEST_ERROR; for (j = 0; j < one_tests[i]; j++) VERIFY_ELMTS_VALID1(vbuf1[j], cbuf[prev_dims[0] + (hsize_t)j]) } /* end if */ - else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) { + else if (!strcmp(fields, VALID_FIELDS2) || !strcmp(fields, VALID_ESC_FIELDS2)) { /* Retrieve the elmemts in BUF */ if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0) TEST_ERROR; @@ -1248,10 +1248,10 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields) /* Loop through different variations of extending the dataset */ for (i = 0; i < TWO_NTESTS; i++) { - HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1)); - HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2)); - HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int)); + memset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1)); + memset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2)); + memset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); + memset(iibuf, 0, TEST_BUF_SIZE * sizeof(int)); ext_dims[0] = (hsize_t)((int)prev_dims[0] + two_tests[i][0]); ext_dims[1] = (hsize_t)((int)prev_dims[1] + two_tests[i][1]); @@ -1261,11 +1261,11 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields) FAIL_STACK_ERROR; /* Initialize data */ - if (!HDstrcmp(dname, DSET_CMPD_TWO)) { + if (!strcmp(dname, DSET_CMPD_TWO)) { if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0) FAIL_STACK_ERROR; } /* end if */ - else if (!HDstrcmp(dname, DSET_TWO)) { + else if (!strcmp(dname, DSET_TWO)) { if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) FAIL_STACK_ERROR; } /* end else-if */ @@ -1274,16 +1274,16 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields) /* There are changes in dimension sizes */ if (two_tests[i][0] > 0 || two_tests[i][1] > 0) { - if (!HDstrcmp(dname, DSET_CMPD_TWO)) { + if (!strcmp(dname, DSET_CMPD_TWO)) { if (fields) { - if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) { + if (!strcmp(fields, VALID_FIELDS1) || !strcmp(fields, VALID_ESC_FIELDS1)) { /* Retrieve the elmemts in BUF */ if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0) TEST_ERROR; if (verify_elmts_two(TWO_CMPD_VALID1, ext_dims, prev_dims, vbuf1, cbuf) < 0) TEST_ERROR; } /* end if */ - else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) { + else if (!strcmp(fields, VALID_FIELDS2) || !strcmp(fields, VALID_ESC_FIELDS2)) { /* Retrieve the elmemts in BUF */ if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0) TEST_ERROR; @@ -1351,19 +1351,19 @@ main(void) int nerrors = 0; /* Set up temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */ - if (NULL == (ibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE))) + if (NULL == (ibuf = (int *)malloc(sizeof(int) * TEST_BUF_SIZE))) FAIL_STACK_ERROR; - if (NULL == (iibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE))) + if (NULL == (iibuf = (int *)malloc(sizeof(int) * TEST_BUF_SIZE))) FAIL_STACK_ERROR; - if (NULL == (cbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE))) + if (NULL == (cbuf = (set_t *)malloc(sizeof(set_t) * TEST_BUF_SIZE))) FAIL_STACK_ERROR; - if (NULL == (ccbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE))) + if (NULL == (ccbuf = (set_t *)malloc(sizeof(set_t) * TEST_BUF_SIZE))) FAIL_STACK_ERROR; - if (NULL == (vbuf1 = (test_valid_fields1 *)HDmalloc(sizeof(test_valid_fields1) * TEST_BUF_SIZE))) + if (NULL == (vbuf1 = (test_valid_fields1 *)malloc(sizeof(test_valid_fields1) * TEST_BUF_SIZE))) FAIL_STACK_ERROR; - if (NULL == (vbuf2 = (test_valid_fields2 *)HDmalloc(sizeof(test_valid_fields2) * TEST_BUF_SIZE))) + if (NULL == (vbuf2 = (test_valid_fields2 *)malloc(sizeof(test_valid_fields2) * TEST_BUF_SIZE))) FAIL_STACK_ERROR; /* @@ -1415,17 +1415,17 @@ main(void) /* Free temporary buffers */ if (ibuf) - HDfree(ibuf); + free(ibuf); if (iibuf) - HDfree(iibuf); + free(iibuf); if (cbuf) - HDfree(cbuf); + free(cbuf); if (ccbuf) - HDfree(ccbuf); + free(ccbuf); if (vbuf1) - HDfree(vbuf1); + free(vbuf1); if (vbuf2) - HDfree(vbuf2); + free(vbuf2); /* check for errors */ if (nerrors) diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index cf139d9..9bbad45 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -345,7 +345,7 @@ test_dsets(void) if (H5LTread_dataset_string(file_id, DSET7_NAME, data_string_out) < 0) goto out; - if (HDstrcmp(data_string_in, data_string_out) != 0) + if (strcmp(data_string_in, data_string_out) != 0) goto out; /*------------------------------------------------------------------------- @@ -521,7 +521,7 @@ make_attributes(hid_t loc_id, const char *obj_name) if (H5LTget_attribute_string(loc_id, obj_name, ATTR1_NAME, attr_str_out) < 0) return -1; - if (HDstrcmp(attr_str_in, attr_str_out) != 0) { + if (strcmp(attr_str_in, attr_str_out) != 0) { return -1; } @@ -1038,26 +1038,26 @@ make_attributes(hid_t loc_id, const char *obj_name) HL_TESTING2("H5LTget_attribute_info"); - if (NULL == (dims_out = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)rank_out))) + if (NULL == (dims_out = (hsize_t *)malloc(sizeof(hsize_t) * (size_t)rank_out))) return -1; if (H5LTget_attribute_info(loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, &type_size) < 0) { - HDfree(dims_out); + free(dims_out); return -1; } for (i = 0; i < rank_out; i++) { if (dims_out[i] != 5) { - HDfree(dims_out); + free(dims_out); return -1; } } if (type_class != H5T_INTEGER) { - HDfree(dims_out); + free(dims_out); return -1; } - HDfree(dims_out); + free(dims_out); PASSED(); @@ -1092,17 +1092,17 @@ test_integers(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_STD_I8BE") != 0) { - HDfree(dt_str); + if (strcmp(dt_str, "H5T_STD_I8BE") != 0) { + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1150,17 +1150,17 @@ test_fps(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_IEEE_F32BE") != 0) { - HDfree(dt_str); + if (strcmp(dt_str, "H5T_IEEE_F32BE") != 0) { + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1221,19 +1221,19 @@ test_strings(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET " - "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + if (strcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET " + "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1256,62 +1256,62 @@ test_strings(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n " - "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + if (strcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n " + "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); /* Length of the character buffer is larger then needed */ str_len = str_len + 10; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrncmp(dt_str, - "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " - "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len - 1) != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + if (strncmp(dt_str, + "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " + "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", + str_len - 1) != 0) { + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); /* Length of the character buffer is smaller then needed */ str_len = 21; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } /* check the truncated string */ - if (HDstrlen(dt_str) != str_len - 1) + if (strlen(dt_str) != str_len - 1) goto out; - str_len = HDstrlen(dt_str); - if (HDstrncmp(dt_str, - "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " - "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len) != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + str_len = strlen(dt_str); + if (strncmp(dt_str, + "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " + "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", + str_len) != 0) { + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1321,7 +1321,7 @@ test_strings(void) out: if (dt_str) - HDfree(dt_str); + free(dt_str); H5_FAILED(); return -1; @@ -1358,21 +1358,20 @@ test_opaques(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrcmp( - dt_str, - "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") != + if (strcmp(dt_str, + "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1421,7 +1420,7 @@ test_enums(void) if (H5Tenum_nameof(dtype, &value1, name1, size) < 0) goto out; - if (HDstrcmp(name1, "BLUE") != 0) + if (strcmp(name1, "BLUE") != 0) goto out; if (H5Tenum_valueof(dtype, name2, &value2) < 0) @@ -1438,22 +1437,22 @@ test_enums(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrcmp(dt_str, - "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " - " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) { + if (strcmp(dt_str, + "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " + " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1502,18 +1501,18 @@ test_variables(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + if (strcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) { + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1564,21 +1563,21 @@ test_arrays(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n " - " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE " - "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + if (strcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n " + " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE " + "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) { + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1625,19 +1624,19 @@ test_compounds(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE " - "\"two_field\" : 6;\n }") != 0) { - HDprintf("dt=\n%s\n", dt_str); - HDfree(dt_str); + if (strcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE " + "\"two_field\" : 6;\n }") != 0) { + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1651,7 +1650,7 @@ test_compounds(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if (HDstrcmp(memb_name, "i16_field") != 0) { + if (strcmp(memb_name, "i16_field") != 0) { H5free_memory(memb_name); goto out; } @@ -1729,7 +1728,7 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 2)) == NULL) goto out; - if (HDstrcmp(memb_name, "sub") != 0) { + if (strcmp(memb_name, "sub") != 0) { H5free_memory(memb_name); goto out; } @@ -1738,13 +1737,13 @@ test_compound_bug(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1765,8 +1764,8 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if (HDstrcmp(memb_name, "desc____________________________________________________________________________" - "_____________") != 0) { + if (strcmp(memb_name, "desc____________________________________________________________________________" + "_____________") != 0) { H5free_memory(memb_name); goto out; } @@ -1775,14 +1774,14 @@ test_compound_bug(void) if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0) goto out; - if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char)))) + if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char)))) goto out; if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) { - HDfree(dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1813,9 +1812,9 @@ test_complicated_compound(void) HL_TESTING3(" text for complicated compound types"); /* Open input file */ - fp = HDfopen(filename, "r"); + fp = fopen(filename, "r"); if (fp == NULL) { - HDprintf("Could not find file %s. Try set $srcdir \n", filename); + printf("Could not find file %s. Try set $srcdir \n", filename); goto out; } @@ -1823,23 +1822,23 @@ test_complicated_compound(void) * Library has convenient function getline() but isn't available on * all machines. */ - if ((line = (char *)HDcalloc(size, sizeof(char))) == NULL) + if ((line = (char *)calloc(size, sizeof(char))) == NULL) goto out; - if (HDfgets(line, (int)size, fp) == NULL) + if (fgets(line, (int)size, fp) == NULL) goto out; - while (HDstrlen(line) == size - 1) { + while (strlen(line) == size - 1) { size *= 2; if (line) - HDfree(line); - if ((line = (char *)HDcalloc(size, sizeof(char))) == NULL) + free(line); + if ((line = (char *)calloc(size, sizeof(char))) == NULL) goto out; if (HDfseek(fp, 0L, SEEK_SET) != 0) goto out; - if (HDfgets(line, (int)size, fp) == NULL) + if (fgets(line, (int)size, fp) == NULL) goto out; } - HDfclose(fp); + fclose(fp); fp = NULL; if ((dtype = H5LTtext_to_dtype(line, H5LT_DDL)) < 0) @@ -1857,7 +1856,7 @@ test_complicated_compound(void) goto out; if (line) - HDfree(line); + free(line); PASSED(); return 0; @@ -1865,9 +1864,9 @@ test_complicated_compound(void) out: if (line) - HDfree(line); + free(line); if (fp) - HDfclose(fp); + fclose(fp); H5_FAILED(); return -1; diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 3bfba6e..8baa38c 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -58,7 +58,7 @@ static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10 static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf) { - if ((HDstrcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati || + if ((strcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || !H5_FLT_ABS_EQUAL(rbuf[i].pressure, wbuf[j].pressure) || !H5_DBL_ABS_EQUAL(rbuf[i].temperature, wbuf[j].temperature)) { return FAIL; @@ -168,7 +168,7 @@ test_create_close(hid_t fid) /* Create a datatype for the particle struct */ part_t = make_particle_type(); - HDassert(part_t != -1); + assert(part_t != -1); /* Create the table */ table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1); @@ -445,7 +445,7 @@ test_big_table(hid_t fid) /* Create a datatype for the particle struct */ part_t = make_particle_type(); - HDassert(part_t != -1); + assert(part_t != -1); /* Create a new table */ table = H5PTcreate_fl(fid, "Packet Test Dataset2", part_t, (hsize_t)33, -1); @@ -519,7 +519,7 @@ test_opaque(hid_t fid) if ((part_t = H5Tcreate(H5T_OPAQUE, sizeof(particle_t))) < 0) return FAIL; - HDassert(part_t != -1); + assert(part_t != -1); /* Tag the opaque datatype */ if (H5Tset_tag(part_t, "Opaque Particle") < 0) @@ -595,7 +595,7 @@ test_compress(void) /* Create a datatype for the particle struct */ part_t = make_particle_type(); - HDassert(part_t != -1); + assert(part_t != -1); /* Create a new table with compression level 8 */ table = H5PTcreate_fl(fid1, "Compressed Test Dataset", part_t, (hsize_t)80, 8); @@ -620,7 +620,7 @@ test_compress(void) TEST_ERROR; /* Read particles to ensure that all of them were written correctly */ - HDmemset(readPart, 0, sizeof(readPart)); + memset(readPart, 0, sizeof(readPart)); for (c = 0; c < BIG_TABLE_SIZE; c++) { err = H5PTget_next(table, (size_t)1, readPart); if (err < 0) @@ -982,7 +982,7 @@ main(void) /* create a file using default properties */ fid = H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDputs("Testing packet table"); + puts("Testing packet table"); /* Test packet table with fixed length */ if (test_packet_table(fid) < 0) diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c index 1d6195d..99a5dbe 100644 --- a/hl/test/test_packet_vlen.c +++ b/hl/test/test_packet_vlen.c @@ -68,9 +68,9 @@ test_VLof_atomic(void) /* Allocate and initialize VL data to write (copied from C test) */ for (uu = 0; uu < NRECORDS; uu++) { - writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int)); + writeBuf[uu].p = malloc((uu + 1) * sizeof(unsigned int)); if (writeBuf[uu].p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].len = uu + 1; @@ -109,7 +109,7 @@ test_VLof_atomic(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -120,8 +120,8 @@ test_VLof_atomic(void) for (uu = 0; uu < NRECORDS; uu++) for (vv = 0; vv < (uu + 1); vv++) { if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) { - HDprintf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]); - HDprintf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]); + printf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]); + printf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]); } } @@ -188,9 +188,9 @@ test_VLof_comptype(void) /* Allocate and initialize VL data to write (copied from C test) */ for (uu = 0; uu < NRECORDS; uu++) { - writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t)); + writeBuf[uu].p = malloc((uu + 1) * sizeof(VLcomp_t)); if (writeBuf[uu].p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].len = uu + 1; @@ -246,7 +246,7 @@ test_VLof_comptype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -257,16 +257,16 @@ test_VLof_comptype(void) /* Compare data read in */ for (uu = 0; uu < NRECORDS; uu++) { if (writeBuf[uu].len != readBuf[uu].len) { - HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n", - __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len); + fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n", + __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len); continue; } /* write len != read len */ for (vv = 0; vv < (uu + 1); vv++) { if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv]) { - HDfprintf( - stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv, - (int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]); + fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", + vv, (int)((unsigned int *)writeBuf[uu].p)[vv], vv, + (int)((unsigned int *)readBuf[uu].p)[vv]); continue; } /* write value != read value */ } @@ -344,16 +344,16 @@ test_compound_VL_VLtype(void) for (uu = 0; uu < NRECORDS; uu++) { writeBuf[uu].u = uu * 10; writeBuf[uu].f = (float)(uu * 20) / 3.0F; - writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t)); + writeBuf[uu].v.p = malloc((uu + L1_INCM) * sizeof(hvl_t)); if (writeBuf[uu].v.p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].v.len = uu + L1_INCM; for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++) { - t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int)); + t1->p = malloc((vv + L2_INCM) * sizeof(unsigned int)); if (t1->p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } t1->len = vv + L2_INCM; @@ -418,7 +418,7 @@ test_compound_VL_VLtype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -429,34 +429,34 @@ test_compound_VL_VLtype(void) /* Compare data read in */ for (uu = 0; uu < NRECORDS; uu++) { if (writeBuf[uu].u != readBuf[uu].u) { - HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, - writeBuf[uu].u, uu, readBuf[uu].u); + fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, + writeBuf[uu].u, uu, readBuf[uu].u); continue; } /* end if */ if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) { - HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, - (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); + fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, + (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); continue; } /* end if */ if (writeBuf[uu].v.len != readBuf[uu].v.len) { - HDfprintf(stderr, - "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", - __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len); + fprintf(stderr, + "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", + __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len); continue; } /* end if */ for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) { if (t1->len != t2->len) { - HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", - __LINE__, uu, vv, t1->len, t2->len); + fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", + __LINE__, uu, vv, t1->len, t2->len); continue; } /* end if */ for (ww = 0; (size_t)ww < t2->len; ww++) { if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww]) { - HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, - ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]); + fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, + ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]); continue; } /* end if */ } /* end for */ @@ -527,16 +527,16 @@ test_VLof_VLtype(void) /* Allocate and initialize VL data to write (copied from C test) */ for (uu = 0; uu < NRECORDS; uu++) { - writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t)); + writeBuf[uu].p = malloc((uu + 1) * sizeof(hvl_t)); if (writeBuf[uu].p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } /* end if */ writeBuf[uu].len = uu + 1; for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++) { - t1->p = HDmalloc((vv + 1) * sizeof(unsigned int)); + t1->p = malloc((vv + 1) * sizeof(unsigned int)); if (t1->p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } t1->len = vv + 1; @@ -582,7 +582,7 @@ test_VLof_VLtype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -652,10 +652,10 @@ verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expected_value) ret = SUCCEED; else { char lenthtype[20]; - HDstrcpy(lenthtype, "fixed-length"); + strcpy(lenthtype, "fixed-length"); if (expected_value == 1) - HDstrcpy(lenthtype, "variable-length"); - HDfprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype); + strcpy(lenthtype, "variable-length"); + fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype); ret = FAIL; } @@ -969,7 +969,7 @@ error: /* An error has occurred. Clean up and exit. */ *------------------------------------------------------------------------- */ static herr_t -verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) +verify_accessors(hid_t fid, const char *table_name, bool uses_vlen_type) { hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */ hid_t dset_id = H5I_INVALID_HID; /* Dataset associated with the pt */ @@ -990,7 +990,7 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) *buf = '\0'; if ((name_size = H5Iget_name(dset_id, (char *)buf, NAME_BUF_SIZE)) < 0) goto error; - VERIFY(HDstrcmp(buf, table_name), "Names of dataset and packet table don't match"); + VERIFY(strcmp(buf, table_name), "Names of dataset and packet table don't match"); /* Get the packet table's datatype ID */ if ((dtype_id = H5PTget_type(ptable)) < 0) @@ -1006,11 +1006,11 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) * expected_value passed in, then print the error message. */ char lenthtype[20]; - if (uses_vlen_type == TRUE) - HDstrcpy(lenthtype, "variable-length"); + if (uses_vlen_type == true) + strcpy(lenthtype, "variable-length"); else - HDstrcpy(lenthtype, "fixed-length"); - HDfprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); + strcpy(lenthtype, "fixed-length"); + fprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); goto error; } @@ -1050,11 +1050,11 @@ test_accessors(void) if (fid < 0) goto error; - ret = verify_accessors(fid, PT_VLEN_ATOMIC, TRUE); + ret = verify_accessors(fid, PT_VLEN_ATOMIC, true); if (ret < 0) goto error; - ret = verify_accessors(fid, PT_FIXED_LEN, FALSE); + ret = verify_accessors(fid, PT_FIXED_LEN, false); if (ret < 0) goto error; @@ -1103,9 +1103,9 @@ testfl_VLof_atomic(void) /* Allocate and initialize VL data to write (copied from C test) */ for (uu = 0; uu < NRECORDS; uu++) { - writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int)); + writeBuf[uu].p = malloc((uu + 1) * sizeof(unsigned int)); if (writeBuf[uu].p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].len = uu + 1; @@ -1144,7 +1144,7 @@ testfl_VLof_atomic(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1155,8 +1155,8 @@ testfl_VLof_atomic(void) for (uu = 0; uu < NRECORDS; uu++) for (vv = 0; vv < (uu + 1); vv++) { if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) { - HDprintf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]); - HDprintf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]); + printf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]); + printf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]); } } @@ -1223,9 +1223,9 @@ testfl_VLof_comptype(void) /* Allocate and initialize VL data to write (copied from C test) */ for (uu = 0; uu < NRECORDS; uu++) { - writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t)); + writeBuf[uu].p = malloc((uu + 1) * sizeof(VLcomp_t)); if (writeBuf[uu].p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].len = uu + 1; @@ -1281,7 +1281,7 @@ testfl_VLof_comptype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1292,16 +1292,15 @@ testfl_VLof_comptype(void) /* Compare data read in */ for (uu = 0; uu < NRECORDS; uu++) { if (writeBuf[uu].len != readBuf[uu].len) { - HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n", - __LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len); + fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n", + __LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len); continue; } /* write len != read len */ for (vv = 0; vv < (uu + 1); vv++) { if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv]) { - HDfprintf(stderr, - "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv, - ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]); + fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", + vv, ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]); continue; } /* write value != read value */ } @@ -1379,16 +1378,16 @@ testfl_compound_VL_VLtype(void) for (uu = 0; uu < NRECORDS; uu++) { writeBuf[uu].u = uu * 10; writeBuf[uu].f = (float)(uu * 20) / 3.0F; - writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t)); + writeBuf[uu].v.p = malloc((uu + L1_INCM) * sizeof(hvl_t)); if (writeBuf[uu].v.p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } writeBuf[uu].v.len = uu + L1_INCM; for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++) { - t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int)); + t1->p = malloc((vv + L2_INCM) * sizeof(unsigned int)); if (t1->p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } t1->len = vv + L2_INCM; @@ -1453,7 +1452,7 @@ testfl_compound_VL_VLtype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1464,34 +1463,34 @@ testfl_compound_VL_VLtype(void) /* Compare data read in */ for (uu = 0; uu < NRECORDS; uu++) { if (writeBuf[uu].u != readBuf[uu].u) { - HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, - writeBuf[uu].u, uu, readBuf[uu].u); + fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, + writeBuf[uu].u, uu, readBuf[uu].u); continue; } /* end if */ if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) { - HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, - (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); + fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, + (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); continue; } /* end if */ if (writeBuf[uu].v.len != readBuf[uu].v.len) { - HDfprintf(stderr, - "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", - __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len); + fprintf(stderr, + "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", + __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len); continue; } /* end if */ for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) { if (t1->len != t2->len) { - HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", - __LINE__, uu, vv, t1->len, t2->len); + fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", + __LINE__, uu, vv, t1->len, t2->len); continue; } /* end if */ for (ww = 0; (size_t)ww < t2->len; ww++) { if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww]) { - HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, - ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]); + fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, + ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]); continue; } /* end if */ } /* end for */ @@ -1562,16 +1561,16 @@ testfl_VLof_VLtype(void) /* Allocate and initialize VL data to write (copied from C test) */ for (uu = 0; uu < NRECORDS; uu++) { - writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t)); + writeBuf[uu].p = malloc((uu + 1) * sizeof(hvl_t)); if (writeBuf[uu].p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } /* end if */ writeBuf[uu].len = uu + 1; for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++) { - t1->p = HDmalloc((vv + 1) * sizeof(unsigned int)); + t1->p = malloc((vv + 1) * sizeof(unsigned int)); if (t1->p == NULL) { - HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); + fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu); goto error; } t1->len = vv + 1; @@ -1617,7 +1616,7 @@ testfl_VLof_VLtype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1683,7 +1682,7 @@ test_packet_table_with_varlen(void) if (H5Fclose(fid) < 0) return FAIL; - HDputs("Testing packet table with various variable-length datatypes"); + puts("Testing packet table with various variable-length datatypes"); /* If any test fails, move on to subsequent test, but status will indicate there is a failure. */ @@ -1731,7 +1730,7 @@ test_packet_table_with_varlen(void) if (H5Fclose(fid) < 0) return FAIL; - HDputs("Testing packet table with various variable-length datatypes - H5PTcreate_fl"); + puts("Testing packet table with various variable-length datatypes - H5PTcreate_fl"); /* If any test fails, move on to subsequent test, but status will indicate there is a failure. */ diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 7bef41d..c475e7f 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -136,8 +136,8 @@ h5file_open(const char *fname, unsigned flags) /* open */ if ((fid = H5Fopen(data_file, flags, H5P_DEFAULT)) < 0) { - HDfprintf(stderr, "Error: Cannot open file <%s>\n", data_file); - HDexit(1); + fprintf(stderr, "Error: Cannot open file <%s>\n", data_file); + exit(1); } return fid; @@ -150,14 +150,14 @@ h5file_open(const char *fname, unsigned flags) static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf) { - if ((HDstrcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati || + if ((strcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || !H5_FLT_ABS_EQUAL(rbuf[i].pressure, wbuf[j].pressure) || !H5_DBL_ABS_EQUAL(rbuf[i].temperature, wbuf[j].temperature)) { - HDfprintf(stderr, "read and write buffers have differences\n"); - HDfprintf(stderr, "%s %ld %f %f %d\n", rbuf[i].name, rbuf[i].longi, (double)rbuf[i].pressure, - rbuf[i].temperature, rbuf[i].lati); - HDfprintf(stderr, "%s %ld %f %f %d\n", wbuf[j].name, wbuf[j].longi, (double)wbuf[j].pressure, - wbuf[j].temperature, wbuf[j].lati); + fprintf(stderr, "read and write buffers have differences\n"); + fprintf(stderr, "%s %ld %f %f %d\n", rbuf[i].name, rbuf[i].longi, (double)rbuf[i].pressure, + rbuf[i].temperature, rbuf[i].lati); + fprintf(stderr, "%s %ld %f %f %d\n", wbuf[j].name, wbuf[j].longi, (double)wbuf[j].pressure, + wbuf[j].temperature, wbuf[j].lati); return -1; } return 0; @@ -477,9 +477,9 @@ test_table(hid_t fid, int do_write) *------------------------------------------------------------------------- */ if (do_write) - HDstrcpy(tname, "table2"); + strcpy(tname, "table2"); else - HDstrcpy(tname, "table1"); + strcpy(tname, "table1"); rstart = 0; rrecords = 8; @@ -617,7 +617,7 @@ test_table(hid_t fid, int do_write) wbufd[i].longi = wbuf[i].longi; wbufd[i].pressure = wbuf[i].pressure; wbufd[i].temperature = wbuf[i].temperature; - HDstrcpy(wbufd[i].name, wbuf[i].name); + strcpy(wbufd[i].name, wbuf[i].name); } if (H5TBmake_table(TITLE, fid, "table3", FIELDS, RECORDS, type_size_mem, field_names, field_offset, @@ -1023,10 +1023,9 @@ test_table(hid_t fid, int do_write) if (rbuf[i].lati != position_in[i - NRECORDS_ADD + 1].lati || rbuf[i].longi != position_in[i - NRECORDS_ADD + 1].longi || !H5_FLT_ABS_EQUAL(rbuf[i].pressure, pressure_in[i - NRECORDS_ADD + 1])) { - HDfprintf(stderr, "%ld %f %d\n", rbuf[i].longi, (double)rbuf[i].pressure, - rbuf[i].lati); - HDfprintf(stderr, "%ld %f %d\n", position_in[i].longi, (double)pressure_in[i], - position_in[i].lati); + fprintf(stderr, "%ld %f %d\n", rbuf[i].longi, (double)rbuf[i].pressure, rbuf[i].lati); + fprintf(stderr, "%ld %f %d\n", position_in[i].longi, (double)pressure_in[i], + position_in[i].lati); goto out; } } @@ -1131,7 +1130,7 @@ test_table(hid_t fid, int do_write) /* Compare the extracted table with the initial values */ for (i = 0; i < NRECORDS; i++) { - if ((HDstrcmp(namepre_out[i].name, namepre_in[i].name) != 0) || + if ((strcmp(namepre_out[i].name, namepre_in[i].name) != 0) || !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[i].pressure)) { goto out; } @@ -1139,7 +1138,7 @@ test_table(hid_t fid, int do_write) /* reset buffer */ for (i = 0; i < NRECORDS; i++) { - HDstrcpy(namepre_out[i].name, "\0"); + strcpy(namepre_out[i].name, "\0"); namepre_out[i].pressure = -1; } @@ -1156,7 +1155,7 @@ test_table(hid_t fid, int do_write) /* Compare the extracted table with the initial values */ for (i = 0; i < 3; i++) { hsize_t iistart = start; - if ((HDstrcmp(namepre_out[i].name, namepre_in[iistart + i].name) != 0) || + if ((strcmp(namepre_out[i].name, namepre_in[iistart + i].name) != 0) || !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart + i].pressure)) { goto out; } @@ -1319,7 +1318,7 @@ test_table(hid_t fid, int do_write) /* compare the extracted table with the initial values */ for (i = 0; i < NRECORDS; i++) { - if ((HDstrcmp(namepre_out[i].name, namepre_in[i].name) != 0) || + if ((strcmp(namepre_out[i].name, namepre_in[i].name) != 0) || !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[i].pressure)) { goto out; } @@ -1327,7 +1326,7 @@ test_table(hid_t fid, int do_write) /* reset buffer */ for (i = 0; i < NRECORDS; i++) { - HDstrcpy(namepre_out[i].name, "\0"); + strcpy(namepre_out[i].name, "\0"); namepre_out[i].pressure = -1; } @@ -1348,7 +1347,7 @@ test_table(hid_t fid, int do_write) /* compare the extracted table with the initial values */ for (i = 0; i < 3; i++) { int iistart = (int)start; - if ((HDstrcmp(namepre_out[i].name, wbuf[iistart + (int)i].name) != 0) || + if ((strcmp(namepre_out[i].name, wbuf[iistart + (int)i].name) != 0) || !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart + (int)i].pressure)) { goto out; } @@ -1384,7 +1383,7 @@ test_table(hid_t fid, int do_write) /* compare the extracted table with the original array */ for (i = 0; i < NRECORDS; i++) { - if ((HDstrcmp(rbuf2[i].name, wbuf[i].name) != 0) || rbuf2[i].lati != wbuf[i].lati || + if ((strcmp(rbuf2[i].name, wbuf[i].name) != 0) || rbuf2[i].lati != wbuf[i].lati || rbuf2[i].longi != wbuf[i].longi || !H5_FLT_ABS_EQUAL(rbuf2[i].pressure, wbuf[i].pressure) || !H5_DBL_ABS_EQUAL(rbuf2[i].temperature, wbuf[i].temperature) || rbuf2[i].new_field != buf_new[i]) { @@ -1420,7 +1419,7 @@ test_table(hid_t fid, int do_write) /* compare the extracted table with the original array */ for (i = 0; i < NRECORDS; i++) { - if ((HDstrcmp(rbuf3[i].name, wbuf[i].name) != 0) || rbuf3[i].lati != wbuf[i].lati || + if ((strcmp(rbuf3[i].name, wbuf[i].name) != 0) || rbuf3[i].lati != wbuf[i].lati || rbuf3[i].longi != wbuf[i].longi || !H5_DBL_ABS_EQUAL(rbuf3[i].temperature, wbuf[i].temperature)) { goto out; @@ -1464,9 +1463,9 @@ test_table(hid_t fid, int do_write) HL_TESTING2("getting field info"); /* allocate */ - names_out = (char **)HDmalloc(sizeof(char *) * (size_t)NFIELDS); + names_out = (char **)malloc(sizeof(char *) * (size_t)NFIELDS); for (i = 0; i < NFIELDS; i++) { - names_out[i] = (char *)HDmalloc(sizeof(char) * 255); + names_out[i] = (char *)malloc(sizeof(char) * 255); } /* Get field info */ @@ -1474,16 +1473,16 @@ test_table(hid_t fid, int do_write) goto out; for (i = 0; i < NFIELDS; i++) { - if ((HDstrcmp(field_names[i], names_out[i]) != 0)) { + if ((strcmp(field_names[i], names_out[i]) != 0)) { goto out; } } /* release */ for (i = 0; i < NFIELDS; i++) { - HDfree(names_out[i]); + free(names_out[i]); } - HDfree(names_out); + free(names_out); PASSED(); @@ -1516,7 +1515,7 @@ main(void) /* create a file using default properties */ fid = H5Fcreate("test_table.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDputs("Testing table with file creation mode (read/write in native architecture):"); + puts("Testing table with file creation mode (read/write in native architecture):"); /* test, do write */ if (test_table(fid, 1) < 0) @@ -1529,7 +1528,7 @@ main(void) * test2: open a file written in test1 on a big-endian machine *------------------------------------------------------------------------- */ - HDputs("Testing table with file open mode (read big-endian data):"); + puts("Testing table with file open mode (read big-endian data):"); fid = h5file_open(TEST_FILE_BE, flags); @@ -1544,7 +1543,7 @@ main(void) * test3: open a file written in test1 on a little-endian machine *------------------------------------------------------------------------- */ - HDputs("Testing table with file open mode (read little-endian data):"); + puts("Testing table with file open mode (read little-endian data):"); fid = h5file_open(TEST_FILE_LE, flags); @@ -1559,7 +1558,7 @@ main(void) * test4: open a file written in test1 on the Cray T3 machine *------------------------------------------------------------------------- */ - HDputs("Testing table with file open mode (read Cray data):"); + puts("Testing table with file open mode (read Cray data):"); fid = h5file_open(TEST_FILE_CRAY, flags); |