diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/cache.c | 689 | ||||
-rw-r--r-- | test/cache_api.c | 143 | ||||
-rw-r--r-- | test/cache_common.c | 189 | ||||
-rw-r--r-- | test/cache_common.h | 133 |
4 files changed, 603 insertions, 551 deletions
diff --git a/test/cache.c b/test/cache.c index b56888b..63d1437 100644 --- a/test/cache.c +++ b/test/cache.c @@ -103,17 +103,17 @@ struct move_entry_test_spec /* private function declarations: */ -static unsigned smoke_check_1(void); -static unsigned smoke_check_2(void); -static unsigned smoke_check_3(void); -static unsigned smoke_check_4(void); -static unsigned smoke_check_5(void); -static unsigned smoke_check_6(void); -static unsigned smoke_check_7(void); -static unsigned smoke_check_8(void); -static unsigned smoke_check_9(void); -static unsigned smoke_check_10(void); -static unsigned write_permitted_check(void); +static unsigned smoke_check_1(int express_test); +static unsigned smoke_check_2(int express_test); +static unsigned smoke_check_3(int express_test); +static unsigned smoke_check_4(int express_test); +static unsigned smoke_check_5(int express_test); +static unsigned smoke_check_6(int express_test); +static unsigned smoke_check_7(int express_test); +static unsigned smoke_check_8(int express_test); +static unsigned smoke_check_9(int express_test); +static unsigned smoke_check_10(int express_test); +static unsigned write_permitted_check(int express_test); static unsigned check_insert_entry(void); static unsigned check_flush_cache(void); static void check_flush_cache__empty_cache(H5F_t * file_ptr); @@ -225,7 +225,7 @@ static unsigned check_auto_cache_resize_aux_fcns(void); */ static unsigned -smoke_check_1(void) +smoke_check_1(int express_test) { const char * fcn_name = "smoke_check_1"; hbool_t show_progress = FALSE; @@ -412,7 +412,7 @@ smoke_check_1(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_1() */ @@ -440,7 +440,7 @@ smoke_check_1(void) */ static unsigned -smoke_check_2(void) +smoke_check_2(int express_test) { const char * fcn_name = "smoke_check_2"; hbool_t show_progress = FALSE; @@ -627,7 +627,7 @@ smoke_check_2(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_2() */ @@ -654,7 +654,7 @@ smoke_check_2(void) */ static unsigned -smoke_check_3(void) +smoke_check_3(int express_test) { const char * fcn_name = "smoke_check_3"; hbool_t show_progress = FALSE; @@ -841,7 +841,7 @@ smoke_check_3(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_3() */ @@ -869,7 +869,7 @@ smoke_check_3(void) */ static unsigned -smoke_check_4(void) +smoke_check_4(int express_test) { const char * fcn_name = "smoke_check_4"; hbool_t show_progress = FALSE; @@ -1056,7 +1056,7 @@ smoke_check_4(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_4() */ @@ -1084,7 +1084,7 @@ smoke_check_4(void) */ static unsigned -smoke_check_5(void) +smoke_check_5(int express_test) { const char * fcn_name = "smoke_check_5"; herr_t result; @@ -1308,7 +1308,7 @@ smoke_check_5(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_5() */ @@ -1336,7 +1336,7 @@ smoke_check_5(void) */ static unsigned -smoke_check_6(void) +smoke_check_6(int express_test) { const char * fcn_name = "smoke_check_6"; herr_t result; @@ -1560,7 +1560,7 @@ smoke_check_6(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_6() */ @@ -1588,7 +1588,7 @@ smoke_check_6(void) */ static unsigned -smoke_check_7(void) +smoke_check_7(int express_test) { const char * fcn_name = "smoke_check_7"; herr_t result; @@ -1813,7 +1813,7 @@ smoke_check_7(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_7() */ @@ -1841,7 +1841,7 @@ smoke_check_7(void) */ static unsigned -smoke_check_8(void) +smoke_check_8(int express_test) { const char * fcn_name = "smoke_check_8"; herr_t result; @@ -1939,8 +1939,7 @@ smoke_check_8(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - file_ptr = setup_cache((size_t)(2 * 1024), - (size_t)(1 * 1024)); + file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); cache_ptr = file_ptr->shared->cache; if ( pass ) { @@ -2066,7 +2065,7 @@ smoke_check_8(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_8() */ @@ -2095,7 +2094,7 @@ smoke_check_8(void) */ static unsigned -smoke_check_9(void) +smoke_check_9(int express_test) { const char * fcn_name = "smoke_check_9"; herr_t result; @@ -2396,7 +2395,7 @@ smoke_check_9(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_9() */ @@ -2425,7 +2424,7 @@ smoke_check_9(void) */ static unsigned -smoke_check_10(void) +smoke_check_10(int express_test) { const char * fcn_name = "smoke_check_10"; herr_t result; @@ -2721,7 +2720,7 @@ smoke_check_10(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* smoke_check_10() */ @@ -2746,7 +2745,7 @@ smoke_check_10(void) */ static unsigned -write_permitted_check(void) +write_permitted_check(int express_test) { #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS @@ -2943,7 +2942,7 @@ write_permitted_check(void) #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - return !pass; + return (unsigned)!pass; } /* write_permitted_check() */ @@ -3250,7 +3249,7 @@ check_insert_entry(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_insert_entry() */ @@ -3344,7 +3343,7 @@ check_flush_cache(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_flush_cache() */ @@ -12853,8 +12852,8 @@ check_get_entry_status(void) hbool_t is_pinned; size_t entry_size; H5F_t * file_ptr = NULL; - test_entry_t * base_addr; - test_entry_t * entry_ptr; + test_entry_t * base_addr = NULL; + test_entry_t * entry_ptr = NULL; TESTING("H5C_get_entry_status() functionality"); @@ -12869,8 +12868,18 @@ check_get_entry_status(void) file_ptr = setup_cache((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); - base_addr = entries[0]; - entry_ptr = &(base_addr[0]); + if ( file_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "file_ptr NULL from setup_cache."; + + } + else { + + base_addr = entries[0]; + entry_ptr = &(base_addr[0]); + + } } if ( pass ) { @@ -12897,9 +12906,13 @@ check_get_entry_status(void) } } - protect_entry(file_ptr, 0, 0); + if ( pass ) { - unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + protect_entry(file_ptr, 0, 0); + + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + + } if ( pass ) { @@ -12921,7 +12934,11 @@ check_get_entry_status(void) } } - protect_entry(file_ptr, 0, 0); + if ( pass ) { + + protect_entry(file_ptr, 0, 0); + + } if ( pass ) { @@ -12943,7 +12960,11 @@ check_get_entry_status(void) } } - unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); + if ( pass ) { + + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); + + } if ( pass ) { @@ -12965,7 +12986,11 @@ check_get_entry_status(void) } } - mark_entry_dirty(0, 0); + if ( pass ) { + + mark_entry_dirty(0, 0); + + } if ( pass ) { @@ -12987,7 +13012,11 @@ check_get_entry_status(void) } } - unpin_entry(0, 0); + if ( pass ) { + + unpin_entry(0, 0); + + } if ( pass ) { @@ -13029,7 +13058,7 @@ check_get_entry_status(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_get_entry_status() */ @@ -13120,9 +13149,13 @@ check_expunge_entry(void) * it without marking it dirty. */ - protect_entry(file_ptr, 0, 0); + if ( pass ) { - unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + protect_entry(file_ptr, 0, 0); + + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + + } if ( pass ) { @@ -13157,7 +13190,11 @@ check_expunge_entry(void) * Also verify that the entry was loaded and destroyed, but * not flushed. */ - expunge_entry(file_ptr, 0, 0); + if ( pass ) { + + expunge_entry(file_ptr, 0, 0); + + } if ( pass ) { @@ -13237,9 +13274,13 @@ check_expunge_entry(void) * it with the dirty flag set. */ - protect_entry(file_ptr, 0, 1); + if ( pass ) { + + protect_entry(file_ptr, 0, 1); + + unprotect_entry(file_ptr, 0, 1, H5C__DIRTIED_FLAG); - unprotect_entry(file_ptr, 0, 1, H5C__DIRTIED_FLAG); + } if ( pass ) { @@ -13275,7 +13316,11 @@ check_expunge_entry(void) * Also verify that the entry was loaded and destroyed, but not * flushed. */ - expunge_entry(file_ptr, 0, 1); + if ( pass ) { + + expunge_entry(file_ptr, 0, 1); + + } if ( pass ) { @@ -13331,7 +13376,7 @@ check_expunge_entry(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_expunge_entry() */ @@ -13761,7 +13806,7 @@ check_multiple_read_protect(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_multiple_read_protect() */ @@ -13883,7 +13928,7 @@ check_move_entry(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_move_entry() */ @@ -13961,14 +14006,18 @@ check_move_entry__run_test(H5F_t * file_ptr, } } - protect_entry(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index); + if ( pass ) { + + protect_entry(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index); + + if(spec_ptr->is_dirty) + flags |= H5C__DIRTIED_FLAG; - if(spec_ptr->is_dirty) - flags |= H5C__DIRTIED_FLAG; + unprotect_entry(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index, flags); - unprotect_entry(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index, flags); + move_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, FALSE); - move_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, FALSE); + } if ( pass ) { @@ -14083,9 +14132,20 @@ check_pin_protected_entry(void) file_ptr = setup_cache((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); + + if ( file_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "file_ptr NULL from setup_cache."; + + } } - protect_entry(file_ptr, 0, 0); + if ( pass ) { + + protect_entry(file_ptr, 0, 0); + + } if ( pass ) { @@ -14135,7 +14195,7 @@ check_pin_protected_entry(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_pin_protected_entry() */ @@ -14214,11 +14274,20 @@ check_resize_entry(void) file_ptr = setup_cache((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); - cache_ptr = file_ptr->shared->cache; + if ( file_ptr == NULL ) { - base_addr = entries[LARGE_ENTRY_TYPE]; - entry_ptr = &(base_addr[0]); - entry_size = LARGE_ENTRY_SIZE; + pass = FALSE; + failure_mssg = "file_ptr NULL from setup_cache."; + + } + else + { + cache_ptr = file_ptr->shared->cache; + + base_addr = entries[LARGE_ENTRY_TYPE]; + entry_ptr = &(base_addr[0]); + entry_size = LARGE_ENTRY_SIZE; + } } if ( pass ) { @@ -14235,7 +14304,11 @@ check_resize_entry(void) } } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); + if ( pass ) { + + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); + + } if ( pass ) { @@ -14361,7 +14434,11 @@ check_resize_entry(void) } } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); + if ( pass ) { + + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); + + } if ( pass ) { @@ -14442,9 +14519,13 @@ check_resize_entry(void) } } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); + if ( pass ) { + + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__PIN_ENTRY_FLAG); + + } if ( pass ) { @@ -14564,10 +14645,14 @@ check_resize_entry(void) } } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); + if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, - H5C__UNPIN_ENTRY_FLAG | H5C__DELETED_FLAG); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); + + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, + H5C__UNPIN_ENTRY_FLAG | H5C__DELETED_FLAG); + + } if ( pass ) { @@ -14614,7 +14699,7 @@ check_resize_entry(void) } - /* now repreat the above tests with several entries in the cache: */ + /* now repeat the above tests with several entries in the cache: */ if ( pass ) { @@ -14633,14 +14718,18 @@ check_resize_entry(void) entry_size = LARGE_ENTRY_SIZE; } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); + if ( pass ) { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); + + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); + + } if ( pass ) { @@ -14657,7 +14746,11 @@ check_resize_entry(void) } } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); + if ( pass ) { + + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); + + } if ( pass ) { @@ -14785,7 +14878,11 @@ check_resize_entry(void) } } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); + if ( pass ) { + + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); + + } if ( pass ) { @@ -14866,9 +14963,13 @@ check_resize_entry(void) } } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); + if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__PIN_ENTRY_FLAG); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); + + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__PIN_ENTRY_FLAG); + + } if ( pass ) { @@ -14990,10 +15091,14 @@ check_resize_entry(void) } } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); + if ( pass ) { + + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, - H5C__UNPIN_ENTRY_FLAG | H5C__DELETED_FLAG); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, + H5C__UNPIN_ENTRY_FLAG | H5C__DELETED_FLAG); + + } if ( pass ) { @@ -15039,15 +15144,18 @@ check_resize_entry(void) } } - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DELETED_FLAG); + if ( pass ) { + + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DELETED_FLAG); - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DELETED_FLAG); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DELETED_FLAG); - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__DELETED_FLAG); + protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__DELETED_FLAG); + } if ( pass ) { @@ -15083,7 +15191,7 @@ check_resize_entry(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_resize_entry() */ @@ -15119,7 +15227,7 @@ check_evictions_enabled(void) size_t entry_size; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; - test_entry_t * base_addr; + test_entry_t * base_addr = NULL; test_entry_t * entry_ptr; TESTING("evictions enabled/disabled functionality"); @@ -15174,10 +15282,19 @@ check_evictions_enabled(void) file_ptr = setup_cache((size_t)(1 * 1024 * 1024), (size_t)( 512 * 1024)); - cache_ptr = file_ptr->shared->cache; + if ( file_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "file_ptr NULL from setup_cache."; + + } + else + { + cache_ptr = file_ptr->shared->cache; - base_addr = entries[MONSTER_ENTRY_TYPE]; - entry_size = MONSTER_ENTRY_SIZE; + base_addr = entries[MONSTER_ENTRY_TYPE]; + entry_size = MONSTER_ENTRY_SIZE; + } } if ( show_progress ) /* 2 */ @@ -15221,11 +15338,15 @@ check_evictions_enabled(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - /* fill the cache */ - for ( i = 0; i < 16 ; i++ ) - { - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); + if ( pass ) { + + /* fill the cache */ + for ( i = 0; i < 16 ; i++ ) + { + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); + } + } if ( show_progress ) /* 5 */ @@ -15253,9 +15374,13 @@ check_evictions_enabled(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - /* protect and unprotect another entry */ - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 16); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 16, H5C__NO_FLAGS_SET); + if ( pass ) { + + /* protect and unprotect another entry */ + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 16); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 16, H5C__NO_FLAGS_SET); + + } if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -15316,8 +15441,12 @@ check_evictions_enabled(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - /* insert an entry */ - insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 17, H5C__NO_FLAGS_SET); + if ( pass ) { + + /* insert an entry */ + insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 17, H5C__NO_FLAGS_SET); + + } if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -15415,9 +15544,13 @@ check_evictions_enabled(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - /* protect and unprotect another entry */ - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 18); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 18, H5C__NO_FLAGS_SET); + if ( pass ) { + + /* protect and unprotect another entry */ + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 18); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 18, H5C__NO_FLAGS_SET); + + } if ( show_progress ) /* 15 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -15443,8 +15576,12 @@ check_evictions_enabled(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - /* insert another entry */ - insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 19, H5C__NO_FLAGS_SET); + if ( pass ) { + + /* insert another entry */ + insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 19, H5C__NO_FLAGS_SET); + + } if ( show_progress ) /* 17 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -15487,9 +15624,13 @@ check_evictions_enabled(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - /* protect and unprotect an entry that is in the cache */ - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 19); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 19, H5C__NO_FLAGS_SET); + if ( pass ) { + + /* protect and unprotect an entry that is in the cache */ + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 19); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 19, H5C__NO_FLAGS_SET); + + } if ( show_progress ) /* 20 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -15515,9 +15656,13 @@ check_evictions_enabled(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - /* protect and unprotect an entry that isn't in the cache */ - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 20); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 20, H5C__NO_FLAGS_SET); + if ( pass ) { + + /* protect and unprotect an entry that isn't in the cache */ + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 20); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 20, H5C__NO_FLAGS_SET); + + } if ( show_progress ) /* 22 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -15633,12 +15778,15 @@ check_evictions_enabled(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - /* protect and unprotect an entry that isn't in the cache, forcing - * the cache to grow. - */ - protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 21); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 21, H5C__NO_FLAGS_SET); + if ( pass ) { + + /* protect and unprotect an entry that isn't in the cache, forcing + * the cache to grow. + */ + protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 21); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 21, H5C__NO_FLAGS_SET); + } if ( show_progress ) /* 27 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -15681,8 +15829,12 @@ check_evictions_enabled(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - /* insert an entry */ - insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 22, H5C__NO_FLAGS_SET); + if ( pass ) { + + /* insert an entry */ + insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 22, H5C__NO_FLAGS_SET); + + } if ( show_progress ) /* 30 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -15784,7 +15936,7 @@ check_evictions_enabled(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_evictions_enabled() */ @@ -15867,7 +16019,7 @@ check_flush_protected_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_flush_protected_err() */ @@ -15968,7 +16120,7 @@ check_destroy_pinned_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_destroy_pinned_err() */ @@ -16063,7 +16215,7 @@ check_destroy_protected_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_destroy_protected_err() */ @@ -16088,7 +16240,7 @@ static unsigned check_duplicate_insert_err(void) { const char * fcn_name = "check_duplicate_insert_err"; - herr_t result; + herr_t result = -1; H5F_t * file_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -16151,7 +16303,7 @@ check_duplicate_insert_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_duplicate_insert_err() */ @@ -16255,7 +16407,7 @@ check_move_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_move_err() */ @@ -16352,7 +16504,7 @@ check_double_pin_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_double_pin_err() */ @@ -16460,7 +16612,7 @@ check_double_unpin_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_double_unpin_err() */ @@ -16580,7 +16732,7 @@ check_pin_entry_errs(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_pin_entry_errs() */ @@ -16632,7 +16784,7 @@ check_double_protect_err(void) if ( pass ) { - cache_entry_ptr = H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[0]), entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -16668,7 +16820,7 @@ check_double_protect_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_double_protect_err() */ @@ -16754,7 +16906,7 @@ check_double_unprotect_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_double_unprotect_err() */ @@ -16843,7 +16995,7 @@ check_mark_entry_dirty_errs(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_mark_entry_dirty_errs() */ @@ -16976,7 +17128,7 @@ check_expunge_entry_errs(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_expunge_entry_errs() */ @@ -17087,7 +17239,7 @@ check_resize_entry_errs(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_resize_entry_errs() */ @@ -17222,7 +17374,7 @@ check_unprotect_ro_dirty_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_unprotect_ro_dirty_err() */ @@ -17279,7 +17431,7 @@ check_protect_ro_rw_err(void) if ( pass ) { - thing_ptr = H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, + thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[0]), entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -17315,7 +17467,7 @@ check_protect_ro_rw_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_protect_ro_rw_err() */ @@ -17443,7 +17595,7 @@ check_check_evictions_enabled_err(void) } - if ( pass ) { + if ( cache_ptr ) { takedown_cache(file_ptr, FALSE, FALSE); } @@ -17463,7 +17615,7 @@ check_check_evictions_enabled_err(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_evictions_enabled_err() */ @@ -20628,6 +20780,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + /* now repeat the above tests using the add space flash cache size + * increment algorithm. + */ + if ( pass ) { auto_size_ctl.version = H5C__CURR_AUTO_SIZE_CTL_VER; @@ -20837,6 +20993,7 @@ check_auto_cache_resize(void) if ( pass ) { insert_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); + /* protect and unprotect a couple times to increment cache_accesses */ protect_entry(file_ptr, HUGE_ENTRY_TYPE, 1); unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); @@ -21684,7 +21841,7 @@ check_auto_cache_resize(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_auto_cache_resize() */ @@ -21784,7 +21941,17 @@ check_auto_cache_resize_disable(void) file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); - cache_ptr = file_ptr->shared->cache; + + if ( file_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "file_ptr NULL from setup_cache."; + + } + else { + + cache_ptr = file_ptr->shared->cache; + } } if ( pass ) { @@ -22826,8 +22993,12 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* flush the cache and destroy all entries so we start from a known point */ - flush_cache(file_ptr, TRUE, FALSE, FALSE); + if ( pass ) { + + /* flush the cache and destroy all entries so we start from a known point */ + flush_cache(file_ptr, TRUE, FALSE, FALSE); + + } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -23049,8 +23220,12 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* flush the cache and destroy all entries so we start from a known point */ - flush_cache(file_ptr, TRUE, FALSE, FALSE); + if ( pass ) { + + /* flush the cache and destroy all entries so we start from a known point */ + flush_cache(file_ptr, TRUE, FALSE, FALSE); + + } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -23279,8 +23454,12 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* flush the cache and destroy all entries so we start from a known point */ - flush_cache(file_ptr, TRUE, FALSE, FALSE); + if ( pass ) { + + /* flush the cache and destroy all entries so we start from a known point */ + flush_cache(file_ptr, TRUE, FALSE, FALSE); + + } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -24401,7 +24580,7 @@ check_auto_cache_resize_disable(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_auto_cache_resize_disable() */ @@ -25115,7 +25294,7 @@ check_auto_cache_resize_epoch_markers(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_auto_cache_resize_epoch_markers() */ @@ -25141,34 +25320,6 @@ check_auto_cache_resize_epoch_markers(void) *------------------------------------------------------------------------- */ -#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 ) ) ) - static unsigned check_auto_cache_resize_input_errs(void) { @@ -25277,8 +25428,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."; @@ -25349,8 +25500,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."; @@ -25424,8 +25575,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."; @@ -25500,8 +25651,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."; @@ -25573,8 +25724,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."; @@ -25648,8 +25799,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."; @@ -25720,8 +25871,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."; @@ -25796,8 +25947,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."; @@ -25868,8 +26019,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."; @@ -25940,8 +26091,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."; @@ -26015,8 +26166,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."; @@ -26087,8 +26238,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."; @@ -26163,8 +26314,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."; @@ -26236,8 +26387,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."; @@ -26311,8 +26462,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."; @@ -26383,8 +26534,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."; @@ -26455,8 +26606,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."; @@ -26531,8 +26682,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."; @@ -26606,8 +26757,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."; @@ -26681,8 +26832,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."; @@ -26754,8 +26905,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."; @@ -26829,8 +26980,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."; @@ -26902,8 +27053,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."; @@ -26978,8 +27129,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."; @@ -27051,8 +27202,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."; @@ -27126,8 +27277,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."; @@ -27198,8 +27349,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."; @@ -27272,8 +27423,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."; @@ -27344,8 +27495,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."; @@ -27418,8 +27569,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."; @@ -27490,8 +27641,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."; @@ -27540,7 +27691,7 @@ check_auto_cache_resize_input_errs(void) } } - if ( pass ) { + if ( cache_ptr ) { takedown_cache(file_ptr, FALSE, FALSE); } @@ -27560,7 +27711,7 @@ check_auto_cache_resize_input_errs(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_auto_cache_resize_input_errs() */ @@ -27711,7 +27862,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( hit_rate != 0.0 ) { + } else if ( hit_rate > FP_EPSILON ) { /* i.e. hit_rate != 0.0 */ pass = FALSE; failure_mssg = @@ -27744,7 +27895,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( hit_rate != 0.0 ) { + } else if ( hit_rate > FP_EPSILON ) { /* i.e. hit_rate != 0.0 */ pass = FALSE; failure_mssg = @@ -27789,7 +27940,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, 0.00001) ) { + } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = @@ -27872,7 +28023,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, 0.00001) ) { + } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = @@ -28128,7 +28279,7 @@ check_auto_cache_resize_aux_fcns(void) } } - if ( pass ) { + if ( cache_ptr ) { takedown_cache(file_ptr, FALSE, FALSE); } @@ -28148,7 +28299,7 @@ check_auto_cache_resize_aux_fcns(void) fcn_name); } - return !pass; + return (unsigned)!pass; } /* check_auto_cache_resize_aux_fcns() */ @@ -28178,6 +28329,7 @@ main(void) hbool_t core_file_driver_recommended = FALSE; const char *envval = NULL; unsigned nerrs = 0; + int express_test; core_file_driver_recommended = recommend_core_file_driver(); @@ -28243,17 +28395,18 @@ main(void) printf("\n"); } - nerrs += smoke_check_1(); - nerrs += smoke_check_2(); - nerrs += smoke_check_3(); - nerrs += smoke_check_4(); - nerrs += smoke_check_5(); - nerrs += smoke_check_6(); - nerrs += smoke_check_7(); - nerrs += smoke_check_8(); - nerrs += smoke_check_9(); - nerrs += smoke_check_10(); - nerrs += write_permitted_check(); + nerrs += smoke_check_1(express_test); + nerrs += smoke_check_2(express_test); + nerrs += smoke_check_3(express_test); + nerrs += smoke_check_4(express_test); + nerrs += smoke_check_5(express_test); + nerrs += smoke_check_6(express_test); + nerrs += smoke_check_7(express_test); + nerrs += smoke_check_8(express_test); + nerrs += smoke_check_9(express_test); + nerrs += smoke_check_10(express_test); + + nerrs += write_permitted_check(express_test); /* for shorter tests, the overhead of using the core file driver doesn't * seem to allow us to realize any significant time saveings. Thus diff --git a/test/cache_api.c b/test/cache_api.c index 9e5dd6b..a2db969 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -39,7 +39,7 @@ static unsigned check_fapl_mdc_api_calls(void); static unsigned check_file_mdc_api_calls(void); -static unsigned mdc_api_call_smoke_check(void); +static unsigned mdc_api_call_smoke_check(int express_test); static unsigned check_fapl_mdc_api_errs(void); @@ -68,11 +68,8 @@ static unsigned check_file_mdc_api_errs(void); * Programmer: John Mainzer * 4/12/04 * - * Modifications: - * *------------------------------------------------------------------------- */ - static unsigned check_fapl_mdc_api_calls(void) { @@ -266,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; @@ -415,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; @@ -866,12 +863,11 @@ check_file_mdc_api_calls(void) #define NUM_RANDOM_ACCESSES 200000 static unsigned -mdc_api_call_smoke_check(void) +mdc_api_call_smoke_check(int express_test) { const char * fcn_name = "mdc_api_call_smoke_check()"; char filename[512]; hbool_t valid_chunk; - hbool_t report_progress = FALSE; hbool_t dump_hit_rate = FALSE; int64_t min_accesses = 1000; double min_hit_rate = 0.90; @@ -884,7 +880,6 @@ mdc_api_call_smoke_check(void) hid_t properties; char dset_name[64]; int i, j, k, l, m, n; - int progress_counter; herr_t status; hsize_t dims[2]; hsize_t a_size[2]; @@ -994,7 +989,7 @@ mdc_api_call_smoke_check(void) TESTING("MDC API smoke check"); - if ( skip_long_tests > 0 ) { + if ( express_test > 0 ) { SKIPPED(); @@ -1015,12 +1010,6 @@ mdc_api_call_smoke_check(void) /* setup the file name */ - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"\nSetting up file ... "); - HDfflush(stdout); - } - if ( pass ) { if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) @@ -1059,21 +1048,9 @@ mdc_api_call_smoke_check(void) /* verify that the cache is now set to the alternate config */ validate_mdc_config(file_id, &mod_config_1, TRUE, 2); - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Done.\n"); /* setting up file */ - HDfflush(stdout); - } - /* create the datasets */ - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Creating datasets ... "); - HDfflush(stdout); - } - if ( pass ) { i = 0; @@ -1122,8 +1099,7 @@ mdc_api_call_smoke_check(void) sprintf(dset_name, "/dset%03d", i); dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, - dataspace_id, H5P_DEFAULT, - properties, H5P_DEFAULT); + dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); if ( dataset_ids[i] < 0 ) { @@ -1179,21 +1155,8 @@ mdc_api_call_smoke_check(void) } } - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Done.\n"); - HDfflush(stdout); - } - /* initialize all datasets on a round robin basis */ i = 0; - progress_counter = 0; - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, "Initializing datasets "); - HDfflush(stdout); - } while ( ( pass ) && ( i < DSET_SIZE ) ) { @@ -1261,23 +1224,6 @@ mdc_api_call_smoke_check(void) i += CHUNK_SIZE; - if ( ( pass ) && ( report_progress ) ) { - - progress_counter += CHUNK_SIZE; - - if ( progress_counter >= DSET_SIZE / 20 ) { - - progress_counter = 0; - HDfprintf(stdout, "."); - HDfflush(stdout); - } - } - } - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout," Done.\n"); /* initializing data sets */ - HDfflush(stdout); } /* set alternate config 2 */ @@ -1295,14 +1241,7 @@ mdc_api_call_smoke_check(void) /* do random reads on all datasets */ - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, "Doing random reads on all datasets "); - HDfflush(stdout); - } - n = 0; - progress_counter = 0; while ( ( pass ) && ( n < NUM_RANDOM_ACCESSES ) ) { m = rand() % NUM_DSETS; @@ -1385,24 +1324,6 @@ mdc_api_call_smoke_check(void) } n++; - - if ( ( pass ) && ( report_progress ) ) { - - progress_counter++; - - if ( progress_counter >= NUM_RANDOM_ACCESSES / 20 ) { - - progress_counter = 0; - HDfprintf(stdout, "."); - HDfflush(stdout); - } - } - } - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, " Done.\n"); /* random reads on all data sets */ - HDfflush(stdout); } @@ -1446,15 +1367,8 @@ mdc_api_call_smoke_check(void) /* do random reads on data set 0 only */ - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, "Doing random reads on dataset 0 "); - HDfflush(stdout); - } - m = 0; n = 0; - progress_counter = 0; while ( ( pass ) && ( n < NUM_RANDOM_ACCESSES ) ) { i = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; @@ -1532,31 +1446,6 @@ mdc_api_call_smoke_check(void) } n++; - - if ( ( pass ) && ( report_progress ) ) { - - progress_counter++; - - if ( progress_counter >= NUM_RANDOM_ACCESSES / 20 ) { - - progress_counter = 0; - HDfprintf(stdout, "."); - HDfflush(stdout); - } - } - } - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, " Done.\n"); /* random reads data set 0 */ - HDfflush(stdout); - } - - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Shutting down ... "); - HDfflush(stdout); } @@ -1616,13 +1505,6 @@ mdc_api_call_smoke_check(void) } } - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Done.\n"); /* shutting down */ - HDfflush(stdout); - } - - if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) @@ -2152,7 +2034,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* size_t max_size = */ (16 * 1024 * 1024), /* size_t min_size = */ ( 1 * 1024 * 1024), /* long int epoch_length = */ 50000, - /* enum H5C_cache_incr_mode incr_mode = */ -1, + /* enum H5C_cache_incr_mode incr_mode = */ (enum H5C_cache_incr_mode)-1, /* double lower_hr_threshold = */ 0.9, /* double increment = */ 2.0, /* hbool_t apply_max_increment = */ TRUE, @@ -2323,7 +2205,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ -1, + /* flash_incr_mode = */ (enum H5C_cache_flash_incr_mode)-1, /* double flash_multiple = */ 2.0, /* double flash_threshold = */ 0.5, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, @@ -2491,7 +2373,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* flash_incr_mode = */ H5C_flash_incr__off, /* double flash_multiple = */ 2.0, /* double flash_threshold = */ 0.5, - /* enum H5C_cache_decr_mode decr_mode = */ -1, + /* enum H5C_cache_decr_mode decr_mode = */ (enum H5C_cache_decr_mode)-1, /* double upper_hr_threshold = */ 0.999, /* double decrement = */ 0.9, /* hbool_t apply_max_decrement = */ TRUE, @@ -3532,6 +3414,7 @@ int main(void) { unsigned nerrs = 0; + int express_test; H5open(); @@ -3561,7 +3444,7 @@ main(void) nerrs += check_file_mdc_api_calls(); #endif #if 1 - nerrs += mdc_api_call_smoke_check(); + nerrs += mdc_api_call_smoke_check(express_test); #endif #if 1 nerrs += check_fapl_mdc_api_errs(); diff --git a/test/cache_common.c b/test/cache_common.c index e1757af..e786b61 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -23,7 +23,7 @@ #include <aio.h> #include "h5test.h" -#include "H5ACprivate.h" +#include "H5Cprivate.h" #include "H5Iprivate.h" #include "H5MFprivate.h" #include "H5MMprivate.h" @@ -66,19 +66,17 @@ hbool_t run_full_test = TRUE; hbool_t try_core_file_driver = TRUE; hbool_t core_file_driver_failed = FALSE; const char *failure_mssg = NULL; -int failures = 0; -int express_test = 0; - -test_entry_t pico_entries[NUM_PICO_ENTRIES]; -test_entry_t nano_entries[NUM_NANO_ENTRIES]; -test_entry_t micro_entries[NUM_MICRO_ENTRIES]; -test_entry_t tiny_entries[NUM_TINY_ENTRIES]; -test_entry_t small_entries[NUM_SMALL_ENTRIES]; -test_entry_t medium_entries[NUM_MEDIUM_ENTRIES]; -test_entry_t large_entries[NUM_LARGE_ENTRIES]; -test_entry_t huge_entries[NUM_HUGE_ENTRIES]; -test_entry_t monster_entries[NUM_MONSTER_ENTRIES]; -test_entry_t variable_entries[NUM_VARIABLE_ENTRIES]; + +static test_entry_t pico_entries[NUM_PICO_ENTRIES]; +static test_entry_t nano_entries[NUM_NANO_ENTRIES]; +static test_entry_t micro_entries[NUM_MICRO_ENTRIES]; +static test_entry_t tiny_entries[NUM_TINY_ENTRIES]; +static test_entry_t small_entries[NUM_SMALL_ENTRIES]; +static test_entry_t medium_entries[NUM_MEDIUM_ENTRIES]; +static test_entry_t large_entries[NUM_LARGE_ENTRIES]; +static test_entry_t huge_entries[NUM_HUGE_ENTRIES]; +static test_entry_t monster_entries[NUM_MONSTER_ENTRIES]; +static test_entry_t variable_entries[NUM_VARIABLE_ENTRIES]; static herr_t pico_get_load_size(const void *udata_ptr, size_t *image_len_ptr); static herr_t nano_get_load_size(const void *udata_ptr, size_t *image_len_ptr); @@ -271,7 +269,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = PICO_ENTRY_TYPE, "pico_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)pico_get_load_size, (H5C_deserialize_func_t)pico_deserialize, (H5C_image_len_func_t)pico_image_len, @@ -282,7 +280,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NANO_ENTRY_TYPE, "nano_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)nano_get_load_size, (H5C_deserialize_func_t)nano_deserialize, (H5C_image_len_func_t)nano_image_len, @@ -293,7 +291,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = MICRO_ENTRY_TYPE, "micro_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)micro_get_load_size, (H5C_deserialize_func_t)micro_deserialize, (H5C_image_len_func_t)micro_image_len, @@ -304,7 +302,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = TINY_ENTRY_TYPE, "tiny_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)tiny_get_load_size, (H5C_deserialize_func_t)tiny_deserialize, (H5C_image_len_func_t)tiny_image_len, @@ -315,7 +313,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = SMALL_ENTRY_TYPE, "small_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)small_get_load_size, (H5C_deserialize_func_t)small_deserialize, (H5C_image_len_func_t)small_image_len, @@ -326,7 +324,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = MEDIUM_ENTRY_TYPE, "medium_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)medium_get_load_size, (H5C_deserialize_func_t)medium_deserialize, (H5C_image_len_func_t)medium_image_len, @@ -337,7 +335,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = LARGE_ENTRY_TYPE, "large_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)large_get_load_size, (H5C_deserialize_func_t)large_deserialize, (H5C_image_len_func_t)large_image_len, @@ -348,7 +346,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = HUGE_ENTRY_TYPE, "huge_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)huge_get_load_size, (H5C_deserialize_func_t)huge_deserialize, (H5C_image_len_func_t)huge_image_len, @@ -359,7 +357,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = MONSTER_ENTRY_TYPE, "monster_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)monster_get_load_size, (H5C_deserialize_func_t)monster_deserialize, (H5C_image_len_func_t)monster_image_len, @@ -370,7 +368,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = VARIABLE_ENTRY_TYPE, "variable_entry", H5FD_MEM_DEFAULT, - H5AC__CLASS_NO_FLAGS_SET, + H5C__CLASS_NO_FLAGS_SET, (H5C_get_load_size_func_t)variable_get_load_size, (H5C_deserialize_func_t)variable_deserialize, (H5C_image_len_func_t)variable_image_len, @@ -379,7 +377,8 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = } }; -/* address translation funtions: */ + +/* address translation functions: */ /*------------------------------------------------------------------------- @@ -1715,7 +1714,7 @@ recommend_core_file_driver(void) /*------------------------------------------------------------------------- * Function: reset_entries * - * Purpose: reset the contents of the entries arrays to know values. + * Purpose: reset the contents of the entries arrays to known values. * * Return: void * @@ -2039,7 +2038,7 @@ verify_entry_status(H5C_t * cache_ptr, pass = FALSE; sprintf(msg, - "%d entry (%d, %d) size actualexpected = %ld/%ld.\n", + "%d entry (%d, %d) size actual/expected = %ld/%ld.\n", tag, (int)expected[i].entry_type, (int)expected[i].entry_index, @@ -2598,12 +2597,6 @@ takedown_cache(H5F_t * file_ptr, saved_cache = NULL; } - if ( H5F_addr_defined(saved_actual_base_addr) ) { - - H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, H5P_DEFAULT, saved_actual_base_addr, - (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); - saved_actual_base_addr = HADDR_UNDEF; - } } if ( saved_fapl_id != H5P_DEFAULT ) { @@ -2614,6 +2607,18 @@ takedown_cache(H5F_t * file_ptr, if ( saved_fid != -1 ) { + if ( H5F_addr_defined(saved_actual_base_addr) ) { + + if ( NULL == file_ptr ) { + file_ptr = (H5F_t *)H5I_object_verify(saved_fid, H5I_FILE); + HDassert ( file_ptr ); + } + + H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, H5P_DEFAULT, saved_actual_base_addr, + (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); + saved_actual_base_addr = HADDR_UNDEF; + } + if ( H5Fclose(saved_fid) < 0 ) { pass = FALSE; @@ -2730,38 +2735,31 @@ flush_cache(H5F_t * file_ptr, hbool_t dump_stats, hbool_t dump_detailed_stats) { - H5C_t * cache_ptr; - herr_t result = 0; - verify_unprotected(); - if ( pass ) { + if(pass) { + H5C_t * cache_ptr; + herr_t result = 0; HDassert(file_ptr); cache_ptr = file_ptr->shared->cache; - if ( destroy_entries ) { - + if(destroy_entries) result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); - } else { - + else result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); - } - } - - if ( dump_stats ) { - H5C_stats(cache_ptr, "test cache", dump_detailed_stats); - } - - if ( result < 0 ) { + if(dump_stats) + H5C_stats(cache_ptr, "test cache", dump_detailed_stats); - pass = FALSE; - failure_mssg = "error in H5C_flush_cache()."; + if(result < 0) { + pass = FALSE; + failure_mssg = "error in H5C_flush_cache()."; + } } return; @@ -2812,7 +2810,7 @@ insert_entry(H5F_t * file_ptr, HDassert( entry_ptr == entry_ptr->self ); HDassert( !(entry_ptr->is_protected) ); - insert_pinned = ((flags & H5C__PIN_ENTRY_FLAG) != 0 ); + insert_pinned = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0 ); entry_ptr->is_dirty = TRUE; @@ -2844,24 +2842,19 @@ insert_entry(H5F_t * file_ptr, (int)(entry_ptr->addr != entry_ptr->header.addr)); #endif } - HDassert( entry_ptr->cache_ptr == NULL ); + HDassert(entry_ptr->cache_ptr == NULL); entry_ptr->file_ptr = file_ptr; entry_ptr->cache_ptr = cache_ptr; - if ( insert_pinned ) { - - HDassert( entry_ptr->header.is_pinned ); - entry_ptr->is_pinned = TRUE; + if(insert_pinned) + HDassert(entry_ptr->header.is_pinned); + else + HDassert(!(entry_ptr->header.is_pinned)); + entry_ptr->is_pinned = insert_pinned; - } else { - - HDassert( ! ( entry_ptr->header.is_pinned ) ); - entry_ptr->is_pinned = FALSE; - - } - HDassert( entry_ptr->header.is_dirty ); - HDassert( ((entry_ptr->header).type)->id == type ); + HDassert(entry_ptr->header.is_dirty); + HDassert(((entry_ptr->header).type)->id == type); } return; @@ -3364,8 +3357,8 @@ unprotect_entry(H5F_t * file_ptr, HDassert( entry_ptr->header.is_protected ); HDassert( entry_ptr->is_protected ); - pin_flag_set = ((flags & H5C__PIN_ENTRY_FLAG) != 0 ); - unpin_flag_set = ((flags & H5C__UNPIN_ENTRY_FLAG) != 0 ); + pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0); + unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0); HDassert ( ! ( pin_flag_set && unpin_flag_set ) ); HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) ); @@ -3409,12 +3402,12 @@ unprotect_entry(H5F_t * file_ptr, if ( pin_flag_set ) { - HDassert ( entry_ptr->header.is_pinned ); + HDassert(entry_ptr->header.is_pinned); entry_ptr->is_pinned = TRUE; } else if ( unpin_flag_set ) { - HDassert ( ! ( entry_ptr->header.is_pinned ) ); + HDassert(!(entry_ptr->header.is_pinned)); entry_ptr->is_pinned = FALSE; } @@ -5027,6 +5020,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() @@ -5095,7 +5144,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 4a1a529..95ab0a9 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -19,17 +19,20 @@ * This file contains common #defines, type definitions, and * externs for tests of the cache implemented in H5C.c */ -#include "h5test.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" +#ifndef _CACHE_COMMON_H +#define _CACHE_COMMON_H #define H5C_PACKAGE /*suppress error about including H5Cpkg */ - -#include "H5Cpkg.h" - #define H5F_PACKAGE /*suppress error about including H5Fpkg */ +/* Include library header files */ +#include "H5ACprivate.h" +#include "H5Cpkg.h" #include "H5Fpkg.h" +#include "H5Iprivate.h" + +/* Include test header files */ +#include "h5test.h" #define NO_CHANGE -1 @@ -357,12 +360,12 @@ if ( ( (cache_ptr) == NULL ) || \ } -#define H5C_TEST__SEARCH_INDEX(cache_ptr, Addr, entry_ptr) \ +#define H5C_TEST__SEARCH_INDEX(cache_ptr, Addr, entry_ptr) \ { \ int k; \ int depth = 0; \ - H5C_TEST__PRE_HT_SEARCH_SC(cache_ptr, Addr) \ - k = H5C__HASH_FCN(Addr); \ + H5C_TEST__PRE_HT_SEARCH_SC(cache_ptr, Addr) \ + k = H5C__HASH_FCN(Addr); \ entry_ptr = ((cache_ptr)->index)[k]; \ while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) \ { \ @@ -371,7 +374,7 @@ if ( ( (cache_ptr) == NULL ) || \ } \ if ( entry_ptr ) \ { \ - H5C_TEST__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k) \ + H5C_TEST__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k) \ if ( entry_ptr != ((cache_ptr)->index)[k] ) \ { \ if ( (entry_ptr)->ht_next ) \ @@ -391,67 +394,38 @@ if ( ( (cache_ptr) == NULL ) || \ /* Macros used in H5AC level tests */ -#define CACHE_CONFIGS_EQUAL(a, b, cmp_set_init, cmp_init_size) \ -( ( (a).version == (b).version ) && \ - ( (a).rpt_fcn_enabled == (b).rpt_fcn_enabled ) && \ - ( (a).open_trace_file == (b).open_trace_file ) && \ - ( (a).close_trace_file == (b).close_trace_file ) && \ - ( ( (a).open_trace_file == FALSE ) || \ - ( strcmp((a).trace_file_name, (b).trace_file_name) == 0 ) ) && \ - ( (a).evictions_enabled == (b).evictions_enabled ) && \ - ( ( ! cmp_set_init ) || \ - ( (a).set_initial_size == (b).set_initial_size ) ) && \ - ( ( ! cmp_init_size ) || \ - ( (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 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 CACHE_CONFIGS_EQUAL(a, b, cmp_set_init, cmp_init_size) \ + ( ( (a).version == (b).version ) && \ + ( (a).rpt_fcn_enabled == (b).rpt_fcn_enabled ) && \ + ( (a).open_trace_file == (b).open_trace_file ) && \ + ( (a).close_trace_file == (b).close_trace_file ) && \ + ( ( (a).open_trace_file == FALSE ) || \ + ( strcmp((a).trace_file_name, (b).trace_file_name) == 0 ) ) && \ + ( (a).evictions_enabled == (b).evictions_enabled ) && \ + ( ( ! cmp_set_init ) || \ + ( (a).set_initial_size == (b).set_initial_size ) ) && \ + ( ( ! cmp_init_size ) || \ + ( (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) \ @@ -517,18 +491,6 @@ extern hbool_t run_full_test; extern hbool_t try_core_file_driver; extern hbool_t core_file_driver_failed; extern const char *failure_mssg; -extern int express_test; -extern int failures; - -extern test_entry_t pico_entries[NUM_PICO_ENTRIES]; -extern test_entry_t nano_entries[NUM_NANO_ENTRIES]; -extern test_entry_t micro_entries[NUM_MICRO_ENTRIES]; -extern test_entry_t tiny_entries[NUM_TINY_ENTRIES]; -extern test_entry_t small_entries[NUM_SMALL_ENTRIES]; -extern test_entry_t medium_entries[NUM_MEDIUM_ENTRIES]; -extern test_entry_t large_entries[NUM_LARGE_ENTRIES]; -extern test_entry_t huge_entries[NUM_HUGE_ENTRIES]; -extern test_entry_t monster_entries[NUM_MONSTER_ENTRIES]; extern test_entry_t * entries[NUMBER_OF_ENTRY_TYPES]; extern const int32_t max_indices[NUMBER_OF_ENTRY_TYPES]; @@ -743,6 +705,9 @@ void verify_unprotected(void); /*** H5AC level utility functions ***/ +hbool_t resize_configs_are_equal(const H5C_auto_size_ctl_t *a, + const H5C_auto_size_ctl_t *b, hbool_t compare_init); + void check_and_validate_cache_hit_rate(hid_t file_id, double * hit_rate_ptr, hbool_t dump_data, @@ -761,3 +726,5 @@ void validate_mdc_config(hid_t file_id, hbool_t compare_init, int test_num); +#endif /* _CACHE_COMMON_H */ + |