summaryrefslogtreecommitdiffstats
path: root/test/external.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/external.c')
-rw-r--r--test/external.c288
1 files changed, 144 insertions, 144 deletions
diff --git a/test/external.c b/test/external.c
index aad2d7c..bf3c5bd 100644
--- a/test/external.c
+++ b/test/external.c
@@ -29,7 +29,7 @@
*
*-------------------------------------------------------------------------
*/
-static hbool_t
+static bool
files_have_same_contents(const char *name1, const char *name2)
{
int fd1 = 0;
@@ -38,7 +38,7 @@ files_have_same_contents(const char *name1, const char *name2)
ssize_t n2 = 0;
char buf1[1024];
char buf2[1024];
- hbool_t ret = FALSE; /* not equal until proven otherwise */
+ bool ret = false; /* not equal until proven otherwise */
if ((fd1 = HDopen(name1, O_RDONLY)) < 0)
goto out;
@@ -61,7 +61,7 @@ files_have_same_contents(const char *name1, const char *name2)
break;
if (n1 == 0 && n2 == 0) {
- ret = TRUE;
+ ret = true;
break;
}
@@ -91,15 +91,15 @@ out:
static int
test_non_extendible(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1] = {100}; /* data space current size */
- hsize_t max_size[1] = {100}; /* data space maximum size */
- int n = 0; /* number of external files */
- off_t file_offset = 0; /* external file offset */
- hsize_t file_size = 0; /* sizeof external file segment */
- haddr_t dset_addr = HADDR_UNDEF; /* address of dataset */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* data space */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ hsize_t cur_size[1] = {100}; /* data space current size */
+ hsize_t max_size[1] = {100}; /* data space maximum size */
+ int n = 0; /* number of external files */
+ off_t file_offset = 0; /* external file offset */
+ hsize_t file_size = 0; /* sizeof external file segment */
+ haddr_t dset_addr = HADDR_UNDEF; /* address of dataset */
TESTING("fixed-size data space, exact storage");
@@ -139,7 +139,7 @@ test_non_extendible(hid_t file)
FAIL_STACK_ERROR;
if (1 != n) {
H5_FAILED();
- HDputs(" Returned external count is wrong.");
+ puts(" Returned external count is wrong.");
printf(" got: %d\n ans: 1\n", n);
goto error;
}
@@ -149,13 +149,13 @@ test_non_extendible(hid_t file)
FAIL_STACK_ERROR;
if (file_offset != 0) {
H5_FAILED();
- HDputs(" Wrong file offset.");
+ puts(" Wrong file offset.");
printf(" got: %lu\n ans: 0\n", (unsigned long)file_offset);
goto error;
}
if (file_size != (max_size[0] * sizeof(int))) {
H5_FAILED();
- HDputs(" Wrong file size.");
+ puts(" Wrong file size.");
printf(" got: %" PRIuHSIZE "\n ans: %" PRIuHSIZE "\n", file_size, max_size[0] * sizeof(int));
goto error;
}
@@ -193,11 +193,11 @@ error:
static int
test_too_small(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1] = {100}; /* current data space size */
- hsize_t max_size[1] = {100}; /* maximum data space size */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* data space */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ hsize_t cur_size[1] = {100}; /* current data space size */
+ hsize_t max_size[1] = {100}; /* maximum data space size */
TESTING("external storage is too small");
@@ -250,11 +250,11 @@ error:
static int
test_large_enough_current_eventual(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1] = {100}; /* current data space size */
- hsize_t max_size[1] = {200}; /* maximum data space size */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* data space */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ hsize_t cur_size[1] = {100}; /* current data space size */
+ hsize_t max_size[1] = {200}; /* maximum data space size */
TESTING("extendible dataspace, exact external size");
@@ -302,11 +302,11 @@ error:
static int
test_large_enough_current_not_eventual(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1] = {100}; /* current data space size */
- hsize_t max_size[1] = {200}; /* maximum data space size */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* data space */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ hsize_t cur_size[1] = {100}; /* current data space size */
+ hsize_t max_size[1] = {200}; /* maximum data space size */
TESTING("extendible dataspace, external storage is too small");
@@ -359,9 +359,9 @@ error:
static int
test_unlimited(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* data space */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
hsize_t cur_size[1] = {100}; /* data space current size */
hsize_t max_size[1] = {H5S_UNLIMITED}; /* data space maximum size */
int n; /* number of external files */
@@ -396,7 +396,7 @@ test_unlimited(hid_t file)
FAIL_STACK_ERROR;
if (1 != n) {
H5_FAILED();
- HDputs(" Returned external count is wrong.");
+ puts(" Returned external count is wrong.");
printf(" got: %d\n ans: 1\n", n);
goto error;
} /* end if */
@@ -405,13 +405,13 @@ test_unlimited(hid_t file)
FAIL_STACK_ERROR;
if (file_offset != 0) {
H5_FAILED();
- HDputs(" Wrong file offset.");
+ puts(" Wrong file offset.");
printf(" got: %lu\n ans: 0\n", (unsigned long)file_offset);
goto error;
}
if (H5F_UNLIMITED != file_size) {
H5_FAILED();
- HDputs(" Wrong file size.");
+ puts(" Wrong file size.");
printf(" got: %lu\n ans: INF\n", (unsigned long)file_size);
goto error;
}
@@ -457,7 +457,7 @@ add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, h
return -1;
}
for (i = 0; i < n_external_files; i++) {
- if (HDsnprintf(exname, AEF_EXNAME_MAX_LEN, "ext%d.data", i + 1) > AEF_EXNAME_MAX_LEN) {
+ if (snprintf(exname, AEF_EXNAME_MAX_LEN, "ext%d.data", i + 1) > AEF_EXNAME_MAX_LEN) {
fprintf(stderr, "External file %d overflows name buffer\n", i + 1);
fflush(stderr);
return -1;
@@ -484,12 +484,12 @@ add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, h
static int
test_multiple_files(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* dataspace */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1] = {100}; /* data space current size */
- hsize_t max_size[1] = {100}; /* data space maximum size */
- hsize_t max_ext_size; /* maximum size of external files */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* dataspace */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ hsize_t cur_size[1] = {100}; /* data space current size */
+ hsize_t max_size[1] = {100}; /* data space maximum size */
+ hsize_t max_ext_size; /* maximum size of external files */
unsigned int n_external_files = 4;
TESTING("multiple external files");
@@ -568,9 +568,9 @@ error:
static int
test_add_to_unlimited(void)
{
- hid_t dcpl = -1; /* dataset creation properties */
- herr_t status = FAIL; /* function return status */
- int n = 0; /* number of external files */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ herr_t status = FAIL; /* function return status */
+ int n = 0; /* number of external files */
TESTING("external file following unlimited file");
@@ -620,8 +620,8 @@ error:
static int
test_overflow(void)
{
- hid_t dcpl = -1; /* dataset creation properties */
- herr_t status = FAIL; /* return status */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ herr_t status = FAIL; /* return status */
TESTING("address overflow in external files");
@@ -666,19 +666,19 @@ error:
static int
test_read_file_set(hid_t fapl)
{
- hid_t file = -1; /* file to write to */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hid_t grp = -1; /* group to emit diagnostics */
- size_t i = 0; /* miscellaneous counter */
- char filename[1024]; /* file names */
- int part[PART_SIZE]; /* raw data buffer (partial) */
- int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
- hid_t hs_space = -1; /* hyperslab data space */
- hsize_t hs_start = 30; /* hyperslab starting offset */
- hsize_t hs_count = 25; /* hyperslab size */
+ hid_t file = H5I_INVALID_HID; /* file to write to */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* data space */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ hid_t grp = H5I_INVALID_HID; /* group to emit diagnostics */
+ size_t i = 0; /* miscellaneous counter */
+ char filename[1024]; /* file names */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
+ int whole[TOTAL_SIZE]; /* raw data buffer (total) */
+ hsize_t cur_size; /* current data space size */
+ hid_t hs_space = H5I_INVALID_HID; /* hyperslab data space */
+ hsize_t hs_start = 30; /* hyperslab starting offset */
+ hsize_t hs_count = 25; /* hyperslab size */
TESTING("read external dataset");
@@ -686,7 +686,7 @@ test_read_file_set(hid_t fapl)
TEST_ERROR;
/* Reset the raw data files */
- if (reset_raw_data_files(FALSE) < 0)
+ if (reset_raw_data_files(false) < 0)
TEST_ERROR;
/* Create the file and an initial group. This causes messages about
@@ -705,7 +705,7 @@ test_read_file_set(hid_t fapl)
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
for (i = 0; i < N_EXT_FILES; i++) {
- HDsnprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1);
+ snprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1);
if (H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
FAIL_STACK_ERROR;
}
@@ -788,19 +788,19 @@ error:
static int
test_write_file_set(hid_t fapl)
{
- hid_t file = -1; /* file to which to write */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t mem_space = -1; /* memory data space */
- hid_t file_space = -1; /* file data space */
- hid_t dset = -1; /* dataset */
- unsigned i = 0; /* miscellaneous counter */
- int part[PART_SIZE]; /* raw data buffer (partial) */
- int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size = 100; /* current data space size */
- hsize_t max_size = 200; /* maximum data space size */
- hsize_t hs_start = 100; /* hyperslab starting offset */
- hsize_t hs_count = 100; /* hyperslab size */
- char filename[1024]; /* file name */
+ hid_t file = H5I_INVALID_HID; /* file to which to write */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t mem_space = H5I_INVALID_HID; /* memory data space */
+ hid_t file_space = H5I_INVALID_HID; /* file data space */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ unsigned i = 0; /* miscellaneous counter */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
+ int whole[TOTAL_SIZE]; /* raw data buffer (total) */
+ hsize_t cur_size = 100; /* current data space size */
+ hsize_t max_size = 200; /* maximum data space size */
+ hsize_t hs_start = 100; /* hyperslab starting offset */
+ hsize_t hs_count = 100; /* hyperslab size */
+ char filename[1024]; /* file name */
TESTING("write external dataset");
@@ -818,7 +818,7 @@ test_write_file_set(hid_t fapl)
for (i = 0; i < N_EXT_FILES; i++) {
hsize_t size;
- HDsnprintf(filename, sizeof(filename), "extern_%dw.raw", (int)i + 1);
+ snprintf(filename, sizeof(filename), "extern_%dw.raw", (int)i + 1);
if (i != N_EXT_FILES - 1)
size = (hsize_t)sizeof(part);
@@ -830,7 +830,7 @@ test_write_file_set(hid_t fapl)
} /* end for */
/* Reset the raw data files */
- if (reset_raw_data_files(FALSE) < 0)
+ if (reset_raw_data_files(false) < 0)
TEST_ERROR;
/* Create the dataset */
@@ -849,8 +849,8 @@ test_write_file_set(hid_t fapl)
for (i = 0; i < N_EXT_FILES; i++) {
char name1[64], name2[64];
- HDsnprintf(name1, sizeof(name1), "extern_%dr.raw", i + 1);
- HDsnprintf(name2, sizeof(name2), "extern_%dw.raw", i + 1);
+ snprintf(name1, sizeof(name1), "extern_%dr.raw", i + 1);
+ snprintf(name2, sizeof(name2), "extern_%dw.raw", i + 1);
if (!files_have_same_contents(name1, name2))
FAIL_PUTS_ERROR(" Output differs from expected value.");
} /* end for */
@@ -915,16 +915,16 @@ error:
static int
test_path_absolute(hid_t fapl)
{
- hid_t file = -1; /* file to write to */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- size_t i = 0; /* miscellaneous counter */
- char cwdpath[1024]; /* working directory */
- char filename[1088]; /* file name */
- int part[PART_SIZE]; /* raw data buffer (partial) */
- int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
+ hid_t file = H5I_INVALID_HID; /* file to write to */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* data space */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ size_t i = 0; /* miscellaneous counter */
+ char cwdpath[1024]; /* working directory */
+ char filename[1088]; /* file name */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
+ int whole[TOTAL_SIZE]; /* raw data buffer (total) */
+ hsize_t cur_size; /* current data space size */
TESTING("absolute filenames for external file");
@@ -933,7 +933,7 @@ test_path_absolute(hid_t fapl)
FAIL_STACK_ERROR;
/* Reset the raw data files */
- if (reset_raw_data_files(FALSE) < 0)
+ if (reset_raw_data_files(false) < 0)
TEST_ERROR;
/* Create the dcpl */
@@ -942,11 +942,11 @@ test_path_absolute(hid_t fapl)
if (NULL == HDgetcwd(cwdpath, sizeof(cwdpath)))
TEST_ERROR;
for (i = 0; i < N_EXT_FILES; i++) {
- HDsnprintf(filename, sizeof(filename), "%s%sextern_%zur.raw", cwdpath, H5_DIR_SEPS, i + 1);
+ snprintf(filename, sizeof(filename), "%s%sextern_%zur.raw", cwdpath, H5_DIR_SEPS, i + 1);
#if defined(H5_HAVE_WINDOW_PATH)
/* For windows, test path-absolute case (\dir\file.raw) for the second file */
if (i == 1)
- HDsnprintf(filename, sizeof(filename), "%s%sextern_%zur.raw", cwdpath + 2, H5_DIR_SEPS, i + 1);
+ snprintf(filename, sizeof(filename), "%s%sextern_%zur.raw", cwdpath + 2, H5_DIR_SEPS, i + 1);
#endif
if (H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
FAIL_STACK_ERROR;
@@ -1007,15 +1007,15 @@ error:
static int
test_path_relative(hid_t fapl)
{
- hid_t file = -1; /* file to write to */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- size_t i = 0; /* miscellaneous counters */
- char filename[1024]; /* file name */
- int part[PART_SIZE]; /* raw data buffer (partial) */
- int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
+ hid_t file = H5I_INVALID_HID; /* file to write to */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* data space */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ size_t i = 0; /* miscellaneous counters */
+ char filename[1024]; /* file name */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
+ int whole[TOTAL_SIZE]; /* raw data buffer (total) */
+ hsize_t cur_size; /* current data space size */
TESTING("filenames relative to current directory for external file");
@@ -1030,14 +1030,14 @@ test_path_relative(hid_t fapl)
FAIL_STACK_ERROR;
/* Reset the raw data files */
- if (reset_raw_data_files(FALSE) < 0)
+ if (reset_raw_data_files(false) < 0)
TEST_ERROR;
/* Create the dataset */
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
for (i = 0; i < N_EXT_FILES; i++) {
- HDsnprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1);
+ snprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1);
if (H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
FAIL_STACK_ERROR;
} /* end for */
@@ -1096,20 +1096,20 @@ error:
static int
test_path_relative_cwd(hid_t fapl)
{
- hid_t file = -1; /* file to write to */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dapl = -1; /* dataset access property list */
- hid_t dapl2 = -1; /* copy of dapl */
- hid_t dset = -1; /* dataset */
- hid_t dset2 = -1; /* dataset, opened a second time */
- hid_t dset3 = -1; /* dataset, opened with different prefix */
- size_t i = 0; /* miscellaneous counters */
- char filename[1024]; /* file name */
- int part[PART_SIZE]; /* raw data buffer (partial) */
- int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
- char buffer[1024]; /* buffer to read efile_prefix */
+ hid_t file = H5I_INVALID_HID; /* file to write to */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t space = H5I_INVALID_HID; /* data space */
+ hid_t dapl = H5I_INVALID_HID; /* dataset access property list */
+ hid_t dapl2 = H5I_INVALID_HID; /* copy of dapl */
+ hid_t dset = H5I_INVALID_HID; /* dataset */
+ hid_t dset2 = H5I_INVALID_HID; /* dataset, opened a second time */
+ hid_t dset3 = H5I_INVALID_HID; /* dataset, opened with different prefix */
+ size_t i = 0; /* miscellaneous counters */
+ char filename[1024]; /* file name */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
+ int whole[TOTAL_SIZE]; /* raw data buffer (total) */
+ hsize_t cur_size; /* current data space size */
+ char buffer[1024]; /* buffer to read efile_prefix */
TESTING("filenames relative to HDF5 file for external file");
@@ -1124,14 +1124,14 @@ test_path_relative_cwd(hid_t fapl)
FAIL_STACK_ERROR;
/* Reset the raw data files */
- if (reset_raw_data_files(FALSE) < 0)
+ if (reset_raw_data_files(false) < 0)
TEST_ERROR;
/* Create the dataset */
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
for (i = 0; i < N_EXT_FILES; i++) {
- HDsnprintf(filename, sizeof(filename), "..%sextern_%dr.raw", H5_DIR_SEPS, (int)i + 1);
+ snprintf(filename, sizeof(filename), "..%sextern_%dr.raw", H5_DIR_SEPS, (int)i + 1);
if (H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
FAIL_STACK_ERROR;
} /* end for */
@@ -1145,7 +1145,7 @@ test_path_relative_cwd(hid_t fapl)
FAIL_STACK_ERROR;
if (H5Pget_efile_prefix(dapl, buffer, sizeof(buffer)) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(buffer, "${ORIGIN}") != 0)
+ if (strcmp(buffer, "${ORIGIN}") != 0)
FAIL_PUTS_ERROR("efile prefix not set correctly");
if ((dapl2 = H5Pcopy(dapl)) < 0)
FAIL_STACK_ERROR;
@@ -1260,14 +1260,14 @@ error:
static int
test_h5d_get_access_plist(hid_t fapl_id)
{
- hid_t fid = -1; /* file to write to */
- hid_t dcpl_id = -1; /* dataset creation properties */
- hid_t dapl_id = -1; /* dataset access properties */
- hid_t sid = -1; /* data space */
- hid_t did = -1; /* dataset */
- hsize_t dims = 0; /* dataset size */
- char *buffer = NULL; /* saved prefix name from dapl */
- char filename[1024]; /* file names */
+ hid_t fid = H5I_INVALID_HID; /* file to write to */
+ hid_t dcpl_id = H5I_INVALID_HID; /* dataset creation properties */
+ hid_t dapl_id = H5I_INVALID_HID; /* dataset access properties */
+ hid_t sid = H5I_INVALID_HID; /* data space */
+ hid_t did = H5I_INVALID_HID; /* dataset */
+ hsize_t dims = 0; /* dataset size */
+ char *buffer = NULL; /* saved prefix name from dapl */
+ char filename[1024]; /* file names */
TESTING("H5Dget_access_plist() returns correct prefix");
@@ -1275,7 +1275,7 @@ test_h5d_get_access_plist(hid_t fapl_id)
TEST_ERROR;
/* Reset the raw data files */
- if (reset_raw_data_files(FALSE) < 0)
+ if (reset_raw_data_files(false) < 0)
TEST_ERROR;
/* Create the file */
@@ -1315,7 +1315,7 @@ test_h5d_get_access_plist(hid_t fapl_id)
TEST_ERROR;
if (H5Pget_efile_prefix(dapl_id, buffer, (size_t)64) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(buffer, "someprefix") != 0)
+ if (strcmp(buffer, "someprefix") != 0)
FAIL_PUTS_ERROR("external file prefix from dapl incorrect");
/* Close everything */
@@ -1361,13 +1361,13 @@ error:
int
main(void)
{
- hid_t fapl_id_old = -1; /* file access properties (old format) */
- hid_t fapl_id_new = -1; /* file access properties (new format) */
- hid_t fid = -1; /* file for test_1* functions */
- hid_t gid = -1; /* group to emit diagnostics */
- char filename[1024]; /* file name for test_1* funcs */
- unsigned latest_format; /* default or latest file format */
- int nerrors = 0; /* number of errors */
+ hid_t fapl_id_old = H5I_INVALID_HID; /* file access properties (old format) */
+ hid_t fapl_id_new = H5I_INVALID_HID; /* file access properties (new format) */
+ hid_t fid = H5I_INVALID_HID; /* file for test_1* functions */
+ hid_t gid = H5I_INVALID_HID; /* group to emit diagnostics */
+ char filename[1024]; /* file name for test_1* funcs */
+ unsigned latest_format; /* default or latest file format */
+ int nerrors = 0; /* number of errors */
h5_reset();
@@ -1383,19 +1383,19 @@ main(void)
/* The file format doesn't matter for this test */
nerrors += test_h5d_get_access_plist(fapl_id_new);
- HDputs("");
+ puts("");
/* Test with old & new format groups */
- for (latest_format = FALSE; latest_format <= TRUE; latest_format++) {
- hid_t current_fapl_id = -1;
+ for (latest_format = false; latest_format <= true; latest_format++) {
+ hid_t current_fapl_id = H5I_INVALID_HID;
/* Set the fapl for different file formats */
if (latest_format) {
- HDputs("\nTesting with the latest file format:");
+ puts("\nTesting with the latest file format:");
current_fapl_id = fapl_id_new;
}
else {
- HDputs("Testing with the default file format:");
+ puts("Testing with the default file format:");
current_fapl_id = fapl_id_old;
}
@@ -1444,7 +1444,7 @@ main(void)
if (H5Pclose(fapl_id_new) < 0)
FAIL_STACK_ERROR;
- HDputs("All external storage tests passed.");
+ puts("All external storage tests passed.");
/* Clean up files used by file set tests */
if (h5_cleanup(EXT_FNAME, fapl_id_old)) {