summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-06-28 21:13:36 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-06-28 21:13:36 (GMT)
commit2042c775f0d9240609527e621d84e4911ad7f6a5 (patch)
treeb90dd86bd7d25534102b6e929d9cbbdf01c77389 /test
parentd5130bb57332ce0049302c5836bbf666b23513cd (diff)
parent13d951d37205bcd48723330a898e5d67c5e1ecb2 (diff)
downloadhdf5-2042c775f0d9240609527e621d84e4911ad7f6a5.zip
hdf5-2042c775f0d9240609527e621d84e4911ad7f6a5.tar.gz
hdf5-2042c775f0d9240609527e621d84e4911ad7f6a5.tar.bz2
Merge branch 'develop' into feature/update_gcc_flags
Diffstat (limited to 'test')
-rw-r--r--test/cache_image.c29
-rw-r--r--test/cache_tagging.c23
-rw-r--r--test/fheap.c57
-rw-r--r--test/mf.c59
-rw-r--r--test/titerate.c2
-rw-r--r--test/tselect.c1
-rw-r--r--test/tsohm.c78
7 files changed, 106 insertions, 143 deletions
diff --git a/test/cache_image.c b/test/cache_image.c
index ee49502..f8252ac 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -93,6 +93,7 @@ static unsigned evict_on_close_test(hbool_t single_file_vfd);
#define DSET_SIZE (40 * CHUNK_SIZE)
#define MAX_NUM_DSETS 256
+
static void
create_datasets(hid_t file_id, int min_dset, int max_dset)
{
@@ -3717,8 +3718,7 @@ cache_image_smoke_check_2(hbool_t single_file_vfd)
if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
/* 4) Open the file.
*
* Verify that the metadata cache is instructed to load the
@@ -4486,6 +4486,7 @@ cache_image_smoke_check_4(hbool_t single_file_vfd)
if ( show_progress )
HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n",
fcn_name, cp + 2, max_dset, pass);
+
} /* end while */
cp += 3;
@@ -4638,7 +4639,6 @@ cache_image_smoke_check_4(hbool_t single_file_vfd)
FUNC, failure_mssg);
return !pass;
-
} /* cache_image_smoke_check_4() */
@@ -5111,8 +5111,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd)
* extension message has been deleted.
*/
i = min_group;
- while ( ( pass ) && ( i <= max_group ) ) {
-
+ while ( ( pass ) && ( i <= max_group ) ) {
sprintf(process_group_name, "/process_%d", i);
validate_zoo(file_id, process_group_name, i++);
}
@@ -7513,10 +7512,9 @@ get_free_sections_test(hbool_t single_file_vfd)
/* file_ptr->shared->first_alloc_dealloc is set to FALSE if the
* file is opened R/O.
*/
- if ( ( file_ptr->shared->first_alloc_dealloc ) ||
- ( ! H5F_addr_defined(file_ptr->shared->eoa_pre_fsm_fsalloc) ) ||
+ if ( ( ! H5F_addr_defined(file_ptr->shared->eoa_fsm_fsalloc) ) ||
( ! H5F_addr_defined(file_ptr->shared->cache->image_addr) ) ||
- ( H5F_addr_gt(file_ptr->shared->eoa_pre_fsm_fsalloc,
+ ( H5F_addr_gt(file_ptr->shared->eoa_fsm_fsalloc,
file_ptr->shared->cache->image_addr) ) ) {
pass = FALSE;
@@ -7554,11 +7552,8 @@ get_free_sections_test(hbool_t single_file_vfd)
pass = FALSE;
failure_mssg = "cache image not loaded (1).\n";
- } else if ( file_ptr->shared->first_alloc_dealloc ) {
+ }
- pass = FALSE;
- failure_mssg = "self referential FSMs not floated (1).\n";
- }
}
if ( show_progress )
@@ -7634,10 +7629,9 @@ get_free_sections_test(hbool_t single_file_vfd)
*/
if ( pass ) {
- if ( ( ! file_ptr->shared->first_alloc_dealloc ) ||
- ( ! H5F_addr_defined(file_ptr->shared->eoa_pre_fsm_fsalloc) ) ||
+ if ( ( ! H5F_addr_defined(file_ptr->shared->eoa_fsm_fsalloc) ) ||
( ! H5F_addr_defined(file_ptr->shared->cache->image_addr) ) ||
- ( H5F_addr_gt(file_ptr->shared->eoa_pre_fsm_fsalloc,
+ ( H5F_addr_gt(file_ptr->shared->eoa_fsm_fsalloc,
file_ptr->shared->cache->image_addr) ) ) {
pass = FALSE;
@@ -7675,11 +7669,8 @@ get_free_sections_test(hbool_t single_file_vfd)
pass = FALSE;
failure_mssg = "cache image not loaded (2).\n";
- } else if ( file_ptr->shared->first_alloc_dealloc ) {
+ }
- pass = FALSE;
- failure_mssg = "self referential FSMs not floated (2).\n";
- }
}
if ( show_progress )
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 734c760..dd886eb 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -1664,21 +1664,11 @@ check_attribute_rename_tags(hid_t fcpl, int type)
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
/*
- * 3 calls to verify_tag() for verifying free space:
- * one freespace header tag for H5FD_MEM_DRAW manager,
- * one freespace header tag for H5FD_MEM_SUPER manager
- * one freespace section info tag for H5FD_MEM_SUPER manager
+ * one freespace header tag for H5FD_MEM_DRAW manager,
+ * one freespace header tag for H5FD_MEM_SUPER manager
*/
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
-
- /* If the free space managers are persistent, the
- * H5MF_tidy_self_referential_fsm_hack() must have been run.
- * Since this function floats all self referential free space
- * managers, the H5FD_MEM_SUPER FSM will not be in the metadata
- * cache.
- */
- if(!persistent_fsms && verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0) TEST_ERROR;
- if(!persistent_fsms && verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0) TEST_ERROR;
+ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
/* verify btree header and leaf node belonging to group */
if ( verify_tag(fid, H5AC_BT2_HDR_ID, g_tag) < 0 ) TEST_ERROR;
@@ -1828,13 +1818,16 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/*
* 2 calls to verify_tag() for verifying free space:
- * one freespace header tag for free-space header,
- * one freespace header tag for free-space section info
+ * one freespace header tag for free-space header raw data
+ * one freespace header tag for free-space section info raw data
+ * one freespace header tag for free-space header metadata
*/
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
TEST_ERROR;
if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 )
TEST_ERROR;
+ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
+ TEST_ERROR;
#if 0
/* If the free space managers are persistent, the
diff --git a/test/fheap.c b/test/fheap.c
index 846f03e..557fd37 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -1904,7 +1904,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh) < 0)
+ if((fh = H5HF_close(fh)) < 0)
FAIL_STACK_ERROR
/* Delete heap */
@@ -6643,7 +6643,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh) < 0)
+ if((fh = H5HF_close(fh)) < 0)
TEST_ERROR
/* Close the file */
@@ -6834,7 +6834,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh) < 0)
+ if((fh = H5HF_close(fh)) < 0)
TEST_ERROR
/* Close the file */
@@ -7001,7 +7001,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh) < 0)
+ if((fh = H5HF_close(fh)) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -7239,7 +7239,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh) < 0)
+ if((fh = H5HF_close(fh)) < 0)
TEST_ERROR
/* Close the file */
@@ -7541,7 +7541,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh) < 0)
+ if((fh = H5HF_close(fh)) < 0)
TEST_ERROR
/* Close the file */
@@ -13683,23 +13683,23 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
haddr_t fh_addr; /* Address of fractal heap */
- H5HF_create_t tmp_cparam; /* Local heap creation parameters */
- fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */
- size_t id_len; /* Size of fractal heap IDs */
- h5_stat_size_t empty_size; /* Size of a file with an empty heap */
- h5_stat_size_t file_size; /* Size of file currently */
- unsigned char *heap_id = NULL; /* Heap ID for object */
- size_t obj_size; /* Size of object */
- size_t robj_size; /* Size of object read */
- unsigned char obj_type; /* Type of storage for object */
- fheap_heap_state_t state; /* State of fractal heap */
- unsigned deflate_level; /* Deflation level */
- size_t old_actual_id_len =0 ; /* Old actual ID length */
- hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
- const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */
+ H5HF_create_t tmp_cparam; /* Local heap creation parameters */
+ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */
+ size_t id_len; /* Size of fractal heap IDs */
+ h5_stat_size_t empty_size; /* Size of a file with an empty heap */
+ h5_stat_size_t file_size; /* Size of file currently */
+ unsigned char *heap_id = NULL; /* Heap ID for object */
+ size_t obj_size; /* Size of object */
+ size_t robj_size; /* Size of object read */
+ unsigned char obj_type; /* Type of storage for object */
+ fheap_heap_state_t state; /* State of fractal heap */
+ unsigned deflate_level; /* Deflation level */
+ size_t old_actual_id_len =0 ; /* Old actual ID length */
+ hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
+ const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */
- /* Copy heap creation properties */
- HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
+ /* Copy heap creation properties */
+ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
/* Set an I/O filter for heap data */
deflate_level = 6;
@@ -13867,7 +13867,9 @@ error:
H5MM_xfree(heap_id);
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ if(&tmp_cparam.pline)
+ H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_filtered_huge() */
@@ -15571,9 +15573,12 @@ error:
H5MM_xfree(keep_ids.ids);
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
+
+ if(tparam->comp == FHEAP_TEST_COMPRESS)
+ H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_random() */
@@ -15789,7 +15794,9 @@ error:
H5MM_xfree(keep_ids.offs);
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ if(tparam->comp == FHEAP_TEST_COMPRESS)
+ H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_random_pow2() */
diff --git a/test/mf.c b/test/mf.c
index 4dccae6..8c17df5 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -6822,16 +6822,6 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if(!H5F_addr_defined(f->shared->fs_addr[tt]))
TEST_ERROR
- /* Since we are about to open a self referential free space
- * manager prior to the first file space allocation / deallocation
- * call H5MF_tidy_self_referential_fsm_hack() first so as to avoid
- * assertion failures on the first file space alloc / dealloc.
- */
- if((f->shared->first_alloc_dealloc) &&
- (SUCCEED !=
- H5MF_tidy_self_referential_fsm_hack(f)))
- FAIL_STACK_ERROR
-
/* Start up H5FD_MEM_SUPER free-space manager */
if(!(f->shared->fs_man[tt]))
if(H5MF__open_fstype(f, (H5F_mem_page_t)tt) < 0)
@@ -6925,7 +6915,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
haddr_t addrx;
H5FD_mem_t fs_type;
hbool_t contig_addr_vfd;
- hbool_t ran_H5MF_tidy_self_referential_fsm_hack = FALSE;
+
if(new_format)
TESTING("File's free-space is going away with new library format")
@@ -6944,9 +6934,13 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Copy the file access property list */
if((fapl2 = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR
- if(new_format)
+ if(new_format) {
if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
FAIL_STACK_ERROR
+ } else {
+ if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0)
+ FAIL_STACK_ERROR
+ }
/* Set to aggregation and persisting free-space */
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
@@ -7022,17 +7016,6 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if(!H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
- /* Since we are about to open a self referential free space
- * manager prior to the first file space allocation / deallocation
- * call H5MF_tidy_self_referential_fsm_hack() first so as to avoid
- * assertion failures on the first file space alloc / dealloc.
- */
- if(f->shared->first_alloc_dealloc){
- if(SUCCEED != H5MF_tidy_self_referential_fsm_hack(f))
- FAIL_STACK_ERROR
- ran_H5MF_tidy_self_referential_fsm_hack = TRUE;
- }
-
/* Start up H5FD_MEM_SUPER free-space manager */
if(!(f->shared->fs_man[fs_type]))
if(H5MF__open_fstype(f, (H5F_mem_page_t)fs_type) < 0)
@@ -7042,24 +7025,18 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if(H5FS_stat_info(f, f->shared->fs_man[fs_type], &fs_stat) < 0)
FAIL_STACK_ERROR
- /* if we ran H5MF_tidy_self_referential_fsm_hack(), the
- * H5FD_MEM_SUPER free space manager must be floating.
- * Thus fs_stat.addr must be undefined.
- */
- if((!ran_H5MF_tidy_self_referential_fsm_hack) &&
- (!H5F_addr_defined(fs_stat.addr)))
+ if(!H5F_addr_defined(fs_stat.addr))
TEST_ERROR
if(fs_stat.tot_space < TBLOCK_SIZE3)
TEST_ERROR
- /* Put block #4 to H5FD_MEM_SUPER free-space manager */
- if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0)
- FAIL_STACK_ERROR
-
- if(!new_format) {
- /* Need to take up this space so that the free-space manager will go away */
- if(HADDR_UNDEF == (addrx = H5MF_alloc(f, type, (hsize_t)103)))
+ /* Allocate/free space accordingly so that the free-space manager will go away */
+ if(new_format) {
+ if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0)
+ FAIL_STACK_ERROR
+ } else {
+ if(HADDR_UNDEF == (addrx = H5MF_alloc(f, type, (hsize_t)3)))
FAIL_STACK_ERROR
}
@@ -7741,16 +7718,6 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if(!H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
- /* Since we are about to open a self referential free space
- * manager prior to the first file space allocation / deallocation
- * call H5MF_tidy_self_referential_fsm_hack() first so as to avoid
- * assertion failures on the first file space alloc / dealloc.
- */
- if(f->shared->first_alloc_dealloc){
- if(SUCCEED != H5MF_tidy_self_referential_fsm_hack(f))
- FAIL_STACK_ERROR
- }
-
/* Set up to use the small metadata manager */
if(!(f->shared->fs_man[fs_type]))
if(H5MF__open_fstype(f, fs_type) < 0)
diff --git a/test/titerate.c b/test/titerate.c
index 54e9b5e..716654d 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -939,7 +939,7 @@ static void test_links(hid_t fapl)
*-------------------------------------------------------------------------
*/
static int
-find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data)
+find_err_msg_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *_client_data)
{
int status = H5_ITER_CONT;
searched_err_t *searched_err = (searched_err_t *)_client_data;
diff --git a/test/tselect.c b/test/tselect.c
index ad435cb..bbab868 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -14925,7 +14925,6 @@ test_sel_iter(void)
hid_t sid; /* Dataspace ID */
hid_t iter_id; /* Dataspace selection iterator ID */
hsize_t dims1[] = {6, 12}; /* 2-D Dataspace dimensions */
- hsize_t dims2[] = {32}; /* 1-D dataspace dimensions */
hsize_t coord1[POINT1_NPOINTS][2]; /* Coordinates for point selection */
hsize_t start[2]; /* Hyperslab start */
hsize_t stride[2]; /* Hyperslab stride */
diff --git a/test/tsohm.c b/test/tsohm.c
index 8cf4d2f..99df6b7 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -11,13 +11,9 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/***********************************************************
-*
-* Test program: tsohm
-*
-* Test Shared Object Header Messages
-*
-*************************************************************/
+/*
+ * Purpose: Test Shared Object Header Messages
+ */
#include "testhdf5.h"
@@ -582,12 +578,12 @@ error:
*
* Purpose: Creates object headers that use a large datatype message.
*
- * Set test_file_closing to 1 to add file closing and reopening
+ * Set test_file_closing to TRUE to add file closing and reopening
* whenever possible (to test that SOHMs are written correctly
* on disk and not just in memory).
*
- * Return: Success: file ID (may not be the same one passed in)
- * Failure: Negative
+ * Return: Success: file ID (may not be the same one passed in)
+ * Failure: H5I_INVALID_HID
*
* Programmer: James Laird
* Monday, April 10, 2006
@@ -595,13 +591,13 @@ error:
*-------------------------------------------------------------------------
*/
static hid_t
-size1_helper(hid_t file, const char *filename, hid_t fapl_id, unsigned test_file_closing)
+size1_helper(hid_t file, const char *filename, hid_t fapl_id, hbool_t test_file_closing)
{
dtype1_struct wdata;
dtype1_struct rdata;
- hid_t dtype1_id = -1;
- hid_t space_id = -1;
- hid_t dset_id = -1;
+ hid_t dtype1_id = H5I_INVALID_HID;
+ hid_t space_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
hsize_t dim1[1];
int x;
@@ -635,7 +631,7 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, unsigned test_file
* local disks. Don't close and reopen if express testing is enabled.
*/
if(GetTestExpress() > 1)
- test_file_closing = 0;
+ test_file_closing = FALSE;
/* Intialize wdata */
HDmemset(&wdata, 0, sizeof(wdata));
@@ -718,6 +714,7 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, unsigned test_file
if(H5Dclose(dset_id) < 0) TEST_ERROR
if(H5Tclose(dtype1_id) < 0) TEST_ERROR
+
return file;
error:
@@ -727,7 +724,8 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, unsigned test_file
H5Dclose(dset_id);
H5Fclose(file);
} H5E_END_TRY
- return -1;
+
+ return H5I_INVALID_HID;
#undef TSOHM_S1H_VERIFY_DATA /* macro is exclusive to this function */
} /* size1_helper */
@@ -744,25 +742,30 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, unsigned test_file
*----------------------------------------------------------------------------
*/
static h5_stat_size_t
-getsize_testsize1(const char *filename, hid_t fcpl_id, hid_t fapl_id, unsigned open_close, H5O_info_t *oinfo)
+getsize_testsize1(const char *filename, hid_t fcpl_id, hid_t fapl_id,
+ hbool_t test_file_closing, H5O_info_t *oinfo)
{
- hid_t file = -1;
+ hid_t fid = H5I_INVALID_HID;
herr_t ret;
- file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- CHECK_I(file, "H5Fcreate");
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
- file = size1_helper(file, filename, fapl_id, open_close);
- CHECK_I(file, "size1_helper");
+ /* If test_file_closing is TRUE, you will get back a different ID,
+ * which will need to be closed. The helper will close your passed-in
+ * ID.
+ */
+ fid = size1_helper(fid, filename, fapl_id, test_file_closing);
+ CHECK(fid, H5I_INVALID_HID, "size1_helper");
- ret = H5Oget_info_by_name2(file, DSETNAME[0], oinfo, H5O_INFO_HDR, H5P_DEFAULT);
- CHECK_I(ret, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name2(fid, DSETNAME[0], oinfo, H5O_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
return h5_get_file_size(filename, fapl_id);
-} /* getsize_testsize1 */
+} /* getsize_testsize1() */
/*-------------------------------------------------------------------------
@@ -784,7 +787,6 @@ test_sohm_size1(void)
unsigned use_shared = 0;
unsigned use_btree = 0;
- unsigned open_close = 0;
h5_stat_size_t file_sizes[9];
unsigned size_index = 0;
hsize_t oh_sizes[3];
@@ -827,6 +829,7 @@ test_sohm_size1(void)
for (use_shared = 0; use_shared < 2; use_shared++) {
for (use_btree = 0; use_btree < 2; use_btree++) {
+ hbool_t test_open_close;
/* cannot use btree indexing without shared messages; skip case */
if (use_btree && !use_shared)
@@ -862,8 +865,10 @@ test_sohm_size1(void)
file_sizes[size_index++] = h5_get_file_size(FILENAME, fapl_id);
/* size of populated file, with different populating behaviors */
- for (open_close = 0; open_close < 2; open_close++)
- file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, open_close, &oinfo);
+ test_open_close = TRUE;
+ file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, test_open_close, &oinfo);
+ test_open_close = FALSE;
+ file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, test_open_close, &oinfo);
oh_sizes[oh_size_index++] = oinfo.hdr.space.total;
ret = H5Pclose(fcpl_id);
@@ -960,6 +965,7 @@ test_sohm_size1(void)
*
*---------------------------------------------------------------------------
*/
+#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */
static void
test_sohm_size_consistency_open_create(void)
{
@@ -1015,7 +1021,7 @@ test_sohm_size_consistency_open_create(void)
* Add messages to previously-created file */
file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
CHECK_I(file, "H5Fopen");
- file = size1_helper(file, FILENAME, fapl_id, 0);
+ file = size1_helper(file, FILENAME, fapl_id, FALSE);
CHECK_I(file, "size1_helper");
/* Get the size of a dataset object header */
@@ -1030,7 +1036,7 @@ test_sohm_size_consistency_open_create(void)
* Add messages to a newly-created file */
file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
CHECK_I(file, "H5Fcreate");
- file = size1_helper(file, FILENAME, fapl_id, 0);
+ file = size1_helper(file, FILENAME, fapl_id, FALSE);
CHECK_I(file, "size1_helper");
/* Get the size of a dataset object header */
@@ -1181,8 +1187,8 @@ sohm_attr_helper(hid_t fcpl_id)
static void
test_sohm_attrs(void)
{
- hid_t fcpl_id;
- hid_t file_id;
+ hid_t bad_fid = H5I_INVALID_HID;
+ hid_t fcpl_id = H5I_INVALID_HID;
unsigned i = 0;
#define TSOHM_TSA_NFLAGS_1 7
unsigned flags1[TSOHM_TSA_NFLAGS_1] = {
@@ -1300,8 +1306,8 @@ test_sohm_attrs(void)
ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_SHMESG_ATTR_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
- VERIFY(file_id, -1, "H5Fcreate");
+ bad_fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
+ VERIFY(bad_fid, H5I_INVALID_HID, "H5Fcreate");
ret = H5Pclose(fcpl_id);
CHECK_I(ret, "H5Pclose");