diff options
Diffstat (limited to 'c++/test')
-rw-r--r-- | c++/test/dsets.cpp | 9 | ||||
-rw-r--r-- | c++/test/th5s.cpp | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 643762b..58436f1 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -283,13 +283,13 @@ test_simple_io( H5File& file) *------------------------------------------------------------------------- */ static herr_t -test_datasize() +test_datasize(FileAccPropList &fapl) { SUBTEST("DataSet::getInMemDataSize()"); try { // Open FILE1. - H5File file(FILE1, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, FileAccPropList::DEFAULT); + H5File file(FILE1, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); // Open dataset DSET_SIMPLE_IO_NAME. DataSet dset = file.openDataSet (DSET_SIMPLE_IO_NAME); @@ -1067,9 +1067,12 @@ void test_dset() nerrors += test_multiopen (file)<0 ?1:0; nerrors += test_types(file)<0 ?1:0; + // Close group "emit diagnostics". + grp.close(); + // Close the file before testing data size. file.close(); - nerrors += test_datasize() <0 ? 1:0; + nerrors += test_datasize(fapl) <0 ? 1:0; } catch (Exception E) { diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index 7947a9b..cfdeb1f 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -188,7 +188,10 @@ static void test_h5s_basic() * If this test fails and the H5S_MAX_RANK variable has changed, follow * the instructions in space_overflow.c for regenating the th5s.h5 file. */ - const char *testfile = H5_get_srcdir_filename(TESTFILE.c_str()); + char *tmp_str = new char[TESTFILE.length()+1]; + strcpy(tmp_str, TESTFILE.c_str()); + const char *testfile = H5_get_srcdir_filename(tmp_str); + delete []tmp_str; // Create file H5File fid1(testfile, H5F_ACC_RDONLY); |