summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <quincey@koziol.cc>2023-05-15 18:54:58 (GMT)
committerGitHub <noreply@github.com>2023-05-15 18:54:58 (GMT)
commit940bdafacb32147b5b20d6d8994c89b696592f6f (patch)
tree4bc329c767039f2aef7808104a43f2a840ba8e32 /test
parent20e72f98b2063aa349cdec8b56ca6e4ab54a15cc (diff)
downloadhdf5-940bdafacb32147b5b20d6d8994c89b696592f6f.zip
hdf5-940bdafacb32147b5b20d6d8994c89b696592f6f.tar.gz
hdf5-940bdafacb32147b5b20d6d8994c89b696592f6f.tar.bz2
Remove unnecessary fields from cache structs (#2951)
* Remove unnecessary 'magic' field from cache structs Signed-off-by: Quincey Koziol <quincey@koziol.cc> * Committing clang-format changes --------- Signed-off-by: Quincey Koziol <quincey@koziol.cc> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/cache.c18
-rw-r--r--test/cache_api.c6
-rw-r--r--test/cache_common.c27
-rw-r--r--test/cache_image.c1
4 files changed, 3 insertions, 49 deletions
diff --git a/test/cache.c b/test/cache.c
index 517c0b5..203c09a 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -24795,17 +24795,6 @@ check_auto_cache_resize_input_errs(unsigned paged)
if (pass) {
- result = H5C_get_cache_auto_resize_config((const H5C_t *)&test_auto_size_ctl, &test_auto_size_ctl);
-
- if (result != FAIL) {
-
- pass = FALSE;
- failure_mssg = "H5C_get_cache_auto_resize_config accepted bad cache_ptr.\n";
- }
- }
-
- if (pass) {
-
result = H5C_get_cache_auto_resize_config(cache_ptr, NULL);
if (result != FAIL) {
@@ -33918,13 +33907,6 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
if (verbose)
HDfprintf(stdout, "%s: H5C_create() failed.\n", __func__);
}
- else if (cache_ptr->magic != H5C__H5C_T_MAGIC) {
- pass = FALSE;
- failure_mssg = "Bad cache_ptr magic.";
-
- if (verbose)
- HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", __func__);
- }
}
if (show_progress) /* 7 */
diff --git a/test/cache_api.c b/test/cache_api.c
index a34a6ca..f40782c 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -241,8 +241,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* verify that we can access the internal version of the cache config */
if (pass) {
- if ((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) ||
- (cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER)) {
+ if (cache_ptr == NULL || cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER) {
pass = FALSE;
failure_mssg = "Can't access cache resize_ctl.\n";
@@ -385,8 +384,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* verify that we can access the internal version of the cache config */
if (pass) {
- if ((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) ||
- (cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER)) {
+ if (cache_ptr == NULL || cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER) {
pass = FALSE;
failure_mssg = "Can't access cache resize_ctl.\n";
diff --git a/test/cache_common.c b/test/cache_common.c
index e647abf..d755e1e 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -1335,9 +1335,7 @@ free_icr(test_entry_t *entry, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
HDassert(entry == &(entries[entry->type][entry->index]));
HDassert(entry == entry->self);
HDassert(entry->cache_ptr != NULL);
- HDassert(entry->cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert((entry->header.destroy_in_progress) || (entry->header.addr == entry->addr));
- HDassert(entry->header.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC);
HDassert(entry->header.size == entry->size);
HDassert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[entry->type]));
HDassert(entry->header.tl_next == NULL);
@@ -1675,7 +1673,6 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o
HDassert(file_ptr);
cache_ptr = file_ptr->shared->cache;
HDassert(cache_ptr != NULL);
- HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(entry_ptr != NULL);
HDassert(entry_ptr == entry_ptr->self);
HDassert(entry_ptr->header.addr == entry_ptr->addr);
@@ -4973,16 +4970,6 @@ check_and_validate_cache_hit_rate(hid_t file_id, double *hit_rate_ptr, hbool_t d
}
}
- /* verify that we can access the cache data structure */
- if (pass) {
-
- if (cache_ptr->magic != H5C__H5C_T_MAGIC) {
-
- pass = FALSE;
- failure_mssg = "Can't access cache resize_ctl.";
- }
- }
-
/* compare the cache's internal configuration with the expected value */
if (pass) {
@@ -5102,16 +5089,6 @@ check_and_validate_cache_size(hid_t file_id, size_t *max_size_ptr, size_t *min_c
}
}
- /* verify that we can access the cache data structure */
- if (pass) {
-
- if (cache_ptr->magic != H5C__H5C_T_MAGIC) {
-
- pass = FALSE;
- failure_mssg = "Can't access cache data structure.";
- }
- }
-
/* compare the cache's internal configuration with the expected value */
if (pass) {
@@ -5268,8 +5245,7 @@ validate_mdc_config(hid_t file_id, H5AC_cache_config_t *ext_config_ptr, hbool_t
/* verify that we can access the internal version of the cache config */
if (pass) {
- if ((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) ||
- (cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER)) {
+ if (cache_ptr == NULL || cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER) {
pass = FALSE;
HDsnprintf(tmp_msg_buf, sizeof(tmp_msg_buf), "Can't access cache resize_ctl #%d.", test_num);
@@ -5352,7 +5328,6 @@ dump_LRU(H5F_t * file_ptr)
H5C_t *cache_ptr = file_ptr->shared->cache;
HDassert(cache_ptr);
- HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
entry_ptr = cache_ptr->LRU_head_ptr;
diff --git a/test/cache_image.c b/test/cache_image.c
index c3c0b49..7977454 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -7659,7 +7659,6 @@ evict_on_close_test(hbool_t H5_ATTR_PARALLEL_UNUSED single_file_vfd)
if (verbose) {
HDassert(cache_ptr);
- HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDfprintf(stdout, "index size / index dirty size = %lld / %lld\n", (long long)(cache_ptr->index_size),
(long long)(cache_ptr->dirty_index_size));