diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2013-07-27 07:07:38 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2013-07-27 07:07:38 (GMT) |
commit | 268f4fd05c27d8bc9f9336ae62b444c0098a84e5 (patch) | |
tree | 23943c17b8fa89eea4debda7e2acb5ea708d2b8c /c++/test | |
parent | e8d9f3d1979ff5f9bc6ce4f2c4d3568f958e12d2 (diff) | |
download | hdf5-268f4fd05c27d8bc9f9336ae62b444c0098a84e5.zip hdf5-268f4fd05c27d8bc9f9336ae62b444c0098a84e5.tar.gz hdf5-268f4fd05c27d8bc9f9336ae62b444c0098a84e5.tar.bz2 |
[svn-r23940] Purpose: Fix bug in tests
Description:
- Passing the c_str() of an std string into a C function caused failure
on OpenVMS. Added a work around using temporary string.
- Passing incorrect file access property list caused test_datasize() to
fail. Fixed.
Platforms tested:
Linux/32 2.6 (jam) with PGI compilers
Linux/32 2.6 (jam) with GNU compilers
SunOS 5.11 (emu)
Diffstat (limited to 'c++/test')
-rw-r--r-- | c++/test/dsets.cpp | 11 | ||||
-rw-r--r-- | c++/test/th5s.cpp | 5 |
2 files changed, 7 insertions, 9 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 744118f..a24f5f1 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -61,7 +61,6 @@ const int H5Z_FILTER_BOGUS = 305; static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); - /*------------------------------------------------------------------------- * Function: test_create * @@ -284,14 +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); @@ -333,7 +331,6 @@ test_datasize() } } // test_datasize - /*------------------------------------------------------------------------- * Function: test_tconv * @@ -456,7 +453,6 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, return nbytes; } - /*------------------------------------------------------------------------- * Function: test_compression * @@ -826,7 +822,6 @@ test_multiopen (H5File& file) } } // test_multiopen - /*------------------------------------------------------------------------- * Function: test_types * @@ -1074,7 +1069,7 @@ void test_dset() // 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..4c1540e 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()]; + 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); |