summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-06-18 13:07:35 (GMT)
committerGitHub <noreply@github.com>2021-06-18 13:07:35 (GMT)
commit79c2a900d3d02fd43991ebfabcce651fae8ff748 (patch)
tree6d344f8272473a0139129b7c2d315673f1dd9945 /test
parenta00ad2b657b7918d4b11edee893f6701cf50e351 (diff)
downloadhdf5-79c2a900d3d02fd43991ebfabcce651fae8ff748.zip
hdf5-79c2a900d3d02fd43991ebfabcce651fae8ff748.tar.gz
hdf5-79c2a900d3d02fd43991ebfabcce651fae8ff748.tar.bz2
VFD SWMR: Minor fixes (#771)
* Fixes missing C99 format specifiers in page_buffer test * Warning and other misc fixes in VFD SWMR accept. tests * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/page_buffer.c20
-rw-r--r--test/vfd_swmr_attrdset_writer.c13
-rw-r--r--test/vfd_swmr_dsetops_writer.c6
-rw-r--r--test/vfd_swmr_group_writer.c2
-rw-r--r--test/vfd_swmr_remove_reader.c20
-rw-r--r--test/vfd_swmr_sparse_reader.c11
6 files changed, 40 insertions, 32 deletions
diff --git a/test/page_buffer.c b/test/page_buffer.c
index 429b4c8..b04d1a2 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -2557,7 +2557,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
if ((f->shared->page_buf->accesses[0] != 10) || (f->shared->page_buf->accesses[1] != 16) ||
(f->shared->page_buf->accesses[2] != 0)) {
- HDfprintf(stderr, "accesses[] = {%d, %d, %d}. {10, 16, 0} expected\n",
+ HDfprintf(stderr, "accesses[] = {%" PRId64 ", %" PRId64 ", %" PRId64 "}. {10, 16, 0} expected\n",
f->shared->page_buf->accesses[0], f->shared->page_buf->accesses[1],
f->shared->page_buf->accesses[2]);
TEST_ERROR;
@@ -2567,16 +2567,17 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
if ((f->shared->page_buf->bypasses[0] != 0) || (f->shared->page_buf->bypasses[1] != 1) ||
(f->shared->page_buf->bypasses[2] != 1)) {
- HDfprintf(stderr, "bypasses[] = {%d, %d, %d}. {0, 1, 1} expected\n", f->shared->page_buf->bypasses[0],
- f->shared->page_buf->bypasses[1], f->shared->page_buf->bypasses[2]);
+ HDfprintf(stderr, "bypasses[] = {%" PRId64 ", %" PRId64 ", %" PRId64 "}. {0, 1, 1} expected\n",
+ f->shared->page_buf->bypasses[0], f->shared->page_buf->bypasses[1],
+ f->shared->page_buf->bypasses[2]);
TEST_ERROR;
}
if ((f->shared->page_buf->hits[0] != 0) || (f->shared->page_buf->hits[1] != 4) ||
(f->shared->page_buf->hits[2] != 0)) {
- HDfprintf(stderr, "hits[] = {%d, %d, %d}. {0, 4, 0} expected\n", f->shared->page_buf->hits[0],
- f->shared->page_buf->hits[1], f->shared->page_buf->hits[2]);
+ HDfprintf(stderr, "hits[] = {%" PRId64 ", %" PRId64 ", %" PRId64 "}. {0, 4, 0} expected\n",
+ f->shared->page_buf->hits[0], f->shared->page_buf->hits[1], f->shared->page_buf->hits[2]);
TEST_ERROR;
}
@@ -2584,8 +2585,9 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
if ((f->shared->page_buf->misses[0] != 10) || (f->shared->page_buf->misses[1] != 16) ||
(f->shared->page_buf->misses[2] != 0)) {
- HDfprintf(stderr, "misses[] = {%d, %d, %d}. {10, 16, 0} expected\n", f->shared->page_buf->misses[0],
- f->shared->page_buf->misses[1], f->shared->page_buf->misses[2]);
+ HDfprintf(stderr, "misses[] = {%" PRId64 ", %" PRId64 ", %" PRId64 "}. {10, 16, 0} expected\n",
+ f->shared->page_buf->misses[0], f->shared->page_buf->misses[1],
+ f->shared->page_buf->misses[2]);
TEST_ERROR;
}
@@ -2593,9 +2595,9 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
if ((f->shared->page_buf->evictions[0] != 9) || (f->shared->page_buf->evictions[1] != 9) ||
(f->shared->page_buf->evictions[2] != 0)) {
- HDfprintf(stderr, "evictions[] = {%d, %d, %d}. {%d, %d, 0} expected\n",
+ HDfprintf(stderr, "evictions[] = {%" PRId64 ", %" PRId64 ", %" PRId64 "}. {7, 9, 0} expected\n",
f->shared->page_buf->evictions[0], f->shared->page_buf->evictions[1],
- f->shared->page_buf->evictions[2], 7, 9);
+ f->shared->page_buf->evictions[2]);
TEST_ERROR;
}
diff --git a/test/vfd_swmr_attrdset_writer.c b/test/vfd_swmr_attrdset_writer.c
index 3336e88..48dfe9d 100644
--- a/test/vfd_swmr_attrdset_writer.c
+++ b/test/vfd_swmr_attrdset_writer.c
@@ -1097,7 +1097,8 @@ modify_attr(const state_t *s, hid_t did, unsigned int which)
TEST_ERROR;
}
- if ((val = HDmalloc(sizeof("9999999999"))) == NULL) {
+ /* Needs to fit "%u %c", below */
+ if ((val = HDmalloc(10 + 3)) == NULL) {
HDprintf("HDmalloc failed\n");
TEST_ERROR;
}
@@ -1319,8 +1320,9 @@ verify_add_or_modify_attr(unsigned action, hid_t did, char *attr_name, unsigned
char vl_which[sizeof("attr-9999999999")];
char * read_vl_which = NULL;
bool is_vl = false;
- hid_t aid, atid;
- bool ret;
+ hid_t aid = H5I_INVALID_HID;
+ hid_t atid = H5I_INVALID_HID;
+ bool ret = FALSE;
HDassert(did != badhid);
HDassert(action == ADD_ATTR || action == MODIFY_ATTR);
@@ -1761,9 +1763,10 @@ error:
int
main(int argc, char **argv)
{
- hid_t fapl, fcpl;
+ hid_t fapl = H5I_INVALID_HID;
+ hid_t fcpl = H5I_INVALID_HID;
unsigned step;
- bool writer;
+ bool writer = FALSE;
state_t s;
const char * personality;
H5F_vfd_swmr_config_t config;
diff --git a/test/vfd_swmr_dsetops_writer.c b/test/vfd_swmr_dsetops_writer.c
index 78d540e..66d0410 100644
--- a/test/vfd_swmr_dsetops_writer.c
+++ b/test/vfd_swmr_dsetops_writer.c
@@ -1647,9 +1647,9 @@ error:
int
main(int argc, char **argv)
{
- hid_t fapl, fcpl;
- unsigned step;
- bool writer;
+ hid_t fapl = H5I_INVALID_HID;
+ hid_t fcpl = H5I_INVALID_HID;
+ bool writer = FALSE;
state_t s;
const char * personality;
H5F_vfd_swmr_config_t config;
diff --git a/test/vfd_swmr_group_writer.c b/test/vfd_swmr_group_writer.c
index fafb7c6..b43a3a5 100644
--- a/test/vfd_swmr_group_writer.c
+++ b/test/vfd_swmr_group_writer.c
@@ -24,7 +24,7 @@
#ifndef H5_HAVE_WIN32_API
#define READER_WAIT_TICKS 3
-#define VS_ATTR_NAME_LEN 21
+#define VS_ATTR_NAME_LEN 27
typedef struct {
hid_t file, filetype, one_by_one_sid;
diff --git a/test/vfd_swmr_remove_reader.c b/test/vfd_swmr_remove_reader.c
index d64dbaa..a54404f 100644
--- a/test/vfd_swmr_remove_reader.c
+++ b/test/vfd_swmr_remove_reader.c
@@ -36,7 +36,7 @@
/* Local Variables */
/*******************/
-static hid_t symbol_tid = -1;
+static hid_t symbol_tid = H5I_INVALID_HID;
/********************/
/* Local Prototypes */
@@ -78,8 +78,8 @@ static void usage(void);
static int
check_dataset(hid_t fid, hid_t dapl, unsigned verbose, const char *sym_name, symbol_t *record, hid_t rec_sid)
{
- hid_t dsid; /* Dataset ID */
- hid_t file_sid; /* Dataset's space ID */
+ hid_t dsid = H5I_INVALID_HID; /* Dataset ID */
+ hid_t file_sid = H5I_INVALID_HID; /* Dataset's space ID */
hssize_t snpoints; /* Number of elements in dataset */
hsize_t start[2] = {0, 0}, count[2] = {1, 1}; /* Hyperslab selection values */
@@ -215,13 +215,13 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, uns
time_t curr_time; /* Current time */
symbol_info_t ** sym_com = NULL; /* Pointers to array of common dataset IDs */
symbol_info_t ** sym_rand = NULL; /* Pointers to array of random dataset IDs */
- hid_t dapl;
- hid_t mem_sid; /* Memory dataspace ID */
- hid_t fid; /* SWMR test file ID */
- hid_t fapl; /* File access property list */
- symbol_t record; /* The record to add to the dataset */
- unsigned v; /* Local index variable */
- H5F_vfd_swmr_config_t *config = NULL; /* Configuration for VFD SWMR */
+ hid_t dapl = H5I_INVALID_HID;
+ hid_t mem_sid = H5I_INVALID_HID; /* Memory dataspace ID */
+ hid_t fid = H5I_INVALID_HID; /* SWMR test file ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ symbol_t record; /* The record to add to the dataset */
+ unsigned v; /* Local index variable */
+ H5F_vfd_swmr_config_t *config = NULL; /* Configuration for VFD SWMR */
HDassert(filename);
HDassert(nseconds != 0);
diff --git a/test/vfd_swmr_sparse_reader.c b/test/vfd_swmr_sparse_reader.c
index eedde79..56cf2df 100644
--- a/test/vfd_swmr_sparse_reader.c
+++ b/test/vfd_swmr_sparse_reader.c
@@ -45,7 +45,7 @@
/* Local Variables */
/*******************/
-static hid_t symbol_tid = (-1);
+static hid_t symbol_tid = H5I_INVALID_HID;
/********************/
/* Local Prototypes */
@@ -116,7 +116,9 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
/* Emit informational message */
if (verbose)
- HDfprintf(stderr, "READER: Symbol = '%s', nrecords = %Hu, name = %s, location = %Hu, %Hu\n",
+ HDfprintf(stderr,
+ "READER: Symbol = '%s', nrecords = %" PRIuHSIZE ", name = %s, location = %" PRIuHSIZE
+ ", %" PRIuHSIZE "\n",
symbol->name, symbol->nrecords, symbol->name, start[0], start[1]);
/* Read record from dataset */
@@ -128,8 +130,9 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
if (record->rec_id != start[1]) {
HDfprintf(stderr, "*** READER: ERROR ***\n");
HDfprintf(stderr, "Incorrect record value!\n");
- HDfprintf(stderr, "Symbol = '%s', location = %Hu, %Hu, record->rec_id = %" PRIu64 "\n", symbol->name,
- start[0], start[1], record->rec_id);
+ HDfprintf(stderr,
+ "Symbol = '%s', location = %" PRIuHSIZE ", %" PRIuHSIZE ", record->rec_id = %" PRIu64 "\n",
+ symbol->name, start[0], start[1], record->rec_id);
goto error;
} /* end if */