summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-31 18:46:04 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-31 18:46:04 (GMT)
commit28b214719b3177dad6600c49be78a776bf64b08e (patch)
treeeeb625bee26d96e613489b19d2242684ef669622
parent8bfe9e54bd23add27076290f59bdc09c3d3ee2bb (diff)
downloadhdf5-28b214719b3177dad6600c49be78a776bf64b08e.zip
hdf5-28b214719b3177dad6600c49be78a776bf64b08e.tar.gz
hdf5-28b214719b3177dad6600c49be78a776bf64b08e.tar.bz2
[svn-r18927] Description:
Get down to just one "resize_configs_are_equal" comparison routine. Tested on: Mac OS X/32 10.6.3 (amazon) (too minor to require h5committest)
-rw-r--r--test/cache.c155
-rw-r--r--test/cache_api.c8
-rw-r--r--test/cache_common.c58
-rw-r--r--test/cache_common.h32
4 files changed, 126 insertions, 127 deletions
diff --git a/test/cache.c b/test/cache.c
index 58764cc..0de7904 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -25641,37 +25641,6 @@ check_auto_cache_resize_epoch_markers(void)
*-------------------------------------------------------------------------
*/
-/* Epsilon for floating-point comparisons */
-#define FP_EPSILON 0.000001
-
-#define RESIZE_CONFIGS_ARE_EQUAL(a, b, compare_init) \
-( ( (a).version == (b).version ) && \
- ( (a).rpt_fcn == (b).rpt_fcn ) && \
- ( ( ! compare_init ) || \
- ( (a).set_initial_size == (b).set_initial_size ) ) && \
- ( ( ! compare_init ) || \
- ( (a).initial_size == (b).initial_size ) ) && \
- ( HDfabs((a).min_clean_fraction - (b).min_clean_fraction) < FP_EPSILON ) && \
- ( (a).max_size == (b).max_size ) && \
- ( (a).min_size == (b).min_size ) && \
- ( (a).epoch_length == (b).epoch_length ) && \
- ( (a).incr_mode == (b).incr_mode ) && \
- ( HDfabs((a).lower_hr_threshold - (b).lower_hr_threshold) < FP_EPSILON ) && \
- ( HDfabs((a).increment - (b).increment) < FP_EPSILON ) && \
- ( (a).apply_max_increment == (b).apply_max_increment ) && \
- ( (a).max_increment == (b).max_increment ) && \
- ( (a).flash_incr_mode == (b).flash_incr_mode ) && \
- ( HDfabs((a).flash_multiple - (b).flash_multiple) < FP_EPSILON ) && \
- ( HDfabs((a).flash_threshold - (b).flash_threshold) < FP_EPSILON ) && \
- ( (a).decr_mode == (b).decr_mode ) && \
- ( HDfabs((a).upper_hr_threshold - (b).upper_hr_threshold) < FP_EPSILON ) && \
- ( HDfabs((a).decrement - (b).decrement) < FP_EPSILON ) && \
- ( (a).apply_max_decrement == (b).apply_max_decrement ) && \
- ( (a).max_decrement == (b).max_decrement ) && \
- ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
- ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
- ( HDfabs((a).empty_reserve - (b).empty_reserve) < FP_EPSILON ) )
-
static unsigned
check_auto_cache_resize_input_errs(void)
{
@@ -25778,8 +25747,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 1.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 1.";
@@ -25850,8 +25819,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 2.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 2.";
@@ -25925,8 +25894,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 3.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 3.";
@@ -26001,8 +25970,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 4.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 4.";
@@ -26074,8 +26043,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 5.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 5.";
@@ -26149,8 +26118,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 6.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 6.";
@@ -26221,8 +26190,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 7.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 7.";
@@ -26297,8 +26266,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 8.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 8.";
@@ -26369,8 +26338,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 9.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 9.";
@@ -26441,8 +26410,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 10.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 10.";
@@ -26516,8 +26485,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 11.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 11.";
@@ -26588,8 +26557,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 12.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 12.";
@@ -26664,8 +26633,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 13.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 13.";
@@ -26737,8 +26706,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 14.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 14.";
@@ -26812,8 +26781,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 15.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 15.";
@@ -26884,8 +26853,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 16.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 16.";
@@ -26956,8 +26925,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 17.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 17.";
@@ -27032,8 +27001,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 18.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 18.";
@@ -27107,8 +27076,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 19.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 19.";
@@ -27182,8 +27151,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 20.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 20.";
@@ -27255,8 +27224,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 21.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 21.";
@@ -27330,8 +27299,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 22.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 22.";
@@ -27403,8 +27372,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 23.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 23.";
@@ -27479,8 +27448,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 24.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 24.";
@@ -27552,8 +27521,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 25.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 25.";
@@ -27627,8 +27596,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 26.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 26.";
@@ -27699,8 +27668,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 27.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 27.";
@@ -27773,8 +27742,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 28.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 28.";
@@ -27845,8 +27814,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 29.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 29.";
@@ -27919,8 +27888,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 30.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 30.";
@@ -27991,8 +27960,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 31.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 31.";
diff --git a/test/cache_api.c b/test/cache_api.c
index 8ad3635..8fd2912 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -263,8 +263,8 @@ check_fapl_mdc_api_calls(void)
/* conpare the cache's internal configuration with the expected value */
if ( pass ) {
- if ( ! RESIZE_CONFIGS_ARE_EQUAL(default_auto_size_ctl, \
- cache_ptr->resize_ctl, TRUE) ) {
+ if ( ! resize_configs_are_equal(&default_auto_size_ctl, \
+ &cache_ptr->resize_ctl, TRUE) ) {
pass = FALSE;
@@ -412,8 +412,8 @@ check_fapl_mdc_api_calls(void)
/* conpare the cache's internal configuration with the expected value */
if ( pass ) {
- if ( ! RESIZE_CONFIGS_ARE_EQUAL(mod_auto_size_ctl, \
- cache_ptr->resize_ctl, TRUE) ) {
+ if ( ! resize_configs_are_equal(&mod_auto_size_ctl, \
+ &cache_ptr->resize_ctl, TRUE) ) {
pass = FALSE;
diff --git a/test/cache_common.c b/test/cache_common.c
index 7362fe9..c5570ea 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -4802,6 +4802,62 @@ check_and_validate_cache_size(hid_t file_id,
} /* check_and_validate_cache_size() */
+hbool_t
+resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
+ const H5C_auto_size_ctl_t *b,
+ hbool_t compare_init)
+{
+ if(a->version != b->version)
+ return(FALSE);
+ else if(a->rpt_fcn != b->rpt_fcn)
+ return(FALSE);
+ else if(compare_init && (a->set_initial_size != b->set_initial_size))
+ return(FALSE);
+ else if(compare_init && (a->initial_size != b->initial_size))
+ return(FALSE);
+ else if(HDfabs(a->min_clean_fraction - b->min_clean_fraction) > FP_EPSILON)
+ return(FALSE);
+ else if(a->max_size != b->max_size)
+ return(FALSE);
+ else if(a->min_size != b->min_size)
+ return(FALSE);
+ else if(a->epoch_length != b->epoch_length)
+ return(FALSE);
+ else if(a->incr_mode != b->incr_mode)
+ return(FALSE);
+ else if(HDfabs(a->lower_hr_threshold - b->lower_hr_threshold) > FP_EPSILON)
+ return(FALSE);
+ else if(HDfabs(a->increment - b->increment) > FP_EPSILON)
+ return(FALSE);
+ else if(a->apply_max_increment != b->apply_max_increment)
+ return(FALSE);
+ else if(a->max_increment != b->max_increment)
+ return(FALSE);
+ else if(a->flash_incr_mode != b->flash_incr_mode)
+ return(FALSE);
+ else if(HDfabs(a->flash_multiple - b->flash_multiple) > FP_EPSILON)
+ return(FALSE);
+ else if(HDfabs(a->flash_threshold - b->flash_threshold) > FP_EPSILON)
+ return(FALSE);
+ else if(a->decr_mode != b->decr_mode)
+ return(FALSE);
+ else if(HDfabs(a->upper_hr_threshold - b->upper_hr_threshold) > FP_EPSILON)
+ return(FALSE);
+ else if(HDfabs(a->decrement - b->decrement) > FP_EPSILON)
+ return(FALSE);
+ else if(a->apply_max_decrement != b->apply_max_decrement)
+ return(FALSE);
+ else if(a->max_decrement != b->max_decrement)
+ return(FALSE);
+ else if(a->epochs_before_eviction != b->epochs_before_eviction)
+ return(FALSE);
+ else if(a->apply_empty_reserve != b->apply_empty_reserve)
+ return(FALSE);
+ else if(HDfabs(a->empty_reserve - b->empty_reserve) > FP_EPSILON)
+ return(FALSE);
+ return(TRUE);
+}
+
/*-------------------------------------------------------------------------
* Function: validate_mdc_config()
@@ -4871,7 +4927,7 @@ validate_mdc_config(hid_t file_id,
/* compare the cache's internal configuration with the expected value */
if ( pass ) {
- if ( ! RESIZE_CONFIGS_ARE_EQUAL(int_config, cache_ptr->resize_ctl,
+ if ( ! resize_configs_are_equal(&int_config, &cache_ptr->resize_ctl,
compare_init) ) {
pass = FALSE;
diff --git a/test/cache_common.h b/test/cache_common.h
index 41cbfeb..a3182e0 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -416,35 +416,6 @@ if ( ( (cache_ptr) == NULL ) || \
( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
( (a).empty_reserve == (b).empty_reserve ) )
-#define RESIZE_CONFIGS_ARE_EQUAL(a, b, compare_init) \
-( ( (a).version == (b).version ) && \
- ( (a).rpt_fcn == (b).rpt_fcn ) && \
- ( ( ! compare_init ) || \
- ( (a).set_initial_size == (b).set_initial_size ) ) && \
- ( ( ! compare_init ) || \
- ( (a).initial_size == (b).initial_size ) ) && \
- ( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \
- ( (a).max_size == (b).max_size ) && \
- ( (a).min_size == (b).min_size ) && \
- ( (a).epoch_length == (b).epoch_length ) && \
- ( (a).incr_mode == (b).incr_mode ) && \
- ( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \
- ( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \
- ( (a).apply_max_increment == (b).apply_max_increment ) && \
- ( (a).max_increment == (b).max_increment ) && \
- ( (a).flash_incr_mode == (b).flash_incr_mode ) && \
- ( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \
- ( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \
- ( (a).decr_mode == (b).decr_mode ) && \
- ( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \
- ( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \
- ( (a).apply_max_decrement == (b).apply_max_decrement ) && \
- ( (a).max_decrement == (b).max_decrement ) && \
- ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
- ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
- ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) )
-
-
#define XLATE_EXT_TO_INT_MDC_CONFIG(i, e) \
{ \
(i).version = H5C__CURR_AUTO_SIZE_CTL_VER; \
@@ -479,6 +450,9 @@ if ( ( (cache_ptr) == NULL ) || \
(i).empty_reserve = (e).empty_reserve; \
}
+/* Epsilon for floating-point comparisons */
+#define FP_EPSILON 0.000001
+
/* misc type definitions */