summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2011-10-14 14:36:03 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2011-10-14 14:36:03 (GMT)
commit1c0f834918c3b0308872aa65f3f99f16fd1f8cce (patch)
treeb1237a70f63fac51209311cfbf7405c695121082
parent9fa5dca9c2ebc2c3cb25ded77d37b9c666e11fbd (diff)
downloadhdf5-1c0f834918c3b0308872aa65f3f99f16fd1f8cce.zip
hdf5-1c0f834918c3b0308872aa65f3f99f16fd1f8cce.tar.gz
hdf5-1c0f834918c3b0308872aa65f3f99f16fd1f8cce.tar.bz2
[svn-r21562] Improve testing for H5Pset_libver_bounds
Tested: durandal (too minor for full h5committest)
-rw-r--r--test/tfile.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/test/tfile.c b/test/tfile.c
index 0b6099c..c7bb170 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -3067,6 +3067,7 @@ test_libver_bounds(void)
{
hid_t file, group; /* Handles */
hid_t fapl; /* File access property list */
+ H5O_info_t oinfo; /* Object info */
herr_t ret; /* Return value */
/* Output message about test being performed */
@@ -3084,6 +3085,16 @@ test_libver_bounds(void)
file = H5Fcreate("tfile5.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(file, FAIL, "H5Fcreate");
+ /*
+ * Make sure the root group has the latest object header version (2)
+ */
+ ret = H5Oget_info_by_name(file, "/", &oinfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(oinfo.hdr.version, 2, "H5Oget_info_by_name");
+
+ /*
+ * Reopen the file and make sure the root group still has the latest version
+ */
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
@@ -3093,24 +3104,45 @@ test_libver_bounds(void)
file = H5Fopen("tfile5.h5", H5F_ACC_RDWR, fapl);
CHECK(file, FAIL, "H5Fopen");
+ ret = H5Oget_info_by_name(file, "/", &oinfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(oinfo.hdr.version, 2, "H5Oget_info_by_name");
+
/*
- * Create a group named "G1" in the file.
+ * Create a group named "G1" in the file, and make sure it has the earliest
+ * object header version (1)
*/
group = H5Gcreate2(file, "/G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group, FAIL, "H5Gcreate");
+ ret = H5Oget_info(group, &oinfo);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(oinfo.hdr.version, 1, "H5Oget_info_by_name");
+
ret = H5Gclose(group);
CHECK(ret, FAIL, "H5Gclose");
/*
- * Create a group named "/G1/G3" in the file.
+ * Create a group named "/G1/G3" in the file, and make sure it has the
+ * earliest object header version (1)
*/
group = H5Gcreate2(file, "/G1/G3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group, FAIL, "H5Gcreate");
+ ret = H5Oget_info(group, &oinfo);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(oinfo.hdr.version, 1, "H5Oget_info_by_name");
+
ret = H5Gclose(group);
CHECK(ret, FAIL, "H5Gclose");
+ /*
+ * Make sure the root group still has the latest object header version (2)
+ */
+ ret = H5Oget_info_by_name(file, "/", &oinfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(oinfo.hdr.version, 2, "H5Oget_info_by_name");
+
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
} /* test_libver_bounds() */