diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/cache_common.c | 137 | ||||
-rw-r--r-- | test/cache_common.h | 100 | ||||
-rw-r--r-- | test/ohdr.c | 18 |
3 files changed, 126 insertions, 129 deletions
diff --git a/test/cache_common.c b/test/cache_common.c index 68803ad..868b4d9 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -64,20 +64,93 @@ hbool_t try_core_file_driver = FALSE; hbool_t core_file_driver_failed = FALSE; const char *failure_mssg = NULL; -test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES]; -test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES]; -test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES]; -test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES]; -test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES]; -test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES]; -test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES]; -test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES]; -test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES]; -test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES]; -test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_NOTIFY_ENTRIES]; +static test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES]; +static test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES]; +static test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES]; +static test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES]; +static test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES]; +static test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES]; +static test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES]; +static test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES]; +static test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES]; +static test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES]; +static test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_NOTIFY_ENTRIES]; hbool_t orig_entry_arrays_init = FALSE; +static herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t small_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t large_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t notify_clear(H5F_t * f, void * thing, hbool_t dest); + +static herr_t pico_dest(H5F_t * f, void * thing); +static herr_t nano_dest(H5F_t * f, void * thing); +static herr_t micro_dest(H5F_t * f, void * thing); +static herr_t tiny_dest(H5F_t * f, void * thing); +static herr_t small_dest(H5F_t * f, void * thing); +static herr_t medium_dest(H5F_t * f, void * thing); +static herr_t large_dest(H5F_t * f, void * thing); +static herr_t huge_dest(H5F_t * f, void * thing); +static herr_t monster_dest(H5F_t * f, void * thing); +static herr_t variable_dest(H5F_t * f, void * thing); +static herr_t notify_dest(H5F_t * f, void * thing); + +static herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); + +static void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); + +static herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t notify_size(H5F_t * f, void * thing, size_t * size_ptr); + +static herr_t notify_notify(H5C_notify_action_t action, void *thing); + test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] = { pico_entries, @@ -304,6 +377,7 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, /* address translation funtions: */ + /*------------------------------------------------------------------------- * Function: addr_to_type_and_index * @@ -1816,25 +1890,20 @@ reset_entries(void) /*------------------------------------------------------------------------- - * Function: resize_entry + * Function: resize_entry * - * Purpose: Given a pointer to a cache, an entry type, an index, and + * Purpose: Given a pointer to a cache, an entry type, an index, and * a new size, set the size of the target entry to the new size. * * Note that at present, the type of the entry must be * VARIABLE_ENTRY_TYPE. * - * If the in_cache parameter is true, verify that the - * target entry is in the cache. If it - * isn't, scream and die. If it is, use the - * H5C_resize_entry() call to resize it. - * - * Do nothing if pass is false on entry. + * Do nothing if pass is false on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer - * 6/10/04 + * Programmer: John Mainzer + * 1/11/08 * *------------------------------------------------------------------------- */ @@ -1843,7 +1912,7 @@ void resize_entry(H5F_t * file_ptr, int32_t type, int32_t idx, - size_t new_size, + size_t new_size, hbool_t in_cache) { test_entry_t * base_addr; @@ -1898,8 +1967,8 @@ resize_entry(H5F_t * file_ptr, HDassert( entry_ptr->size = (entry_ptr->header).size ); } - } - } + } + } } else { protect_entry(file_ptr, type, idx); @@ -2574,7 +2643,7 @@ setup_cache(size_t max_cache_size, cache_ptr = H5C_create(max_cache_size, min_clean_size, (NUMBER_OF_ENTRY_TYPES - 1), - (const char **)entry_type_names, + (const char **)entry_type_names, check_write_permitted, TRUE, NULL, @@ -2675,7 +2744,7 @@ setup_cache(size_t max_cache_size, * Return: void * * Programmer: John Mainzer - * 6/11/04 + * 9/14/07 * *------------------------------------------------------------------------- */ @@ -3279,10 +3348,9 @@ protect_entry_ro(H5F_t * file_ptr, int32_t type, int32_t idx) { - /* const char * fcn_name = "protect_entry_ro()"; */ H5C_t *cache_ptr; - test_entry_t * base_addr; - test_entry_t * entry_ptr; + test_entry_t *base_addr; + test_entry_t *entry_ptr; H5C_cache_entry_t * cache_entry_ptr; if ( pass ) { @@ -3416,7 +3484,6 @@ void unpin_entry(int32_t type, int32_t idx) { - /* const char * fcn_name = "unpin_entry()"; */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3437,7 +3504,7 @@ unpin_entry(int32_t type, HDassert( entry_ptr->is_pinned ); HDassert( entry_ptr->pinned_from_client ); - result = H5C_unpin_entry((void *)entry_ptr); + result = H5C_unpin_entry(entry_ptr); if ( ( result < 0 ) || ( entry_ptr->header.pinned_from_client ) || @@ -4244,7 +4311,7 @@ row_major_scan_backward(H5F_t * file_ptr, } else { unprotect_entry(file_ptr, type, idx + lag, - (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } break; @@ -4279,7 +4346,7 @@ row_major_scan_backward(H5F_t * file_ptr, ( ( idx + lag) <= max_indices[type] ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); unprotect_entry(file_ptr, type, idx + lag, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); @@ -4422,8 +4489,6 @@ hl_row_major_scan_backward(H5F_t * file_ptr, * Programmer: John Mainzer * 6/23/04 * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/test/cache_common.h b/test/cache_common.h index 67228eb..d828304 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -450,16 +450,6 @@ extern hbool_t skip_long_tests; extern hbool_t run_full_test; extern const char *failure_mssg; -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]; extern const size_t entry_sizes[NUMBER_OF_ENTRY_TYPES]; @@ -474,82 +464,6 @@ herr_t check_write_permitted(const H5F_t * f, hid_t dxpl_id, hbool_t * write_permitted_ptr); -herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t small_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t large_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t notify_clear(H5F_t * f, void * thing, hbool_t dest); - - -herr_t pico_dest(H5F_t * f, void * thing); -herr_t nano_dest(H5F_t * f, void * thing); -herr_t micro_dest(H5F_t * f, void * thing); -herr_t tiny_dest(H5F_t * f, void * thing); -herr_t small_dest(H5F_t * f, void * thing); -herr_t medium_dest(H5F_t * f, void * thing); -herr_t large_dest(H5F_t * f, void * thing); -herr_t huge_dest(H5F_t * f, void * thing); -herr_t monster_dest(H5F_t * f, void * thing); -herr_t variable_dest(H5F_t * f, void * thing); -herr_t notify_dest(H5F_t * f, void * thing); - - -herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); - - -void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); - - -herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t notify_size(H5F_t * f, void * thing, size_t * size_ptr); - -herr_t notify_notify(H5C_notify_action_t action, void *thing); /* callback table extern */ @@ -595,9 +509,9 @@ void mark_entry_dirty(int32_t type, int32_t idx); void move_entry(H5C_t * cache_ptr, - int32_t type, - int32_t idx, - hbool_t main_addr); + int32_t type, + int32_t idx, + hbool_t main_addr); void protect_entry(H5F_t * file_ptr, int32_t type, @@ -623,10 +537,10 @@ void create_pinned_entry_dependency(H5F_t * file_ptr, void reset_entries(void); void resize_entry(H5F_t * file_ptr, - int32_t type, - int32_t idx, - size_t new_size, - hbool_t in_cache); + int32_t type, + int32_t idx, + size_t new_size, + hbool_t in_cache); H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size); diff --git a/test/ohdr.c b/test/ohdr.c index ad83ec1..37699e5 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -500,6 +500,8 @@ main(void) HDputs("Accessing objects with unknown header messages:"); { hid_t file2; /* File ID for 'bogus' object file */ + hid_t sid; /* Dataspace ID */ + hid_t aid; /* Attribute ID */ const char *testfile = H5_get_srcdir_filename(FILE_BOGUS); TESTING("object with unknown header message and no flags set"); @@ -567,6 +569,22 @@ main(void) if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) TEST_ERROR + /* Create data space */ + if((sid = H5Screate(H5S_SCALAR)) < 0) + FAIL_STACK_ERROR + + /* Create an attribute, to get the object header into write access */ + if((aid = H5Acreate2(dset, "Attr", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close dataspace */ + if(H5Sclose(sid) < 0) + FAIL_STACK_ERROR + + /* Close attribute */ + if(H5Aclose(aid) < 0) + FAIL_STACK_ERROR + /* Close the dataset */ if(H5Dclose(dset) < 0) TEST_ERROR |