summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cache.c41
-rw-r--r--test/cache_common.c2
-rw-r--r--test/gen_bogus.c14
-rw-r--r--test/ohdr.c42
-rw-r--r--test/tbogus.h5bin1944 -> 2216 bytes
5 files changed, 63 insertions, 36 deletions
diff --git a/test/cache.c b/test/cache.c
index a98a995..38adbda 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -9499,7 +9499,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
* Modifications:
*
* Updated test for minor changes in the behaviour
- * of H5C_flush_single_entry().
+ * of H5C__flush_single_entry().
*
* JRM -- 2/16/15
*
@@ -10575,7 +10575,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
failure_mssg = "unexpected size/len in flush op eviction test 12.";
}
- /* modifications to the H5C_flush_single_entry() function have
+ /* modifications to the H5C__flush_single_entry() function have
* changed the behavior of the cache slightly, causing
* this test to fail. Comment out for now -- come back and
* fix if all goes well.
@@ -10664,7 +10664,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
failure_mssg = "unexpected size/len in flush op eviction test 13.";
}
- /* modifications to the H5C_flush_single_entry() function have
+ /* modifications to the H5C__flush_single_entry() function have
* changed the behavior of the cache slightly, causing
* this test to fail. Comment out for now -- come back and
* fix if all goes well.
@@ -14207,8 +14207,7 @@ check_resize_entry(void)
} else {
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr,
- (void *)entry_ptr, H5C__DIRTIED_FLAG);
+ entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if ( result < 0 ) {
@@ -14293,8 +14292,7 @@ check_resize_entry(void)
} else {
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr,
- (void *)entry_ptr, H5C__DIRTIED_FLAG);
+ entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if ( result < 0 ) {
@@ -14654,8 +14652,7 @@ check_resize_entry(void)
} else {
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr,
- (void *)entry_ptr, H5C__DIRTIED_FLAG);
+ entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if ( result < 0 ) {
@@ -14742,8 +14739,7 @@ check_resize_entry(void)
} else {
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr,
- (void *)entry_ptr, H5C__DIRTIED_FLAG);
+ entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if ( result < 0 ) {
@@ -16246,8 +16242,7 @@ check_double_pin_err(void)
if ( pass ) {
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[0]), entry_ptr->addr,
- (void *)entry_ptr, H5C__PIN_ENTRY_FLAG);
+ entry_ptr->addr, (void *)entry_ptr, H5C__PIN_ENTRY_FLAG);
if ( result > 0 ) {
@@ -16331,8 +16326,7 @@ check_double_unpin_err(void)
if ( pass ) {
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[0]), entry_ptr->addr,
- (void *)entry_ptr, H5C__UNPIN_ENTRY_FLAG);
+ entry_ptr->addr, (void *)entry_ptr, H5C__UNPIN_ENTRY_FLAG);
if ( result > 0 ) {
@@ -16612,8 +16606,7 @@ check_double_unprotect_err(void)
if ( pass ) {
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[0]), entry_ptr->addr,
- (void *)entry_ptr, H5C__NO_FLAGS_SET);
+ entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET);
if ( result > 0 ) {
@@ -16989,8 +16982,7 @@ check_unprotect_ro_dirty_err(void)
if ( pass ) {
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[0]), entry_ptr->addr,
- (void *)entry_ptr, H5C__DIRTIED_FLAG);
+ entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if ( result >= 0 ) {
@@ -17033,8 +17025,7 @@ check_unprotect_ro_dirty_err(void)
if ( pass ) {
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[0]), entry_ptr->addr,
- (void *)entry_ptr, H5C__DIRTIED_FLAG);
+ entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if ( result > 0 ) {
@@ -34878,8 +34869,8 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
if ( ( cache_ptr->total_ht_insertions != 33 ) ||
( cache_ptr->total_ht_deletions != 1 ) ||
- ( cache_ptr->successful_ht_searches != 65 ) ||
- ( cache_ptr->total_successful_ht_search_depth != 195 ) ||
+ ( cache_ptr->successful_ht_searches != 32 ) ||
+ ( cache_ptr->total_successful_ht_search_depth != 96 ) ||
( cache_ptr->failed_ht_searches != 33 ) ||
( cache_ptr->total_failed_ht_search_depth != 52 ) ||
( cache_ptr->max_index_len != 32 ) ||
@@ -34989,8 +34980,8 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
if ( ( cache_ptr->total_ht_insertions != 33 ) ||
( cache_ptr->total_ht_deletions != 33 ) ||
- ( cache_ptr->successful_ht_searches != 98 ) ||
- ( cache_ptr->total_successful_ht_search_depth != 198 ) ||
+ ( cache_ptr->successful_ht_searches != 33 ) ||
+ ( cache_ptr->total_successful_ht_search_depth != 99 ) ||
( cache_ptr->failed_ht_searches != 33 ) ||
( cache_ptr->total_failed_ht_search_depth != 52 ) ||
( cache_ptr->max_index_len != 32 ) ||
diff --git a/test/cache_common.c b/test/cache_common.c
index 8ccd7e3..f3da908 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -3959,7 +3959,7 @@ unprotect_entry(H5F_t * file_ptr,
entry_ptr->is_dirty = TRUE;
result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT,
- &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags);
+ entry_ptr->addr, (void *)entry_ptr, flags);
if ( ( result < 0 ) ||
( ( entry_ptr->header.is_protected ) &&
diff --git a/test/gen_bogus.c b/test/gen_bogus.c
index df1e81f..e9ce686 100644
--- a/test/gen_bogus.c
+++ b/test/gen_bogus.c
@@ -61,7 +61,7 @@ int main(void)
if((did = H5Dcreate2(fid, "/Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dclose(did) < 0) goto error;
- /* Set "fail if unknown" message flag for bogus message */
+ /* Set "fail if unknown and open for write" message flag for bogus message */
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;
@@ -69,12 +69,20 @@ int main(void)
if((did = H5Dcreate2(fid, "/Dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dclose(did) < 0) goto error;
+ /* Set "fail if unknown always" message flag for bogus message */
+ bogus_flags = H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS;
+ if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error;
+
+ /* Create third dataset, with "fail if unknown always" message flag */
+ if((did = H5Dcreate2(fid, "/Dataset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
+ if(H5Dclose(did) < 0) goto error;
+
/* Set "mark if unknown" message flag for bogus message */
bogus_flags = H5O_MSG_FLAG_MARK_IF_UNKNOWN;
if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error;
- /* Create second dataset, with "mark if unknown" message flag */
- if((did = H5Dcreate2(fid, "/Dataset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
+ /* Create fourth dataset, with "mark if unknown" message flag */
+ if((did = H5Dcreate2(fid, "/Dataset4", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dclose(did) < 0) goto error;
/* Close dataset creation property list */
diff --git a/test/ohdr.c b/test/ohdr.c
index 1ba2b10..45f2238 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -665,7 +665,9 @@ main(void)
PASSED();
- /* Test reading datasets with undefined object header messages */
+ /* Test reading datasets with undefined object header messages
+ * and the various "fail/mark if unknown" object header message flags
+ */
HDputs("Accessing objects with unknown header messages:");
{
hid_t file2; /* File ID for 'bogus' object file */
@@ -687,7 +689,7 @@ main(void)
PASSED();
- TESTING("object with unknown header message & 'fail if unknown and open for write' flag set");
+ 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 */
if((dset = H5Dopen2(file2, "/Dataset2", H5P_DEFAULT)) < 0)
@@ -697,10 +699,23 @@ main(void)
PASSED();
+ TESTING("object in r/o file with unknown header message & 'fail if unknown always' flag set");
+
+ /* Attempt to open the dataset with the unknown header message, and "fail if unknown always" flag */
+ H5E_BEGIN_TRY {
+ dset = H5Dopen2(file2, "/Dataset3", H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(dset >= 0) {
+ H5Dclose(dset);
+ TEST_ERROR
+ } /* end if */
+
+ PASSED();
+
TESTING("object with unknown header message & 'mark if unknown' flag set");
/* Copy object with "mark if unknown" flag on message into file that can be modified */
- if(H5Ocopy(file2, "/Dataset3", file, "/Dataset3", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if(H5Ocopy(file2, "/Dataset4", file, "/Dataset4", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
/* Close the file we created (to flush changes to file) */
@@ -712,7 +727,7 @@ main(void)
TEST_ERROR
/* Open the dataset with the "mark if unknown" message */
- if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0)
+ if((dset = H5Dopen2(file, "/Dataset4", H5P_DEFAULT)) < 0)
TEST_ERROR
/* Check that the "unknown" message was _NOT_ marked */
@@ -732,7 +747,7 @@ main(void)
TEST_ERROR
/* Open the dataset with the "mark if unknown" message */
- if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0)
+ if((dset = H5Dopen2(file, "/Dataset4", H5P_DEFAULT)) < 0)
TEST_ERROR
/* Create data space */
@@ -764,7 +779,7 @@ main(void)
TEST_ERROR
/* Re-open the dataset with the "mark if unknown" message */
- if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0)
+ if((dset = H5Dopen2(file, "/Dataset4", H5P_DEFAULT)) < 0)
TEST_ERROR
/* Check that the "unknown" message was marked */
@@ -785,7 +800,7 @@ main(void)
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");
+ TESTING("object in r/w file 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 {
@@ -796,6 +811,19 @@ main(void)
TEST_ERROR
} /* end if */
+ PASSED();
+
+ TESTING("object in r/w file with unknown header message & 'fail if unknown always' flag set");
+
+ /* Attempt to open the dataset with the unknown header message, and "fail if unknown always" flag */
+ H5E_BEGIN_TRY {
+ dset = H5Dopen2(file2, "/Dataset3", 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)
TEST_ERROR
diff --git a/test/tbogus.h5 b/test/tbogus.h5
index 906921c..875fbd8 100644
--- a/test/tbogus.h5
+++ b/test/tbogus.h5
Binary files differ