From c230ffa26873f256092d68de854de5c7f09bf1ee Mon Sep 17 00:00:00 2001 From: "Richard.Warren" Date: Tue, 17 Oct 2017 15:23:54 -0500 Subject: Make fixes to avoid test failures in 'production' mode builds --- testpar/t_pread.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/testpar/t_pread.c b/testpar/t_pread.c index 7f23b9b..b2eec97 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -99,11 +99,11 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) FILE *header = NULL; const char *fcn_name = "generate_test_file()"; const char *failure_mssg = NULL; - const char *group_filename = NULL; + char *group_filename = NULL; char data_filename[FILENAME_BUF_SIZE]; char reloc_data_filename[FILENAME_BUF_SIZE]; char prolog_filename[FILENAME_BUF_SIZE]; - int file_index; + int file_index = 0; int group_size; int group_rank; int local_failure = 0; @@ -162,10 +162,11 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) * is used to call into the h5_fixname function. No * need to worry that we reassign it for each file! */ - HDassert((group_filename = FILENAMES[file_index])); + group_filename = FILENAMES[file_index]; + HDassert( group_filename ); /* Assign the 'data_filename' */ - if ( h5_fixname(group_filename, H5P_DEFAULT, data_filename, + if ( h5_fixname((const char *)group_filename, H5P_DEFAULT, data_filename, sizeof(data_filename)) == NULL ) { pass = FALSE; failure_mssg = "h5_fixname(0) failed.\n"; @@ -174,7 +175,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) if ( pass ) { - HDassert( (group_filename = FILENAMES[file_index+1]) ); + group_filename = FILENAMES[file_index+1]; + HDassert( group_filename ); /* Assign the 'reloc_data_filename' */ if ( h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, @@ -186,8 +188,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } if ( pass ) { - - HDassert( (group_filename = FILENAMES[file_index+2]) ); + group_filename = FILENAMES[file_index+2]; + HDassert( group_filename ); /* Assign the 'prolog_filename' */ if ( h5_fixname(group_filename, H5P_DEFAULT, prolog_filename, -- cgit v0.12 From 9aada2bdb51f1c235e483f2bce109262bfbe22fa Mon Sep 17 00:00:00 2001 From: "Richard.Warren" Date: Tue, 17 Oct 2017 15:34:36 -0500 Subject: in 'production' mode builds --- testpar/t_pread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpar/t_pread.c b/testpar/t_pread.c index b2eec97..b5a84f2 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -162,11 +162,11 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) * is used to call into the h5_fixname function. No * need to worry that we reassign it for each file! */ - group_filename = FILENAMES[file_index]; + group_filename = FILENAMES[file_index]; HDassert( group_filename ); /* Assign the 'data_filename' */ - if ( h5_fixname((const char *)group_filename, H5P_DEFAULT, data_filename, + if ( h5_fixname(group_filename, H5P_DEFAULT, data_filename, sizeof(data_filename)) == NULL ) { pass = FALSE; failure_mssg = "h5_fixname(0) failed.\n"; -- cgit v0.12