summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2015-01-20 19:35:34 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2015-01-20 19:35:34 (GMT)
commite8e06cbca06eba0ff1107caf7f4cbeb1f0f835c6 (patch)
tree927badc2a275f9ad3372d113d6947bb98f856f3c /test
parent2f81d73829702380f8e5baef130da4d297655d1a (diff)
downloadhdf5-e8e06cbca06eba0ff1107caf7f4cbeb1f0f835c6.zip
hdf5-e8e06cbca06eba0ff1107caf7f4cbeb1f0f835c6.tar.gz
hdf5-e8e06cbca06eba0ff1107caf7f4cbeb1f0f835c6.tar.bz2
[svn-r25985] merge 25984 from trunk:
change the message flag H5O_MSG_FLAG_FAIL_IF_UNKNOWN to H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE. New changes for backward compatibility with avoid_truncate feature in 1.10 will come later to utilize the flag. tested h5committest
Diffstat (limited to 'test')
-rw-r--r--test/gen_bogus.c2
-rw-r--r--test/ohdr.c33
-rw-r--r--test/tbogus.h5bin1944 -> 1944 bytes
3 files changed, 26 insertions, 9 deletions
diff --git a/test/gen_bogus.c b/test/gen_bogus.c
index 7d8d073..df1e81f 100644
--- a/test/gen_bogus.c
+++ b/test/gen_bogus.c
@@ -62,7 +62,7 @@ int main(void)
if(H5Dclose(did) < 0) goto error;
/* Set "fail if unknown" message flag for bogus message */
- bogus_flags = H5O_MSG_FLAG_FAIL_IF_UNKNOWN;
+ bogus_flags = H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE;
if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error;
/* Create second dataset, with "fail if unknown" message flag */
diff --git a/test/ohdr.c b/test/ohdr.c
index 1151101..1b324a9 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -686,16 +686,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();
@@ -777,6 +774,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)
diff --git a/test/tbogus.h5 b/test/tbogus.h5
index 2b8b1dd..5b1d85e 100644
--- a/test/tbogus.h5
+++ b/test/tbogus.h5
Binary files differ