diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-01-26 16:29:48 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-01-26 16:29:48 (GMT) |
commit | 147fa90afae2c3a19501e35dfeb15101bf964b60 (patch) | |
tree | 7b2f60a24266cd16e6d2655fb2759c46f20a7812 /test/ohdr.c | |
parent | acabad61facccea62d5d12c76ccb09d107e9062c (diff) | |
parent | f4e69ad57949288e845b22650db0968772269ff2 (diff) | |
download | hdf5-147fa90afae2c3a19501e35dfeb15101bf964b60.zip hdf5-147fa90afae2c3a19501e35dfeb15101bf964b60.tar.gz hdf5-147fa90afae2c3a19501e35dfeb15101bf964b60.tar.bz2 |
[svn-r26033] merge from trunk.
Diffstat (limited to 'test/ohdr.c')
-rw-r--r-- | test/ohdr.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/test/ohdr.c b/test/ohdr.c index 0e29e71..67548e0 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) |