diff options
Diffstat (limited to 'hl/test')
-rw-r--r-- | hl/test/gen_test_ds.c | 16 | ||||
-rw-r--r-- | hl/test/test_ds.c | 72 | ||||
-rw-r--r-- | hl/test/test_dset_append.c | 14 | ||||
-rw-r--r-- | hl/test/test_file_image.c | 70 | ||||
-rw-r--r-- | hl/test/test_h5do_compat.c | 2 | ||||
-rw-r--r-- | hl/test/test_image.c | 92 | ||||
-rw-r--r-- | hl/test/test_ld.c | 40 | ||||
-rw-r--r-- | hl/test/test_lite.c | 144 | ||||
-rw-r--r-- | hl/test/test_packet.c | 10 | ||||
-rw-r--r-- | hl/test/test_packet_vlen.c | 123 | ||||
-rw-r--r-- | hl/test/test_table.c | 29 |
11 files changed, 305 insertions, 307 deletions
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c index e0a3499..27a98e7 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/test_ds.c b/hl/test/test_ds.c index 70af31a..3d31786 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; } @@ -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) { ret_value = SUCCEED; } - HDfree(name_out); + free(name_out); name_out = NULL; } } @@ -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 @@ -3161,8 +3161,8 @@ 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) @@ -3174,11 +3174,11 @@ test_simple(void) if (HDstrncmp(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; } @@ -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; @@ -3236,7 +3236,7 @@ test_simple(void) if (HDstrncmp("Latitude set 0", name_out, (size_t)name_len) != 0) goto out; if (name_out) { - HDfree(name_out); + free(name_out); name_out = NULL; } @@ -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 @@ -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 @@ -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,20 +4957,20 @@ 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); + printf("fscanf error in file %s\n", data_file); HDfclose(f); return -1; } /* end if */ if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s\n", data_file); + printf("fscanf error in file %s\n", data_file); HDfclose(f); return -1; } /* end if */ @@ -4978,17 +4978,17 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf) nelms *= (size_t)n; } - *buf = (float *)HDmalloc(nelms * sizeof(float)); + *buf = (float *)malloc(nelms * sizeof(float)); if (*buf == NULL) { - HDprintf("memory allocation failed\n"); + printf("memory allocation failed\n"); HDfclose(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); + printf("fscanf error in file %s\n", data_file); HDfclose(f); return -1; } /* end if */ @@ -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 diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index c4afe89..e8b474c 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 defaab2..e7d830b 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,9 +109,9 @@ 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); @@ -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 4a3c607..bf48e9b 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) diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 462a3ce..6541ef5 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; } @@ -580,11 +580,11 @@ test_generate(void) */ if (HDfscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + 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); + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -606,16 +606,16 @@ 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); + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ data[i] = value; @@ -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 { @@ -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); + 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); + 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); + 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); + 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); + 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); + 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; @@ -838,7 +838,7 @@ 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); + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ image_data[i] = (unsigned char)n; @@ -889,8 +889,8 @@ 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; } diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index 11ea0e6..64bf09f 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -1036,10 +1036,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]); @@ -1247,10 +1247,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]); @@ -1350,19 +1350,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; /* @@ -1414,17 +1414,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..6ff3134 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -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); + 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); + 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); + 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,46 +1256,46 @@ 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); + 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); + 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 */ @@ -1306,12 +1306,12 @@ test_strings(void) "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); + 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,21 @@ 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 }") != 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; @@ -1438,22 +1438,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) { - 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 +1502,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); + 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 +1564,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); + 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 +1625,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); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1738,13 +1738,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; @@ -1775,14 +1775,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 +1813,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,15 +1823,15 @@ 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) goto out; while (HDstrlen(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; @@ -1857,7 +1857,7 @@ test_complicated_compound(void) goto out; if (line) - HDfree(line); + free(line); PASSED(); return 0; @@ -1865,7 +1865,7 @@ test_complicated_compound(void) out: if (line) - HDfree(line); + free(line); if (fp) HDfclose(fp); diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 3bfba6e..d4af45e 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -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) diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c index 5e06c85..bf95859 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; @@ -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; @@ -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; @@ -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; @@ -655,7 +655,7 @@ verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expected_value) HDstrcpy(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); + fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype); ret = FAIL; } @@ -1010,7 +1010,7 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) HDstrcpy(lenthtype, "variable-length"); else HDstrcpy(lenthtype, "fixed-length"); - HDfprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); + fprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); 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; @@ -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; @@ -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; @@ -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; diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 3c8246a..06e07b8 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; @@ -153,11 +153,11 @@ 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 || 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; @@ -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; } } @@ -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 */ @@ -1481,9 +1480,9 @@ test_table(hid_t fid, int do_write) /* release */ for (i = 0; i < NFIELDS; i++) { - HDfree(names_out[i]); + free(names_out[i]); } - HDfree(names_out); + free(names_out); PASSED(); |