summaryrefslogtreecommitdiffstats
path: root/test/ohdr.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2015-01-20 17:17:05 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2015-01-20 17:17:05 (GMT)
commitaac2bb6182878e3591de390173e769bb761c83e2 (patch)
tree9e8d1da6fbb8016a4e01c2997673447fe8ca4157 /test/ohdr.c
parent1949c40bfddf4bea44345e0cd00baae94597f23a (diff)
downloadhdf5-aac2bb6182878e3591de390173e769bb761c83e2.zip
hdf5-aac2bb6182878e3591de390173e769bb761c83e2.tar.gz
hdf5-aac2bb6182878e3591de390173e769bb761c83e2.tar.bz2
[svn-r25984] change the message flag H5O_MSG_FLAG_FAIL_IF_UNKNOWN to
H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE. Will add a new H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS with the new avoid_truncate patch coming later. tested h5committest
Diffstat (limited to 'test/ohdr.c')
-rw-r--r--test/ohdr.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/test/ohdr.c b/test/ohdr.c
index 502a8b1..0ed3d97 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -687,16 +687,13 @@ main(void)
PASSED();
- TESTING("object with unknown header message & 'fail if unknown' flag set");
+ TESTING("object with unknown header message & 'fail if unknown and open for write' flag set");
- /* Attempt to open the dataset with the unknown header message, and "fail if unknown" flag */
- H5E_BEGIN_TRY {
- dset = H5Dopen2(file2, "/Dataset2", H5P_DEFAULT);
- } H5E_END_TRY;
- if(dset >= 0) {
- H5Dclose(dset);
+ /* Open the dataset with the unknown header message, and "fail if unknown and open for write" flag */
+ if((dset = H5Dopen2(file2, "/Dataset2", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if(H5Dclose(dset) < 0)
TEST_ERROR
- } /* end if */
PASSED();
@@ -778,6 +775,26 @@ main(void)
if(H5Dclose(dset) < 0)
TEST_ERROR
+ /* Close the file with the bogus objects */
+ if(H5Fclose(file2) < 0)
+ TEST_ERROR
+
+ PASSED();
+
+ /* Open the file with objects that have unknown header messages (generated with gen_bogus.c) with RW intent this time */
+ if((file2 = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ TESTING("object with unknown header message & 'fail if unknown and open for write' flag set");
+
+ /* Attempt to open the dataset with the unknown header message, and "fail if unknown and open for write" flag */
+ H5E_BEGIN_TRY {
+ dset = H5Dopen2(file2, "/Dataset2", H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(dset >= 0) {
+ H5Dclose(dset);
+ TEST_ERROR
+ } /* end if */
/* Close the file with the bogus objects */
if(H5Fclose(file2) < 0)