summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-05-05 16:18:53 (GMT)
committerGitHub <noreply@github.com>2022-05-05 16:18:53 (GMT)
commitb4ffea501170767686309c5b2ca209446dde6199 (patch)
treeab2ae3c85638283475dd9a9129b2681b6103dfb3 /testpar
parenta1b8141e26fd2e98ebc5311ce2153bdf297c494b (diff)
downloadhdf5-b4ffea501170767686309c5b2ca209446dde6199.zip
hdf5-b4ffea501170767686309c5b2ca209446dde6199.tar.gz
hdf5-b4ffea501170767686309c5b2ca209446dde6199.tar.bz2
Fixes a bug where t_cache fails due to a string size being too small (#1720) (#1728)
* Fixes a bug where t_cache fails due to a string size being too small Recent warning reductions led to an incorrect string size being passed to h5_fileaccess, causing the test to silently fail. In addition to fixing the bug, the test will now fail noisily on setup failures. * Updates the t_cache test to fail noisily on setup errors Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_cache.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 216028a..cf2415c 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -1116,6 +1116,8 @@ setup_derived_types(void)
MPI_Aint displs[9];
struct mssg_t sample; /* used to compute displacements */
+ HDmemset(&sample, 0, sizeof(struct mssg_t));
+
/* setup the displacements array */
if ((MPI_SUCCESS != MPI_Get_address(&sample.req, &displs[0])) ||
(MPI_SUCCESS != MPI_Get_address(&sample.src, &displs[1])) ||
@@ -6966,7 +6968,7 @@ main(int argc, char **argv)
/* fix the file names */
for (u = 0; u < sizeof(FILENAME) / sizeof(FILENAME[0]) - 1; ++u) {
- if (h5_fixname(FILENAME[u], fapl, filenames[u], sizeof(filenames[u])) == NULL) {
+ if (h5_fixname(FILENAME[u], fapl, filenames[u], PATH_MAX) == NULL) {
nerrors++;
if (verbose)
HDfprintf(stdout, "%d:%s: h5_fixname() failed.\n", world_mpi_rank, FUNC);
@@ -7065,8 +7067,8 @@ finish:
MPI_Barrier(MPI_COMM_WORLD);
if (MAINPROCESS) { /* only process 0 reports */
HDprintf("===================================\n");
- if (failures) {
- HDprintf("***metadata cache tests detected %d failures***\n", failures);
+ if (nerrors || failures) {
+ HDprintf("***metadata cache tests detected %d failures***\n", nerrors + failures);
}
else {
HDprintf("metadata cache tests finished with no failures\n");
@@ -7083,5 +7085,5 @@ finish:
MPI_Finalize();
/* cannot just return (failures) because exit code is limited to 1byte */
- return (failures != 0);
+ return (nerrors != 0 || failures != 0);
}