diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-06 14:19:28 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-06 14:19:28 (GMT) |
commit | b95c7d1879120c542490c031c70b88f6e5fa7eaa (patch) | |
tree | a5f2c84b23c43eb342220d811d2b9d4f69fb738b /test | |
parent | 2c38d7ea30aa8829eb7790f7aa25b16dee93fb8f (diff) | |
download | hdf5-b95c7d1879120c542490c031c70b88f6e5fa7eaa.zip hdf5-b95c7d1879120c542490c031c70b88f6e5fa7eaa.tar.gz hdf5-b95c7d1879120c542490c031c70b88f6e5fa7eaa.tar.bz2 |
[svn-r18722] Description:
Bring r18721 from trunk to 1.8 branch:
Bring r18720 from metadata journaling merging branch to trunk:
Bring changes from metadata journaling branch to 'merging' branch:
Rename H5[A]C_mark_pinned_or_protected_entry_dirty() to
H5[A]C_mark_entry_dirty() and get rid of H5[A]C_mark_pinned_entry_dirty().
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
(h5committested on trunk)
Diffstat (limited to 'test')
-rw-r--r-- | test/cache.c | 83 | ||||
-rw-r--r-- | test/cache_common.c | 136 | ||||
-rw-r--r-- | test/cache_common.h | 13 |
3 files changed, 35 insertions, 197 deletions
diff --git a/test/cache.c b/test/cache.c index 0c44a6b..cf565c5 100644 --- a/test/cache.c +++ b/test/cache.c @@ -10936,8 +10936,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * JRM -- 5/17/06 * Complete reqrite of pinned entry tests to accomodate - * the new H5C_mark_pinned_or_protected_entry_dirty() - * call. + * the new H5C_mark_entry_dirty() call. * *------------------------------------------------------------------------- */ @@ -12737,13 +12736,12 @@ check_flush_cache__single_entry(H5F_t * file_ptr) * * 2) Marked dirty by unprotect or not. * - * 3) Marked dirty by call to H5C_mark_pinned_entry_dirty() or not. + * 3) Marked dirty by call to H5C_mark_entry_dirty() or not. * - * 4) Marked dirty by call to H5C_mark_pinned_or_protected_entry_dirty() - * while protected or not. + * 4) Marked dirty by call to H5C_mark_entry_dirty() while protected + * or not. * - * 5) Marked dirty by call to H5C_mark_pinned_or_protected_entry_dirty() - * while pinned or not. + * 5) Marked dirty by call to H5C_mark_entry_dirty() while pinned or not. * * 6) Entry marked for flush or not. * @@ -13301,7 +13299,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, * JRM -- 5/17/06 * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned * flags and supporting code to allow us to test the - * H5C_mark_pinned_or_protected_entry_dirty() call. Use the + * H5C_mark_entry_dirty() call. Use the * call to mark the entry dirty while the entry is protected * if pop_mark_dirty_prot is TRUE, and to mark the entry * dirty while it is pinned if pop_mark_dirty_pinned is TRUE. @@ -13369,8 +13367,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( pop_mark_dirty_prot ) { - mark_pinned_or_protected_entry_dirty(entry_type, - entry_idx); + mark_entry_dirty(entry_type, entry_idx); } unprotect_entry(file_ptr, entry_type, entry_idx, @@ -13378,13 +13375,12 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( mark_dirty ) { - mark_pinned_entry_dirty(entry_type, entry_idx, FALSE, (size_t)0); + mark_entry_dirty(entry_type, entry_idx); } if ( pop_mark_dirty_pinned ) { - mark_pinned_or_protected_entry_dirty(entry_type, - entry_idx); + mark_entry_dirty(entry_type, entry_idx); } } @@ -13663,7 +13659,7 @@ check_get_entry_status(void) if ( pass ) { - mark_pinned_entry_dirty(0, 0, FALSE, (size_t)0); + mark_entry_dirty(0, 0); } @@ -17428,13 +17424,7 @@ check_double_unprotect_err(void) * * Purpose: Verify that: * - * 1) a call to H5C_mark_pinned_entry_dirty with an upinned - * entry as the target will generate an error. - * - * 2) a call to H5C_mark_pinned_entry_dirty with a protected - * entry as the target will generate an error. - * - * 3) a call to H5C_mark_pinned_or_protected_entry_dirty with + * 1) a call to H5C_mark_entry_dirty with * and unpinned and unprotected entry will generate an * error. * @@ -17443,10 +17433,6 @@ check_double_unprotect_err(void) * Programmer: John Mainzer * 5/17/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -17462,14 +17448,8 @@ check_mark_entry_dirty_errs(void) pass = TRUE; - /* allocate a cache, protect an entry, and then attempt to mark it dirty - * with the H5C_mark_pinned_entry_dirty() call -- This should fail. - * - * Then unprotect the entry without pinning it, and try to mark it dirty - * again -- this should fail too. - * - * Try it again using H5C_mark_pinned_or_protected_entry_dirty -- this - * should fail as well. + /* allocate a cache, protect an entry, unprotect the entry without + * pinning it, and try to mark it dirty -- this should fail. * * Destroy the cache -- should succeed. */ @@ -17483,52 +17463,21 @@ check_mark_entry_dirty_errs(void) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG); - - protect_entry(file_ptr, 0, 0); + unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); entry_ptr = &((entries[0])[0]); } if ( pass ) { - result = H5C_mark_pinned_entry_dirty((void *)entry_ptr, FALSE, (size_t)0); - - if ( result > 0 ) { - - pass = FALSE; - failure_mssg = - "attempt dirty a pinned and protected entry succeeded.\n"; - - } else { - - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG); - } - } - - if ( pass ) { - - result = H5C_mark_pinned_entry_dirty((void *)entry_ptr, FALSE, (size_t)0); - - - if ( result > 0 ) { - - pass = FALSE; - failure_mssg = - "attempt to dirty a unpinned and unprotected entry succeeded 1.\n"; - } - } - - if ( pass ) { - - result = H5C_mark_pinned_or_protected_entry_dirty((void *)entry_ptr); + result = H5C_mark_entry_dirty((void *)entry_ptr); if ( result > 0 ) { pass = FALSE; failure_mssg = - "attempt to dirty a unpinned and unprotected entry succeeded 2.\n"; + "attempt to dirty a unpinned and unprotected entry succeeded.\n"; } } diff --git a/test/cache_common.c b/test/cache_common.c index 8a5503c..090e102 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1314,7 +1314,7 @@ create_pinned_entry_dependency(H5F_t * file_ptr, * If the dirty_pin parameter is true, verify that the * target entry is in the cache and is pinned. If it * isn't, scream and die. If it is, use the - * H5C_mark_pinned_entry_dirty() call to dirty it. + * H5C_mark_entry_dirty() call to dirty it. * * Do nothing if pass is false on entry. * @@ -1367,7 +1367,7 @@ dirty_entry(H5F_t * file_ptr, } else { - mark_pinned_entry_dirty(type, idx, FALSE, (size_t)0); + mark_entry_dirty(type, idx); } } @@ -1683,7 +1683,7 @@ reset_entries(void) * If the resize_pin parameter is true, verify that the * target entry is in the cache and is pinned. If it * isn't, scream and die. If it is, use the - * H5C_mark_pinned_entry_dirty() call to resize it. + * H5C_resize_pinned_entry() call to resize it. * * Do nothing if pass is false on entry. * @@ -1738,7 +1738,7 @@ resize_entry(H5F_t * file_ptr, } else { - mark_pinned_entry_dirty(type, idx, TRUE, new_size); + resize_pinned_entry(cache_ptr, type, idx, new_size); } } } else { @@ -2809,7 +2809,7 @@ insert_entry(H5F_t * file_ptr, /*------------------------------------------------------------------------- - * Function: mark_pinned_entry_dirty() + * Function: mark_entry_dirty() * * Purpose: Mark the specified entry as dirty. * @@ -2824,10 +2824,8 @@ insert_entry(H5F_t * file_ptr, */ void -mark_pinned_entry_dirty(int32_t type, - int32_t idx, - hbool_t size_changed, - size_t new_size) +mark_entry_dirty(int32_t type, + int32_t idx) { /* const char * fcn_name = "mark_pinned_entry_dirty()"; */ herr_t result; @@ -2845,127 +2843,23 @@ mark_pinned_entry_dirty(int32_t type, HDassert( entry_ptr->index == idx ); HDassert( entry_ptr->type == type ); HDassert( entry_ptr == entry_ptr->self ); - HDassert( ! (entry_ptr->header.is_protected) ); - HDassert( entry_ptr->header.is_pinned ); - HDassert( entry_ptr->is_pinned ); + HDassert( entry_ptr->header.is_protected || + entry_ptr->header.is_pinned ); entry_ptr->is_dirty = TRUE; - if ( size_changed ) { - - /* update entry size now to keep the sanity checks happy */ - entry_ptr->size = new_size; - } - - result = H5C_mark_pinned_entry_dirty((void *)entry_ptr, - size_changed, - new_size); + result = H5C_mark_entry_dirty((void *)entry_ptr); if ( ( result < 0 ) || - ( ! (entry_ptr->header.is_dirty) ) || - ( ! (entry_ptr->header.is_pinned) ) || + ( !entry_ptr->header.is_protected && !entry_ptr->header.is_pinned ) || + ( entry_ptr->header.is_protected && !entry_ptr->header.dirtied ) || + ( !entry_ptr->header.is_protected && !entry_ptr->header.is_dirty ) || ( entry_ptr->header.type != &(types[type]) ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { -#if 0 /* This is useful debugging code -- keep it around */ - HDfprintf(stdout, "result = %ld.\n", (long)result); - HDfprintf(stdout, "entry_ptr->header.is_dirty = %d.\n", - (int)(entry_ptr->header.is_dirty)); - HDfprintf(stdout, "entry_ptr->header.is_pinned = %d.\n", - (int)(entry_ptr->header.is_pinned)); - HDfprintf(stdout, - "(entry_ptr->header.type != &(types[type])) = %d.\n", - (int)(entry_ptr->header.type != &(types[type]))); - HDfprintf(stdout, - "entry_ptr->size = %ld, entry_ptr->header.size = %ld.\n", - (long)(entry_ptr->size), (long)(entry_ptr->header.size)); - HDfprintf(stdout, - "entry_ptr->addr = %ld, entry_ptr->header.addr = %ld.\n", - (long)(entry_ptr->addr), (long)(entry_ptr->header.addr)); -#endif - pass = FALSE; - failure_mssg = "error in H5C_mark_pinned_entry_dirty()."; - - } - - HDassert( ((entry_ptr->header).type)->id == type ); - - } - - return; - -} /* mark_pinned_entry_dirty() */ - - -/*------------------------------------------------------------------------- - * Function: mark_pinned_or_protected_entry_dirty() - * - * Purpose: Mark the specified entry as dirty. - * - * Do nothing if pass is FALSE on entry. - * - * Return: void - * - * Programmer: John Mainzer - * 5/17/06 - * - *------------------------------------------------------------------------- - */ - -void -mark_pinned_or_protected_entry_dirty(int32_t type, - int32_t idx) -{ - /* const char * fcn_name = "mark_pinned_or_protected_entry_dirty()"; */ - herr_t result; - test_entry_t * base_addr; - test_entry_t * entry_ptr; - - if ( pass ) { - - HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); - - base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); - - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->type == type ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->header.is_protected || - entry_ptr->header.is_pinned ); - - entry_ptr->is_dirty = TRUE; - - result = H5C_mark_pinned_or_protected_entry_dirty((void *)entry_ptr); - - if ( ( result < 0 ) - || - ( ( ! (entry_ptr->header.is_protected) ) - && - ( ! (entry_ptr->header.is_pinned) ) - ) - || - ( ( entry_ptr->header.is_protected ) - && - ( ! ( entry_ptr->header.dirtied ) ) - ) - || - ( ( ! ( entry_ptr->header.is_protected ) ) - && - ( ! ( entry_ptr->header.is_dirty ) ) - ) - || - ( entry_ptr->header.type != &(types[type]) ) - || - ( entry_ptr->size != entry_ptr->header.size ) - || - ( entry_ptr->addr != entry_ptr->header.addr ) ) { - pass = FALSE; - failure_mssg = - "error in H5C_mark_pinned_or_protected_entry_dirty()."; + failure_mssg = "error in H5C_mark_entry_dirty()."; } @@ -2975,7 +2869,7 @@ mark_pinned_or_protected_entry_dirty(int32_t type, return; -} /* mark_pinned_or_protected_entry_dirty() */ +} /* mark_entry_dirty() */ /*------------------------------------------------------------------------- diff --git a/test/cache_common.h b/test/cache_common.h index 94c3b11..ca651bf 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -171,13 +171,13 @@ typedef struct flush_op * FLUSH_OP__DIRTY: TRUE iff the * target is pinned, and is to * be dirtied via the - * H5C_mark_pinned_entry_dirty() + * H5C_mark_entry_dirty() * call. * * FLUSH_OP__RESIZE: TRUE iff the * target is pinned, and is to * be resized via the - * H5C_mark_pinned_entry_dirty() + * H5C_mark_entry_dirty() * call. * * FLUSH_OP__RENAME: TRUE iff the @@ -621,13 +621,8 @@ void insert_entry(H5F_t * file_ptr, hbool_t dirty, unsigned int flags); -void mark_pinned_entry_dirty(int32_t type, - int32_t idx, - hbool_t size_changed, - size_t new_size); - -void mark_pinned_or_protected_entry_dirty(int32_t type, - int32_t idx); +void mark_entry_dirty(int32_t type, + int32_t idx); void rename_entry(H5C_t * cache_ptr, int32_t type, |