diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-23 04:53:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-23 04:53:22 (GMT) |
commit | ab37aae39f7754827774577a0053e1b0979b3b1d (patch) | |
tree | f5b018adbd378048d6a8112ab94f873eeb5dddb1 /test/cache.c | |
parent | e8538794ef18febaa471a2a81639c9a9ef7bfba1 (diff) | |
download | hdf5-ab37aae39f7754827774577a0053e1b0979b3b1d.zip hdf5-ab37aae39f7754827774577a0053e1b0979b3b1d.tar.gz hdf5-ab37aae39f7754827774577a0053e1b0979b3b1d.tar.bz2 |
[svn-r18158] Description:
Bring r18157 from trunk to 1.8 branch:
Bring back changes from Coverity session on 1/15/10:
r18111:
Fix Coverity issue #130: make certain that the cache gets freed on error.
r18112:
Fix Coverity issue #43 by making cache testing calls protected by 'pass'
variable.
r18113:
Fix Coverity issue #129 by releasing the cache on error.
r18115:
Coverity #45 fix: patched an error check in H5Screate_simple to prevent future dereferencing of a NULL point.
Added a verification in test/th5s.c.
r18116:
Fix Coverity issue #43 by releasing cache on error.
r18117:
Coverity #362,363 by adding HGOTO_DONE, freeing allocations and associated changes. REsolving coverity results #364-368, 369, 370-372, 377, 379, and 380.
r18118:
Fix Coverity issue #42: assert that cache & test specification pointer are
valid.
r18122:
Coverity #362,363 by adding HGOTO_DONE and freeing allocations. This also takes care of #357,358.
r18123:
Coverity #359-361, 373-376: Added HGOTO_DONE(FAIL) statement after checking allocation for NULL. Verified allocation is freed in done block.
r18128:
Fixed coverity issue #10 -- removed dead code.
Tested on:
Mac OS X/32 10.6.2 (amazon)
Diffstat (limited to 'test/cache.c')
-rw-r--r-- | test/cache.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/test/cache.c b/test/cache.c index 7e204d3..17095bc 100644 --- a/test/cache.c +++ b/test/cache.c @@ -14543,23 +14543,8 @@ check_rename_entry__run_test(H5C_t * cache_ptr, test_entry_t * entry_ptr = NULL; H5C_cache_entry_t * test_ptr = NULL; - if ( cache_ptr == NULL ) { - - pass = FALSE; - HDsnprintf(msg, (size_t)128, - "cache_ptr NULL on entry to rename test #%d.", - test_num); - failure_mssg = msg; - - } else if ( spec_ptr == NULL ) { - - pass = FALSE; - HDsnprintf(msg, (size_t)128, - "spec_ptr NULL on entry to rename test #%d.", - test_num); - failure_mssg = msg; - - } + assert( cache_ptr ); + assert( spec_ptr ); if ( pass ) { @@ -14584,12 +14569,16 @@ check_rename_entry__run_test(H5C_t * cache_ptr, } } - protect_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index); + if ( pass ) { + + protect_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index); - unprotect_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, - (int)(spec_ptr->is_dirty), flags); + unprotect_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, + (int)(spec_ptr->is_dirty), flags); - rename_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, FALSE); + rename_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, FALSE); + + } if ( pass ) { @@ -17928,7 +17917,7 @@ check_check_evictions_enabled_err(void) } - if ( pass ) { + if ( cache_ptr ) { takedown_cache(cache_ptr, FALSE, FALSE); } @@ -28199,7 +28188,7 @@ check_auto_cache_resize_input_errs(void) } } - if ( pass ) { + if ( cache_ptr ) { takedown_cache(cache_ptr, FALSE, FALSE); } @@ -28741,7 +28730,7 @@ check_auto_cache_resize_aux_fcns(void) } } - if ( pass ) { + if ( cache_ptr ) { takedown_cache(cache_ptr, FALSE, FALSE); } |