From 3deef67a5ea04eed8b4048adb109499537863bd3 Mon Sep 17 00:00:00 2001 From: Hyo-Kyung Lee Date: Wed, 20 Sep 2023 11:02:11 -0500 Subject: [PATCH 1/2] Check return values from HDF5 API calls. --- testpar/t_init_term.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/testpar/t_init_term.c b/testpar/t_init_term.c index 929bb59890d..3a922462739 100644 --- a/testpar/t_init_term.c +++ b/testpar/t_init_term.c @@ -37,11 +37,11 @@ main(int argc, char **argv) MPI_Finalize(); - nerrors += GetTestNumErrs(); - /* test if we can initialize the library with MPI being finalized and create a file serially */ - H5open(); + if (H5open() < 0) { + nerrors = nerrors + 1; + } if (mpi_rank == 0) { char filename[1024]; @@ -54,7 +54,9 @@ main(int argc, char **argv) file_id = -1; } - H5close(); + if (H5close() < 0) { + nerrors = nerrors + 1; + } if (MAINPROCESS) { if (0 == nerrors) From 41c56bdb26c15f12ce3e165312d57f500767725f Mon Sep 17 00:00:00 2001 From: Hyo-Kyung Lee Date: Wed, 20 Sep 2023 14:07:38 -0500 Subject: [PATCH 2/2] Address @jhendersonHDF review --- testpar/t_init_term.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/testpar/t_init_term.c b/testpar/t_init_term.c index 3a922462739..0268e3d9eca 100644 --- a/testpar/t_init_term.c +++ b/testpar/t_init_term.c @@ -39,9 +39,7 @@ main(int argc, char **argv) /* test if we can initialize the library with MPI being finalized and create a file serially */ - if (H5open() < 0) { - nerrors = nerrors + 1; - } + VRFY((H5open() >= 0), "H5open succeeded"); if (mpi_rank == 0) { char filename[1024]; @@ -54,9 +52,7 @@ main(int argc, char **argv) file_id = -1; } - if (H5close() < 0) { - nerrors = nerrors + 1; - } + VRFY((H5close() >= 0), "H5close succeeded"); if (MAINPROCESS) { if (0 == nerrors)