diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2019-01-07 21:20:11 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2019-03-15 16:48:06 (GMT) |
commit | 0ab95e0c814ab975ccaafd6ef25dbdde13b00f11 (patch) | |
tree | a6a97478164569d6316c31374c8b7f6be8cc4399 /test | |
parent | 79f9b443dae87482326bb9a37a1a8070c1f8669d (diff) | |
download | hdf5-0ab95e0c814ab975ccaafd6ef25dbdde13b00f11.zip hdf5-0ab95e0c814ab975ccaafd6ef25dbdde13b00f11.tar.gz hdf5-0ab95e0c814ab975ccaafd6ef25dbdde13b00f11.tar.bz2 |
Delay checking if decoded message's "shareable" flag is appropriate for
the message type until we've verified we understand the message type.
Reduce size of H5O_msg_class_g to *not* include space for
H5O_BOGUS_INVALID. Make bogus messages shareable. Add new bogus
message test with shareable messages to cover the formerly problematic
code. Re-run gen_bogus.c to add this test case and also to fix the
bogus_invalid messages that were no longer H5O_BOGUS_INVLAID due to a
new message class being added in a previous commit. Added comment to
remind developers to run gen_bogus.c when adding a new message class.
Diffstat (limited to 'test')
-rw-r--r-- | test/gen_bogus.c | 8 | ||||
-rw-r--r-- | test/ohdr.c | 10 | ||||
-rw-r--r-- | test/tbogus.h5 | bin | 3792 -> 4512 bytes |
3 files changed, 18 insertions, 0 deletions
diff --git a/test/gen_bogus.c b/test/gen_bogus.c index 9d6b518..ac272ef 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -84,6 +84,14 @@ generate_datasets(hid_t loc_id, unsigned bogus_id) if((did = H5Dcreate2(loc_id, "Dataset4", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; + /* Set "shareable" message flag for bogus message */ + bogus_flags = H5O_MSG_FLAG_SHAREABLE; + if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error; + + /* Create fourth dataset, with "shareable" message flag */ + if((did = H5Dcreate2(loc_id, "Dataset5", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + if(H5Dclose(did) < 0) goto error; + /* Close dataset creation property list */ if(H5Pclose(dcpl) < 0) goto error; diff --git a/test/ohdr.c b/test/ohdr.c index 5b000f2..9c43774 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -359,6 +359,16 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) PASSED(); + TESTING("object with unknown header message & 'shareable' flag set"); + + /* Open the dataset with the unknown header message, adn "shareable" flag */ + if((did = H5Dopen2(loc_bogus, "Dataset5", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + PASSED(); + TESTING("object in r/o file with unknown header message & 'fail if unknown and open for write' flag set"); /* Open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ diff --git a/test/tbogus.h5 b/test/tbogus.h5 Binary files differindex 87b183b..f931935 100644 --- a/test/tbogus.h5 +++ b/test/tbogus.h5 |