summaryrefslogtreecommitdiffstats
path: root/test/cache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2017-01-05 05:36:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2017-01-05 05:36:14 (GMT)
commitafd7e5b476d65960d0e309f35fa2df3235731564 (patch)
treef92049d856d85402a334c00df4c98b12accf7a41 /test/cache.c
parent6232dd6d62e5a58a6185b9502b6d8719cf0ce676 (diff)
downloadhdf5-afd7e5b476d65960d0e309f35fa2df3235731564.zip
hdf5-afd7e5b476d65960d0e309f35fa2df3235731564.tar.gz
hdf5-afd7e5b476d65960d0e309f35fa2df3235731564.tar.bz2
Bring file shutdown code from cache image branch
Diffstat (limited to 'test/cache.c')
-rw-r--r--test/cache.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/cache.c b/test/cache.c
index ed4fceb..8f4935b 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -15912,6 +15912,11 @@ check_destroy_pinned_err(void)
protect_entry(file_ptr, 0, 0);
unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
+ if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) {
+ pass = FALSE;
+ failure_mssg = "unexpected failure of prep for file close.\n";
+ } /* end if */
+
if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) >= 0) {
pass = FALSE;
failure_mssg = "destroy succeeded on cache with pinned entry.\n";
@@ -15987,6 +15992,20 @@ check_destroy_protected_err(void)
file_ptr = setup_cache((size_t)(2 * 1024),
(size_t)(1 * 1024));
+ /* Note: normally this call would go just before the series of
+ * flushes prior to file close -- in particular, all entries
+ * should be unprotected when this call is made.
+ *
+ * Thus H5C_prep_for_file_close() contains an assert to verify
+ * this. Since this assert would be triggered by the condition
+ * we are trying to test, put the call to H5C_prep_for_file_close()
+ * prior to the final protect call.
+ */
+ if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) {
+ pass = FALSE;
+ failure_mssg = "unexpected failure of prep for file close.\n";
+ } /* end if */
+
protect_entry(file_ptr, 0, 0);
if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) >= 0) {