summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-20 12:43:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-20 12:43:30 (GMT)
commit83f50e5a722f7a58562a0885fef695f74bce7285 (patch)
tree604f4dad662be4824a77eb85cffa3639cd35a9de /test
parent02a23331992c618bb3cacb35bc0ea52f36ba1482 (diff)
downloadhdf5-83f50e5a722f7a58562a0885fef695f74bce7285.zip
hdf5-83f50e5a722f7a58562a0885fef695f74bce7285.tar.gz
hdf5-83f50e5a722f7a58562a0885fef695f74bce7285.tar.bz2
[svn-r18865] Description:
Bring r18864 from trunk to 1.8 branch: General cleanups to align metadata journaling branch and trunk Tested on: FreeBSD/32 6.3 (duty) in debug mode (h5committested on trunk)
Diffstat (limited to 'test')
-rw-r--r--test/cache_common.c127
-rw-r--r--test/cache_common.h93
-rw-r--r--test/ohdr.c18
3 files changed, 117 insertions, 121 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index 405a9ea..0d7df25 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -64,19 +64,84 @@ 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];
+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];
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 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 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 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 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);
+
test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] =
{
pico_entries,
@@ -276,6 +341,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
*
@@ -1672,25 +1738,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
*
*-------------------------------------------------------------------------
*/
@@ -1699,7 +1760,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;
@@ -1754,8 +1815,8 @@ resize_entry(H5F_t * file_ptr,
HDassert( entry_ptr->size = (entry_ptr->header).size );
}
- }
- }
+ }
+ }
} else {
protect_entry(file_ptr, type, idx);
@@ -2310,7 +2371,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,
@@ -2411,7 +2472,7 @@ setup_cache(size_t max_cache_size,
* Return: void
*
* Programmer: John Mainzer
- * 6/11/04
+ * 9/14/07
*
*-------------------------------------------------------------------------
*/
@@ -3014,10 +3075,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 ) {
@@ -3090,7 +3150,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;
@@ -3110,7 +3169,7 @@ unpin_entry(int32_t type,
HDassert( entry_ptr->header.is_pinned );
HDassert( entry_ptr->is_pinned );
- result = H5C_unpin_entry((void *)entry_ptr);
+ result = H5C_unpin_entry(entry_ptr);
if ( ( result < 0 ) ||
( entry_ptr->header.is_pinned ) ||
@@ -3912,7 +3971,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;
@@ -3947,7 +4006,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));
@@ -4090,8 +4149,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 88cf6f9..b801a87 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -413,16 +413,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];
@@ -437,75 +427,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 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 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);
-
-
-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);
-
-
-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);
-
/* callback table extern */
extern const H5C_class_t types[NUMBER_OF_ENTRY_TYPES];
@@ -549,9 +470,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,
@@ -574,10 +495,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 e416b80..6ae399d 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 */
char testpath[512] = "";
char testfile[512] = "";
char *srcdir = HDgetenv("srcdir");
@@ -580,6 +582,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