summaryrefslogtreecommitdiffstats
path: root/c++/test/tfile.cpp
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2018-06-07 16:30:08 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2018-06-07 16:30:08 (GMT)
commit551f15f8ae02ca9c995619b216121081eb07633e (patch)
tree995de8be59b4d8524753eba6b542ce4039d54c79 /c++/test/tfile.cpp
parentb8c6b68c35fa2be23ef488a1d81097ff3ed55000 (diff)
parent664186b91d9198915baca4c6dca3f7b03695d316 (diff)
downloadhdf5-hdf5-1_8_21.zip
hdf5-hdf5-1_8_21.tar.gz
hdf5-hdf5-1_8_21.tar.bz2
Merge pull request #1106 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:1.8/master to 1.8/masterhdf5-1_8_21
* commit '664186b91d9198915baca4c6dca3f7b03695d316': (124 commits) Commit HDF5 1.8.21 release version strings. Update INSTALL and INSTALL_parallel files to remove references to ancient systems and add generic steps for building HDF5 on HPC clusters. Update various INSTALL files for 1.8.21 release. Add missing space and correct typo. Modified a section for newly supported systems and compilers (vs. 1.8.20 release); Brought edits for tools bug fixes from 1.10.2 RELEASE.txt as we agreed with Allen. It is my test under Larry's guidance. Remove build directory which was unintentionally committed. Updated MANIFEST Switch default build mode to production. Update version to 1.8.21 in anticipation of release. Fixed EED-319 Description: Added an html version for the C++ function mapping table and removed the single web page version. Updated cpp_doc_config to use the html file. Fixed some typos. Running "doxygen cpp_doc_config" successfully. HDFFV-10473 fix HDFFV-10398 attribute location Add missing C++ entries to RELEASE.txt. pre1 release. Add missing RELEASE.txt entries for C++. Update Windows test machines Fix soversion naming and update cmake scripts Update version in RELEASE.txt. Correct merge errors from hdf5_1_8. Fixed typos Fixed typos Fixed typos ...
Diffstat (limited to 'c++/test/tfile.cpp')
-rw-r--r--c++/test/tfile.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index 059c548..d5278d5 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -336,9 +336,12 @@ static void test_file_open()
// Truncating should succeed now.
H5File file3(FILE2, H5F_ACC_TRUNC);
- // Opening another file to file3 object, FILE2 should be closed, so
- // the next attempt to truncate FILE2 should succeed.
+ // Opening another file to file3 object.
file3.openFile(FILE1, H5F_ACC_RDONLY);
+
+ // In the previous statement, openFile closes FILE2 first before
+ // opening FILE1, so when H5File constructs file4 with an
+ // attempt to truncate FILE2, it should succeed.
H5File file4(FILE2, H5F_ACC_TRUNC);
PASSED();
@@ -493,6 +496,12 @@ static void test_file_name()
// Get and verify file name via a committed datatype.
comp_type.getFileName();
verify_val(file_name, FILE4, "CompType::getFileName", __LINE__, __FILE__);
+
+ // Get the file's version information.
+ H5F_info_t finfo;
+ file4.getFileInfo(finfo);
+ verify_val(finfo.sohm.hdr_size, 0, "H5File::getFileInfo", __LINE__, __FILE__);
+
PASSED();
} // end of try block
@@ -503,6 +512,15 @@ static void test_file_name()
} // test_file_name()
+/*-------------------------------------------------------------------------
+ *
+ * Function: test_file_attribute
+ *
+ * Purpose Test file attributes
+ *
+ * Return None
+ *-------------------------------------------------------------------------
+ */
const int RANK1 = 1;
const int ATTR1_DIM1 = 3;
const H5std_string FILE5("tfattrs.h5");
@@ -619,6 +637,11 @@ static void test_file_attribute()
PASSED();
} // end of try block
+ // Catch creating existing attribute
+ catch (AttributeIException& E)
+ {} // do nothing, exception expected
+
+ // Catch all other exceptions
catch (Exception& E)
{
issue_fail_msg("test_file_attribute()", __LINE__, __FILE__, E.getCDetailMsg());