summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-03-02 14:42:50 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-03-02 14:42:50 (GMT)
commit69b2061d68aa85c8925c15a334fc5c3fb12e377f (patch)
tree045aa9a0c13cd2738b4733cc81e21d361d83245e /test/vfd_swmr.c
parent132dd66269db2b8e3e158fdbdc3bae80c989b993 (diff)
downloadhdf5-69b2061d68aa85c8925c15a334fc5c3fb12e377f.zip
hdf5-69b2061d68aa85c8925c15a334fc5c3fb12e377f.tar.gz
hdf5-69b2061d68aa85c8925c15a334fc5c3fb12e377f.tar.bz2
HD prefix and hbool_t changes in test/vfd_swmr.c
Diffstat (limited to 'test/vfd_swmr.c')
-rw-r--r--test/vfd_swmr.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c
index b140813..321f85f 100644
--- a/test/vfd_swmr.c
+++ b/test/vfd_swmr.c
@@ -835,7 +835,7 @@ decisleep(uint32_t tenths)
struct timespec delay = {.tv_sec = tenths / 10,
.tv_nsec = tenths * 100 * 1000 * 1000};
- while (nanosleep(&delay, &delay) == -1 && errno == EINTR)
+ while (HDnanosleep(&delay, &delay) == -1 && errno == EINTR)
; // do nothing
}
@@ -948,7 +948,7 @@ test_writer_md(void)
decisleep(my_config->tick_len);
/* Create a chunked dataset */
- sprintf(dname, "dset %d", i);
+ HDsprintf(dname, "dset %d", i);
if((did = H5Dcreate2(fid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
@@ -981,7 +981,7 @@ test_writer_md(void)
decisleep(my_config->tick_len);
/* Open the dataset */
- sprintf(dname, "dset %d", i);
+ HDsprintf(dname, "dset %d", i);
if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
@@ -1015,7 +1015,7 @@ test_writer_md(void)
decisleep(my_config->tick_len);
/* Open the dataset */
- sprintf(dname, "dset %d", i);
+ HDsprintf(dname, "dset %d", i);
if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
@@ -1503,7 +1503,7 @@ test_reader_md_concur(void)
decisleep(config_writer->tick_len);
/* Create a chunked dataset */
- sprintf(dname, "dset %d", i);
+ HDsprintf(dname, "dset %d", i);
if((did = H5Dcreate2(fid_writer, dname, H5T_NATIVE_INT, sid,
H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
@@ -1581,7 +1581,7 @@ test_reader_md_concur(void)
decisleep(config_writer->tick_len);
/* Open the dataset */
- sprintf(dname, "dset %d", i);
+ HDsprintf(dname, "dset %d", i);
if((did = H5Dopen2(fid_writer, dname, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
@@ -1636,7 +1636,7 @@ test_reader_md_concur(void)
decisleep(config_writer->tick_len);
/* Open the dataset */
- sprintf(dname, "dset %d", i);
+ HDsprintf(dname, "dset %d", i);
if((did = H5Dopen2(fid_writer, dname, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
@@ -1690,7 +1690,7 @@ test_reader_md_concur(void)
decisleep(config_writer->tick_len);
/* Open the dataset */
- sprintf(dname, "dset %d", i);
+ HDsprintf(dname, "dset %d", i);
if((did = H5Dopen2(fid_writer, dname, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
@@ -3071,7 +3071,7 @@ test_shadow_index_lookup(void)
char vector[8];
unsigned seed = 1;
unsigned i, j, failj = UINT_MAX;
- bool have_failj = false;
+ hbool_t have_failj = FALSE;
unsigned long tmpl;
char *ostate;
const char *seedvar = "H5_SHADOW_INDEX_SEED";
@@ -3085,7 +3085,7 @@ test_shadow_index_lookup(void)
nerrors = 1;
goto out;
case 0:
- seed = (unsigned int)time(NULL);
+ seed = (unsigned int)HDtime(NULL);
break;
default:
seed = (unsigned int)tmpl;
@@ -3101,55 +3101,55 @@ test_shadow_index_lookup(void)
break;
default:
failj = (unsigned int)tmpl;
- have_failj = true;
+ have_failj = TRUE;
break;
}
ostate = initstate(seed, vector, _arraycount(vector));
- size[5] = (uint32_t)(1024 + random() % (16 * 1024 * 1024 - 1024));
+ size[5] = (uint32_t)(1024 + HDrandom() % (16 * 1024 * 1024 - 1024));
for (i = 0; i < _arraycount(size); i++) {
uint32_t cursize = size[i];
const uint64_t modulus = UINT64_MAX / MAX(1, cursize);
uint64_t pageno;
- assert(modulus > 1); // so that modulus - 1 > 0, below
+ HDassert(modulus > 1); // so that modulus - 1 > 0, below
- idx = (cursize == 0) ? NULL : calloc(cursize, sizeof(*idx));
+ idx = (cursize == 0) ? NULL : HDcalloc(cursize, sizeof(*idx));
if (idx == NULL && cursize != 0) {
- fprintf(stderr, "couldn't allocate %" PRIu32 " indices\n",
+ HDfprintf(stderr, "couldn't allocate %" PRIu32 " indices\n",
cursize);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
- for (pageno = (uint64_t)random() % modulus, j = 0;
+ for (pageno = (uint64_t)HDrandom() % modulus, j = 0;
j < cursize;
- j++, pageno += 1 + (uint64_t)random() % (modulus - 1)) {
+ j++, pageno += 1 + (uint64_t)HDrandom() % (modulus - 1)) {
idx[j].hdf5_page_offset = pageno;
}
for (j = 0; j < cursize; j++) {
H5FD_vfd_swmr_idx_entry_t *found;
found = vfd_swmr_pageno_to_mdf_idx_entry(idx, cursize,
- idx[j].hdf5_page_offset, false);
+ idx[j].hdf5_page_offset, FALSE);
if ((have_failj && failj == j) || found != &idx[j])
break;
}
if (j < cursize) {
- printf("\nshadow-index entry %d lookup, pageno %" PRIu64
+ HDprintf("\nshadow-index entry %d lookup, pageno %" PRIu64
", index size %" PRIu32 ", seed %u", j,
idx[j].hdf5_page_offset, cursize, seed);
nerrors++;
}
if (idx != NULL)
- free(idx);
+ HDfree(idx);
}
(void)setstate(ostate);
out:
if (nerrors == 0)
PASSED();
else
- printf(" FAILED\n");
+ HDprintf(" FAILED\n");
return nerrors;
}