summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-03-11 01:44:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-03-11 01:44:36 (GMT)
commit828e7e2416b3193b5964c0ab13b95a605088bd02 (patch)
treea9b7ab02a83f4df9c58444f7c6961da3b8d8aa6a /test
parentddf384fb35052913970bcabd7b247f4280be08fc (diff)
downloadhdf5-828e7e2416b3193b5964c0ab13b95a605088bd02.zip
hdf5-828e7e2416b3193b5964c0ab13b95a605088bd02.tar.gz
hdf5-828e7e2416b3193b5964c0ab13b95a605088bd02.tar.bz2
[svn-r16566] Description:
Bring r16560 back from trunk. Tested on: Mac OS X/32 10.5.6 (amazon) debug & production (Following up with tests on more platforms)
Diffstat (limited to 'test')
-rw-r--r--test/cache.c2
-rw-r--r--test/cache_common.c2
-rw-r--r--test/dsets.c13
-rw-r--r--test/dt_arith.c20
-rw-r--r--test/dtransform.c30
-rw-r--r--test/dtypes.c27
-rw-r--r--test/enum.c25
-rw-r--r--test/error_test.c4
-rw-r--r--test/fillval.c4
-rw-r--r--test/freespace.c13
-rw-r--r--test/getname.c35
-rw-r--r--test/h5test.c27
-rw-r--r--test/links.c69
-rw-r--r--test/mf.c122
-rw-r--r--test/mount.c11
-rw-r--r--test/trefstr.c1
-rw-r--r--test/tselect.c28
-rw-r--r--test/tsohm.c29
18 files changed, 225 insertions, 237 deletions
diff --git a/test/cache.c b/test/cache.c
index 8c1e328..f647f6e 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -15734,7 +15734,6 @@ check_evictions_enabled(void)
hbool_t in_cache;
int i;
int mile_stone = 1;
- size_t entry_size;
H5C_t * cache_ptr = NULL;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -15791,7 +15790,6 @@ check_evictions_enabled(void)
(size_t)( 512 * 1024));
base_addr = entries[MONSTER_ENTRY_TYPE];
- entry_size = MONSTER_ENTRY_SIZE;
}
if ( show_progress ) /* 2 */
diff --git a/test/cache_common.c b/test/cache_common.c
index 39131bf..4595d7c 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -1755,7 +1755,7 @@ resize_pinned_entry(H5C_t * cache_ptr,
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) );
- HDassert( type = VARIABLE_ENTRY_TYPE ) ;
+ HDassert( type == VARIABLE_ENTRY_TYPE ) ;
HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes[type] ) );
if ( pass ) {
diff --git a/test/dsets.c b/test/dsets.c
index e95e8af..060816d 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -5732,24 +5732,16 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_filters_endianess(hid_t fapl)
+test_filters_endianess(void)
{
hid_t fid=-1; /* file ID */
hid_t dsid=-1; /* dataset ID */
hid_t sid=-1; /* dataspace ID */
hid_t dcpl=-1; /* dataset creation property list ID */
- hsize_t dims[1]={2}; /* dataspace dimensions */
- hsize_t chunk_dims[1]={2}; /* chunk dimensions */
- int buf[2];
- int rank=1;
int i;
char *srcdir = getenv("srcdir"); /* the source directory */
char data_file[512]=""; /* buffer to hold name of existing file */
- for(i=0; i<2; i++){
- buf[i]=1;
- }
-
TESTING("filters with big-endian/little-endian data");
#if defined H5_HAVE_FILTER_FLETCHER32
@@ -6724,7 +6716,6 @@ test_big_chunks_bypass_cache(hid_t fapl)
static int wdata[BYPASS_CHUNK_DIM/2], rdata1[BYPASS_DIM],
rdata2[BYPASS_CHUNK_DIM/2];
int i, j;
- herr_t ret; /* Generic return value */
TESTING("big chunks bypassing the cache");
@@ -6966,7 +6957,7 @@ main(void)
nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0);
nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0);
nerrors += (test_filter_delete(file) < 0 ? 1 : 0);
- nerrors += (test_filters_endianess(my_fapl) < 0 ? 1 : 0);
+ nerrors += (test_filters_endianess() < 0 ? 1 : 0);
nerrors += (test_zero_dims(file) < 0 ? 1 : 0);
nerrors += (test_missing_chunk(file) < 0 ? 1 : 0);
nerrors += (test_random_chunks(my_fapl) < 0 ? 1 : 0);
diff --git a/test/dt_arith.c b/test/dt_arith.c
index e507fd0..6c59555 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -617,12 +617,10 @@ generates_sigfpe(void)
static int
test_hard_query(void)
{
- htri_t ret;
-
TESTING("query functions of compiler conversion");
/* Verify the conversion from int to float is a hard conversion. */
- if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=TRUE) {
+ if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) {
H5_FAILED();
printf("Can't query conversion function\n");
goto error;
@@ -631,7 +629,7 @@ test_hard_query(void)
/* Unregister the hard conversion from int to float. Verify the conversion
* is a soft conversion. */
H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float);
- if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=FALSE) {
+ if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != FALSE) {
H5_FAILED();
printf("Can't query conversion function\n");
goto error;
@@ -640,7 +638,7 @@ test_hard_query(void)
/* Register the hard conversion from int to float. Verify the conversion
* is a hard conversion. */
H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float);
- if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=TRUE) {
+ if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) {
H5_FAILED();
printf("Can't query conversion function\n");
goto error;
@@ -676,19 +674,18 @@ static H5T_conv_ret_t
expt_handle(H5T_conv_except_t except_type, hid_t UNUSED src_id, hid_t UNUSED dst_id, void UNUSED *src_buf,
void *dst_buf, void *user_data)
{
- H5T_conv_ret_t ret = H5T_CONV_HANDLED;
signed char fill_value1 = 7;
int fill_value2 = 13;
if(except_type == H5T_CONV_EXCEPT_RANGE_HI || except_type == H5T_CONV_EXCEPT_RANGE_LOW ||
- except_type == H5T_CONV_EXCEPT_TRUNCATE) {
+ except_type == H5T_CONV_EXCEPT_TRUNCATE) {
if(*(hbool_t*)user_data)
*(signed char*)dst_buf = fill_value1;
else
*(int*)dst_buf = fill_value2;
- }
+ } /* end if */
- return ret;
+ return H5T_CONV_HANDLED;
}
@@ -2710,7 +2707,6 @@ my_isinf(int endian, unsigned char *val, size_t size,
unsigned char *bits;
int retval = 0;
size_t i;
- ssize_t ret1=0, ret2=0;
bits = (unsigned char*)calloc(1, size);
@@ -2732,8 +2728,8 @@ my_isinf(int endian, unsigned char *val, size_t size,
bits[size-(i+1)] = *(val + ENDIAN(size, i, endian));
#endif /*H5_VMS*/
- if((ret1=H5T_bit_find(bits, mpos, msize, H5T_BIT_LSB, 1))<0 &&
- (ret2=H5T_bit_find(bits, epos, esize, H5T_BIT_LSB, 0))<0)
+ if(H5T_bit_find(bits, mpos, msize, H5T_BIT_LSB, 1) < 0 &&
+ H5T_bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0)
retval = 1;
free(bits);
diff --git a/test/dtransform.c b/test/dtransform.c
index 3297fe6..8b5dce0 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -19,12 +19,12 @@
#define COLS 18
#define FLOAT_TOL 0.0001
-int init_test(hid_t file_id);
-int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy);
-int test_trivial(const hid_t dxpl_id_simple);
-int test_poly(const hid_t dxpl_id_polynomial);
-int test_set(void);
-int test_getset(const hid_t dxpl_id_simple);
+static int init_test(hid_t file_id);
+static int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy);
+static int test_trivial(const hid_t dxpl_id_simple);
+static int test_poly(const hid_t dxpl_id_polynomial);
+static int test_set(void);
+static int test_getset(const hid_t dxpl_id_simple);
/* These are needed for multiple tests, so are declared here globally and are init'ed in init_test */
hid_t dset_id_int;
@@ -336,7 +336,8 @@ error:
return -1;
}
-int init_test(hid_t file_id)
+static int
+init_test(hid_t file_id)
{
const char* f_to_c = "(5/9.0)*(x-32)";
/* utrans is a transform for unsigned types: no negative numbers involved and results are < 255 to fit into uchar */
@@ -389,7 +390,8 @@ error:
return -1;
}
-int test_poly(const hid_t dxpl_id_polynomial)
+static int
+test_poly(const hid_t dxpl_id_polynomial)
{
float polyflres[ROWS][COLS];
int polyintread[ROWS][COLS];
@@ -430,7 +432,8 @@ error:
return -1;
}
-int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy)
+static int
+test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy)
{
int windchillC;
float polyflres[ROWS][COLS];
@@ -462,7 +465,8 @@ error:
return -1;
}
-int test_trivial(const hid_t dxpl_id_simple)
+static int
+test_trivial(const hid_t dxpl_id_simple)
{
float windchillFfloatread[ROWS][COLS];
int windchillFintread[ROWS][COLS];
@@ -505,7 +509,8 @@ error:
return -1;
}
-int test_getset(const hid_t dxpl_id_c_to_f)
+static int
+test_getset(const hid_t dxpl_id_c_to_f)
{
int row, col;
float windchillFfloatread[ROWS][COLS];
@@ -566,7 +571,8 @@ error:
return -1;
}
-int test_set(void)
+static int
+test_set(void)
{
hid_t dxpl_id;
H5E_auto2_t func;
diff --git a/test/dtypes.c b/test/dtypes.c
index 895d890..21ad578 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -64,15 +64,11 @@
* the soft conversion list. One must call reset_hdf5() after this.
*/
#define CHECK_NMEMBS(NMEMBS,SRC_ID,DST_ID) \
- if (H5Tunregister(H5T_PERS_SOFT, NULL, SRC_ID, DST_ID, NULL) < 0) { \
+ if(H5Tunregister(H5T_PERS_SOFT, NULL, SRC_ID, DST_ID, NULL) < 0) \
FAIL_STACK_ERROR \
- goto error; \
- } \
- if (H5Tclose(SRC_ID) < 0 || ((SRC_ID) != (DST_ID) && H5Tclose(DST_ID) < 0)) { \
+ if(H5Tclose(SRC_ID) < 0 || ((SRC_ID) != (DST_ID) && H5Tclose(DST_ID) < 0)) \
FAIL_STACK_ERROR \
- goto error; \
- } \
- if ((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \
+ if((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \
H5_FAILED(); \
printf(" #dtype ids expected: %d; found: %d\n", NMEMBS, \
H5I_nmembers(H5I_DATATYPE)); \
@@ -4097,7 +4093,6 @@ test_conv_str_3(void)
int ret_value = 1;
int size;
H5T_pad_t inpad;
- H5T_cset_t cset;
H5T_sign_t sign;
char* tag;
herr_t ret;
@@ -4117,13 +4112,13 @@ test_conv_str_3(void)
buf[i*8+j++] = '\0';
}
- if ((size=H5Tget_precision(type))==0) goto error;
- if ((size=H5Tget_size(type))==0) goto error;
- if (H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE) < 0) goto error;
- if ((cset=H5Tget_cset(type)) < 0) goto error;
- if (H5Tget_strpad(type) < 0) goto error;
- if (H5Tset_offset(type, 0) < 0) goto error;
- if (H5Tget_order(type) < 0) goto error;
+ if(H5Tget_precision(type) == 0) FAIL_STACK_ERROR
+ if(H5Tget_size(type) == 0) FAIL_STACK_ERROR
+ if(H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE) < 0) FAIL_STACK_ERROR
+ if(H5Tget_cset(type) < 0) FAIL_STACK_ERROR
+ if(H5Tget_strpad(type) < 0) FAIL_STACK_ERROR
+ if(H5Tset_offset(type, 0) < 0) FAIL_STACK_ERROR
+ if(H5Tget_order(type) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
ret=H5Tset_precision(type, nelmts);
@@ -4135,7 +4130,7 @@ test_conv_str_3(void)
} /* end if */
H5E_BEGIN_TRY {
- size=H5Tget_ebias(type);
+ size = H5Tget_ebias(type);
} H5E_END_TRY;
if (size>0) {
H5_FAILED();
diff --git a/test/enum.c b/test/enum.c
index 91a3790..4599a7c 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -455,7 +455,6 @@ test_funcs(void)
hid_t type=-1;
c_e1 val;
size_t size;
- int offset;
H5T_pad_t inpad;
H5T_cset_t cset;
herr_t ret;
@@ -463,18 +462,18 @@ test_funcs(void)
TESTING("some functions with enumeration types");
/* A native integer */
- if ((type = H5Tcreate(H5T_ENUM, sizeof(c_e1)))<0) goto error;
- if (H5Tenum_insert(type, "RED", CPTR(val, E1_RED ))<0) goto error;
- if (H5Tenum_insert(type, "GREEN", CPTR(val, E1_GREEN))<0) goto error;
- if (H5Tenum_insert(type, "BLUE", CPTR(val, E1_BLUE ))<0) goto error;
- if (H5Tenum_insert(type, "WHITE", CPTR(val, E1_WHITE))<0) goto error;
- if (H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK))<0) goto error;
-
- if ((size=H5Tget_precision(type))==0) goto error;
- if ((size=H5Tget_size(type))==0) goto error;
- if ((offset=H5Tget_offset(type))<0) goto error;
- if (H5Tget_sign(type)<0) goto error;
- if (H5Tget_super(type)<0) goto error;
+ if((type = H5Tcreate(H5T_ENUM, sizeof(c_e1))) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "RED", CPTR(val, E1_RED )) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "GREEN", CPTR(val, E1_GREEN)) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "BLUE", CPTR(val, E1_BLUE )) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "WHITE", CPTR(val, E1_WHITE)) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK)) < 0) FAIL_STACK_ERROR
+
+ if(H5Tget_precision(type) == 0) FAIL_STACK_ERROR
+ if(H5Tget_size(type) == 0) FAIL_STACK_ERROR
+ if(H5Tget_offset(type) < 0) FAIL_STACK_ERROR
+ if(H5Tget_sign(type) < 0) FAIL_STACK_ERROR
+ if(H5Tget_super(type) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
ret=H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE);
diff --git a/test/error_test.c b/test/error_test.c
index 027f31b..a5afcfc 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -77,7 +77,7 @@ hid_t ERR_MIN_GETNUM;
#define LONG_DESC_SIZE 8192
-herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc,
+static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc,
void *client_data);
@@ -420,7 +420,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data)
{
FILE *stream = (FILE *)client_data;
diff --git a/test/fillval.c b/test/fillval.c
index 5bf5c03..2f58380 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -1966,7 +1966,7 @@ skip:
*-------------------------------------------------------------------------
*/
static int
-test_compatible(hid_t fapl)
+test_compatible(void)
{
hid_t file=-1, dset1=-1, dset2=-1;
hid_t dcpl1=-1, dcpl2=-1, fspace=-1, mspace=-1;
@@ -2170,7 +2170,7 @@ main(int argc, char *argv[])
nerrors += test_create(my_fapl, FILENAME[1], H5D_CONTIGUOUS);
nerrors += test_rdwr (my_fapl, FILENAME[3], H5D_CONTIGUOUS);
nerrors += test_extend(my_fapl, FILENAME[5], H5D_CONTIGUOUS);
- nerrors += test_compatible(my_fapl);
+ nerrors += test_compatible();
} /* end if */
/* Compact dataset storage tests */
diff --git a/test/freespace.c b/test/freespace.c
index 52a5deb..79a0864 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -2056,7 +2056,6 @@ test_fs_sect_change_class(hid_t fapl)
TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL, *sect_node3=NULL;
unsigned init_flags=0;
TEST_free_section_t *node;
- htri_t node_found = FALSE;
TESTING("the change of section class via H5FS_sect_change_class() in free-space: Test 1");
@@ -2130,8 +2129,8 @@ test_fs_sect_change_class(hid_t fapl)
if(check_stats(frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
+ (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
if (node->sect_info.type != TEST_FSPACE_SECT_TYPE_NONE)
@@ -2235,8 +2234,8 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* verify that section B has changed class */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
+ (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
if (node->sect_info.type != TEST_FSPACE_SECT_TYPE)
@@ -2246,8 +2245,8 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* verify that section C has changed class */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
+ (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
if (node->sect_info.type != TEST_FSPACE_SECT_TYPE)
diff --git a/test/getname.c b/test/getname.c
index 4084f9e..0dc623e 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -2672,7 +2672,6 @@ test_reg_ref(hid_t fapl)
hsize_t dimsr[1] = {2};
int rank = 2;
int rankr = 1;
- herr_t status;
hdset_reg_ref_t ref[2];
hdset_reg_ref_t ref_out[2];
int data[2][9] = {{1,1,2,3,3,4,5,5,6},{1,2,2,3,4,4,5,6,6}};
@@ -2701,9 +2700,9 @@ test_reg_ref(hid_t fapl)
TEST_ERROR
/* Write data to the dataset */
- if((status = H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data)) < 0)
+ if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT, data) < 0)
TEST_ERROR
- if((status = H5Dclose(dsetv_id)) < 0)
+ if(H5Dclose(dsetv_id) < 0)
TEST_ERROR
/* Dataset with references */
@@ -2717,31 +2716,31 @@ test_reg_ref(hid_t fapl)
start[1] = 3;
count[0] = 2;
count[1] = 3;
- if((status = H5Sselect_hyperslab(space_id,H5S_SELECT_SET,start,NULL,count,NULL)) < 0)
+ if(H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
TEST_ERROR
- if((status = H5Rcreate(&ref[0], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id)) < 0)
+ if(H5Rcreate(&ref[0], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
TEST_ERROR
/* Create a reference to elements selection */
- if((status = H5Sselect_none(space_id)) < 0)
+ if(H5Sselect_none(space_id) < 0)
TEST_ERROR
- if((status = H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord)) < 0)
+ if(H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord) < 0)
TEST_ERROR
- if((status = H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id)) < 0)
+ if(H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
TEST_ERROR
/* Write dataset with the references */
- if((status = H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT,ref)) < 0)
+ if(H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref) < 0)
TEST_ERROR
/* Close all objects */
- if((status = H5Sclose(space_id)) < 0)
+ if(H5Sclose(space_id) < 0)
TEST_ERROR
- if((status = H5Sclose(spacer_id)) < 0)
+ if(H5Sclose(spacer_id) < 0)
TEST_ERROR
- if((status = H5Dclose(dsetr_id)) < 0)
+ if(H5Dclose(dsetr_id) < 0)
TEST_ERROR
- if((status = H5Fclose(file_id)) < 0)
+ if(H5Fclose(file_id) < 0)
TEST_ERROR
@@ -2753,7 +2752,7 @@ test_reg_ref(hid_t fapl)
if((dsetr_id = H5Dopen2(file_id, REFREG_DSETNAMER, H5P_DEFAULT)) < 0)
TEST_ERROR
- if((status = H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out)) < 0)
+ if(H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out) < 0)
TEST_ERROR
/* Get name of the dataset the first region reference points to using H5Rget_name */
@@ -2773,7 +2772,7 @@ test_reg_ref(hid_t fapl)
name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE);
if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR
- if((status = H5Dclose(dsetv_id)) < 0) TEST_ERROR
+ if(H5Dclose(dsetv_id) < 0) TEST_ERROR
PASSED()
@@ -2794,13 +2793,13 @@ test_reg_ref(hid_t fapl)
name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE);
if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR
- if((status = H5Dclose(dsetv_id)) < 0) TEST_ERROR
+ if(H5Dclose(dsetv_id) < 0) TEST_ERROR
PASSED()
- if((status = H5Dclose(dsetr_id)) < 0)
+ if(H5Dclose(dsetr_id) < 0)
TEST_ERROR
- if((status = H5Fclose(file_id)) < 0)
+ if(H5Fclose(file_id) < 0)
TEST_ERROR
return 0;
diff --git a/test/h5test.c b/test/h5test.c
index 029ca3e..f5bf180 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1031,49 +1031,45 @@ int h5_szip_can_encode(void )
*
*-------------------------------------------------------------------------
*/
-
-char* getenv_all(MPI_Comm comm, int root, const char* name)
+char *
+getenv_all(MPI_Comm comm, int root, const char* name)
{
int mpi_size, mpi_rank, mpi_initialized;
int len;
static char* env = NULL;
- MPI_Status Status;
assert(name);
MPI_Initialized(&mpi_initialized);
- if (!mpi_initialized){
+ if(!mpi_initialized) {
/* use original getenv */
if(env)
HDfree(env);
env = HDgetenv(name);
- }else{
+ } /* end if */
+ else {
MPI_Comm_rank(comm, &mpi_rank);
MPI_Comm_size(comm, &mpi_size);
assert(root < mpi_size);
/* The root task does the getenv call
* and sends the result to the other tasks */
- if(mpi_rank == root)
- {
+ if(mpi_rank == root) {
env = HDgetenv(name);
- if(env)
- {
+ if(env) {
len = HDstrlen(env);
MPI_Bcast(&len, 1, MPI_INT, root, comm);
MPI_Bcast(env, len, MPI_CHAR, root, comm);
}
- else{
+ else {
/* len -1 indicates that the variable was not in the environment */
len = -1;
MPI_Bcast(&len, 1, MPI_INT, root, comm);
}
}
- else
- {
+ else {
MPI_Bcast(&len, 1, MPI_INT, root, comm);
- if(len >= 0)
- {
+ if(len >= 0) {
if(env == NULL)
env = (char*) HDmalloc(len+1);
else if(strlen(env) < len)
@@ -1082,8 +1078,7 @@ char* getenv_all(MPI_Comm comm, int root, const char* name)
MPI_Bcast(env, len, MPI_CHAR, root, comm);
env[len] = '\0';
}
- else
- {
+ else {
if(env)
HDfree(env);
env = NULL;
diff --git a/test/links.c b/test/links.c
index ec0d21b..c169670 100644
--- a/test/links.c
+++ b/test/links.c
@@ -814,7 +814,6 @@ toomany(hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename[NAME_BUF_SIZE];
if(new_format)
@@ -888,7 +887,7 @@ toomany(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "hard21", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/hard21")) TEST_ERROR
/* Create object in hard-linked group */
@@ -914,7 +913,7 @@ toomany(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "soft16", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/soft16")) TEST_ERROR
/* Create object using soft links */
@@ -1742,7 +1741,6 @@ external_link_root(hid_t fapl, hbool_t new_format)
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
H5L_info_t linfo; /* Link information */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
const char *file; /* File from external link */
@@ -1801,7 +1799,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/")) TEST_ERROR
/* Create object in external file */
@@ -1834,9 +1832,9 @@ external_link_root(hid_t fapl, hbool_t new_format)
if((gid2 = H5Gopen2(fid, "newer_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check names */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/new_group")) TEST_ERROR
- if((name_len = H5Iget_name( gid2, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/newer_group")) TEST_ERROR
/* Close opened objects */
@@ -1903,7 +1901,6 @@ external_link_path(hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
@@ -1943,7 +1940,7 @@ external_link_path(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR
/* Create object in external file */
@@ -1966,7 +1963,7 @@ external_link_path(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/A/B/C/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C/new_group")) TEST_ERROR
/* Close opened object */
@@ -2012,7 +2009,6 @@ external_link_mult(hid_t fapl, hbool_t new_format)
hid_t fid = (-1), fid2 = (-1); /* File IDs */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE],
filename3[NAME_BUF_SIZE],
@@ -2090,7 +2086,7 @@ external_link_mult(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR
/* Create object in external file */
@@ -2113,7 +2109,7 @@ external_link_mult(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/A/B/C/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C/new_group")) TEST_ERROR
/* Close opened object */
@@ -2177,7 +2173,6 @@ external_link_self(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
hid_t lcpl_id = (-1); /* Link Creation Property List ID */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
char filename3[NAME_BUF_SIZE];
@@ -2218,7 +2213,7 @@ external_link_self(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "A/B/C/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/X")) TEST_ERROR
/* Create object through external link */
@@ -2234,7 +2229,7 @@ external_link_self(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "X/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/X/new_group")) TEST_ERROR
/* Close opened object */
@@ -2343,7 +2338,6 @@ external_link_pingpong(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -2394,7 +2388,7 @@ external_link_pingpong(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "link1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/final")) TEST_ERROR
/* Create object in external file */
@@ -2417,7 +2411,7 @@ external_link_pingpong(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/final/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/final/new_group")) TEST_ERROR
/* Close opened object */
@@ -2488,7 +2482,6 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -2562,7 +2555,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "link3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/final")) TEST_ERROR
/* Create object in external file */
@@ -5315,7 +5308,6 @@ external_link_move(hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -5360,7 +5352,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "src2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -5405,7 +5397,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/group2/src3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -5441,14 +5433,14 @@ external_link_move(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/group2/src3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Move external link back to original location */
if(H5Lmove(fid, "/group2/src3", H5L_SAME_LOC, "/src", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -5509,7 +5501,6 @@ external_link_ride(hid_t fapl, hbool_t new_format)
hid_t gcpl = (-1); /* Group creation property list ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
unsigned nmsgs; /* Number of messages in group's header */
@@ -5593,7 +5584,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "src", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -5628,7 +5619,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "src", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -6030,7 +6021,6 @@ external_link_strong(hid_t fapl, hbool_t new_format)
hid_t fid1 = (-1), fid2 = (-1); /* File ID */
hid_t gid1 = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE];
@@ -6071,7 +6061,7 @@ external_link_strong(hid_t fapl, hbool_t new_format)
/* Access external link from file #1 */
if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
if((gid2 = H5Gopen2(fid2, "/W/X/DLINK", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((name_len = H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR
if(H5Gclose(gid2) < 0) TEST_ERROR
if(H5Fclose(fid2) < 0) TEST_ERROR
@@ -6250,7 +6240,6 @@ ud_hard_links(hid_t fapl)
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
H5L_info_t li; /* Link information */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
h5_stat_size_t empty_size; /* Size of an empty file */
char filename[NAME_BUF_SIZE];
@@ -6299,7 +6288,7 @@ ud_hard_links(hid_t fapl)
if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/group")) TEST_ERROR
/* Create object in group */
@@ -6313,7 +6302,7 @@ ud_hard_links(hid_t fapl)
if((gid = H5Gopen2(fid, "group/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/group/new_group")) TEST_ERROR
/* Close opened object */
@@ -6417,7 +6406,6 @@ ud_link_reregister(hid_t fapl)
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
H5L_info_t li; /* Link information */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename[NAME_BUF_SIZE];
h5_stat_size_t empty_size; /* Size of an empty file */
@@ -6486,7 +6474,7 @@ ud_link_reregister(hid_t fapl)
if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/" REREG_TARGET_NAME)) TEST_ERROR
/* Create object in group */
@@ -6500,7 +6488,7 @@ ud_link_reregister(hid_t fapl)
if((gid = H5Gopen2(fid, "rereg_target/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/rereg_target/new_group")) TEST_ERROR
/* Close opened object */
@@ -7291,7 +7279,6 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
hid_t tid = (-1), sid = (-1), did = (-1); /* Other IDs */
hid_t gapl = (-1), dapl = (-1), tapl = (-1); /* Other property lists */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename[NAME_BUF_SIZE];
size_t nlinks; /* nlinks for H5Pset_nlinks */
hsize_t dims[2];
@@ -7356,7 +7343,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
if((gid = H5Oopen(fid, "soft17", plist)) < 0) TEST_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/soft17")) TEST_ERROR
/* Create group using soft link */
@@ -7389,7 +7376,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
if((gid = H5Oopen(fid, "soft4", plist)) < 0) TEST_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/soft4")) TEST_ERROR
@@ -8756,7 +8743,7 @@ corder_transition(hid_t fapl)
sprintf(objname, "filler %u", u);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
- sprintf(objname, "filler %u", 0);
+ sprintf(objname, "filler %u", (unsigned)0);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Close the group */
diff --git a/test/mf.c b/test/mf.c
index 527fa4a..ff54751 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -277,7 +277,6 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
- htri_t status;
H5FD_mem_t type;
haddr_t addr;
haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
@@ -355,8 +354,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* should succeed */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30);
- if (status <= 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30) <= 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -404,8 +402,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* should not succeed in shrinking */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30-10);
- if (status > 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30 - 10) > 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -449,8 +446,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* should not succeed in shrinking */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30+10);
- if (status > 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30 + 10) > 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -493,8 +489,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* should succeed in shrinking */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr+10, (hsize_t)(TEST_BLOCK_SIZE30-10));
- if (status <= 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr+10, (hsize_t)(TEST_BLOCK_SIZE30 - 10)) <= 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -847,7 +842,6 @@ test_mf_fs_alloc_free(hid_t fapl)
frspace_state_t state;
H5MF_sect_ud_t udata;
H5FS_section_info_t *node;
- htri_t node_found = FALSE;
TESTING("H5MF_alloc()/H5MF_xfree() of free-space manager:test 1");
@@ -933,8 +927,8 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node) < 0)
/* Free the free-space section node */
if(H5MF_sect_simple_free((H5FS_section_info_t *)node) < 0)
@@ -1014,8 +1008,8 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space manager */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
/* Free the free-space section node */
@@ -1090,8 +1084,8 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
/* Free the free-space section node */
@@ -1187,7 +1181,6 @@ test_mf_fs_extend(hid_t fapl)
frspace_state_t state; /* State of free space*/
H5MF_sect_ud_t udata;
H5FS_section_info_t *node;
- htri_t node_found = FALSE;
htri_t extended;
TESTING("H5MF_try_extend() of free-space manager:test 1");
@@ -1305,8 +1298,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove the extended block */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1415,8 +1408,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove the merged sections A & B from free-space */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1525,8 +1518,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove the merged sections A & B from free-space */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1635,8 +1628,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space manger */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(TEST_BLOCK_SIZE30-10), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(TEST_BLOCK_SIZE30-10), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1644,8 +1637,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove section B from free-space manager */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE50, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE50, (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1710,7 +1703,6 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
hsize_t ma_size=0;
H5MF_free_section_t *sect_node=NULL;
H5MF_sect_ud_t udata;
- htri_t node_found=FALSE;
H5FS_section_info_t *node;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -1765,8 +1757,8 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Verify that the section did absorb the aggregator */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE2048, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE2048, (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
if (node->addr != ma_addr) TEST_ERROR
@@ -1835,8 +1827,8 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Verify that the section did absorb the aggregator */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(ma_size+TEST_BLOCK_SIZE30), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(ma_size+TEST_BLOCK_SIZE30), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
if ((node->addr + TEST_BLOCK_SIZE30) != ma_addr) TEST_ERROR
@@ -2939,7 +2931,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
hid_t file = -1; /* File ID */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
- h5_stat_size_t empty_size;
+ h5_stat_size_t empty_size, file_size;
H5FD_mem_t type, stype;
haddr_t new_addr, addr, saddr;
haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
@@ -3012,6 +3004,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3074,6 +3074,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3134,6 +3142,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3177,14 +3193,13 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
hid_t file = -1; /* File ID */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
- h5_stat_size_t empty_size;
+ h5_stat_size_t empty_size, file_size;
H5FD_mem_t type, stype;
haddr_t addr1, addr2, addr3, saddr1;
haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF;
hsize_t ma_size=0, new_ma_size=0;
hsize_t sdata_size=0, new_sdata_size=0;
- htri_t status;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1");
@@ -3221,11 +3236,11 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
ma_addr = new_ma_addr - TEST_BLOCK_SIZE30;
- if ((addr1+TEST_BLOCK_SIZE30) != new_ma_addr)
+ if((addr1 + TEST_BLOCK_SIZE30) != new_ma_addr)
TEST_ERROR
/* should succeed */
- if ((status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30)) <= 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30) <= 0)
TEST_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
@@ -3235,6 +3250,14 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3269,7 +3292,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
/* should succeed */
- if ((status = H5MF_try_shrink(f, stype, H5P_DATASET_XFER_DEFAULT, saddr1, (hsize_t)TEST_BLOCK_SIZE50)) <= 0)
+ if(H5MF_try_shrink(f, stype, H5P_DATASET_XFER_DEFAULT, saddr1, (hsize_t)TEST_BLOCK_SIZE50) <= 0)
TEST_ERROR
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size);
@@ -3286,6 +3309,14 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3326,7 +3357,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* should not succeed */
- if ((status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr2, (hsize_t)TEST_BLOCK_SIZE50)) > 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr2, (hsize_t)TEST_BLOCK_SIZE50) > 0)
TEST_ERROR
/* aggregator info should be the same as before */
@@ -3340,6 +3371,14 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3398,7 +3437,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
haddr_t addr1, addr2;
haddr_t ma_addr=HADDR_UNDEF;
hsize_t ma_size=0;
- htri_t status, extended;
+ htri_t extended;
frspace_state_t state;
hsize_t alignment=0, mis_align=0, tmp=0, accum=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
@@ -3545,8 +3584,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* shrink the block */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE50);
- if (status <= 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE50) <= 0)
TEST_ERROR
if(H5Fclose(file) < 0)
diff --git a/test/mount.c b/test/mount.c
index 492f490..14ab346 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -2558,7 +2558,6 @@ test_acc_perm(hid_t fapl)
hid_t gidA = -1, gidB = -1, gidC = -1, gidM = -1, gidAM = -1, gidAMZ = -1; /* Group IDs */
hid_t bad_id = -1; /* Bad ID from object create */
char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */
- ssize_t name_len; /* Filename length */
char filename1[1024],
filename2[1024],
filename3[1024]; /* Name of files to mount */
@@ -2605,7 +2604,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(gidA, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(gidA, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename1) != 0)
TEST_ERROR
@@ -2614,7 +2613,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(fid2, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(fid2, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename2) != 0)
TEST_ERROR
@@ -2624,7 +2623,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(fid2, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(fid2, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename2) != 0)
TEST_ERROR
@@ -2634,7 +2633,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(gidAM, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(gidAM, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename2) != 0)
TEST_ERROR
@@ -2676,7 +2675,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(gidAMZ, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(gidAMZ, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename3) != 0)
TEST_ERROR
diff --git a/test/trefstr.c b/test/trefstr.c
index 81394f2..c39a6eb 100644
--- a/test/trefstr.c
+++ b/test/trefstr.c
@@ -290,7 +290,6 @@ test_refstr_wrap(void)
static void
test_refstr_own(void)
{
- static const char *FUNC = "test_refstr_own";
H5RS_str_t *rs; /* Ref-counted string created */
char *s; /* Pointer to string to transfer */
const char *t; /* Temporary pointers to string */
diff --git a/test/tselect.c b/test/tselect.c
index fae95c2..981d0b6 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -164,21 +164,21 @@
/* Location comparison function */
-int compare_size_t(const void *s1, const void *s2);
+static int compare_size_t(const void *s1, const void *s2);
-herr_t test_select_hyper_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
-herr_t test_select_point_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
-herr_t test_select_all_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
-herr_t test_select_none_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
-herr_t test_select_hyper_iter2(void *_elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_operator_data);
-herr_t test_select_hyper_iter3(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_hyper_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_point_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_all_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_none_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_hyper_iter2(void *_elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_operator_data);
+static herr_t test_select_hyper_iter3(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
/****************************************************************
**
** test_select_hyper_iter1(): Iterator for checking hyperslab iteration
**
****************************************************************/
-herr_t
+static herr_t
test_select_hyper_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data)
{
uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */
@@ -367,7 +367,7 @@ struct pnt_iter {
** (This is really ugly code, not a very good example of correct usage - QAK)
**
****************************************************************/
-herr_t
+static herr_t
test_select_point_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data)
{
uint8_t *elem=(uint8_t *)_elem; /* Pointer to the element to examine */
@@ -641,7 +641,7 @@ test_select_point(hid_t xfer_plist)
**
**
****************************************************************/
-herr_t
+static herr_t
test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data)
{
uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */
@@ -661,7 +661,7 @@ test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, c
** (This is never supposed to be called, so it always returns -1)
**
****************************************************************/
-herr_t
+static herr_t
test_select_none_iter1(void UNUSED *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void UNUSED *_operator_data)
{
return(-1);
@@ -1012,7 +1012,7 @@ test_select_combo(void)
HDfree(rbuf);
} /* test_select_combo() */
-int
+static int
compare_size_t(const void *s1, const void *s2)
{
if(*(const size_t *)s1<*(const size_t *)s2)
@@ -3714,7 +3714,7 @@ test_select_hyper_nota_2d(void)
** test_select_hyper_iter2(): Iterator for checking hyperslab iteration
**
****************************************************************/
-herr_t
+static herr_t
test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data)
{
int *tbuf=(int *)_elem, /* temporary buffer pointer */
@@ -4900,7 +4900,7 @@ typedef struct {
** test_select_hyper_iter3(): Iterator for checking hyperslab iteration
**
****************************************************************/
-herr_t
+static herr_t
test_select_hyper_iter3(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data)
{
unsigned short *tbuf=(unsigned short *)_elem; /* temporary buffer pointer */
diff --git a/test/tsohm.c b/test/tsohm.c
index 0516590..348677d 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -731,7 +731,6 @@ static void test_sohm_size1(void)
hid_t file = -1;
hid_t fcpl_id = -1;
hid_t fapl_id = -1;
- hsize_t norm_oh_size;
hsize_t sohm_oh_size;
hsize_t sohm_btree_oh_size;
h5_stat_size_t norm_empty_filesize;
@@ -782,13 +781,8 @@ static void test_sohm_size1(void)
CHECK_I(file, "H5Fopen");
file = size1_helper(file, FILENAME, fapl_id, 0);
CHECK_I(file, "size1_helper");
-
- /* Get the size of a dataset object header */
- ret = H5Oget_info_by_name(file, DSETNAME[0], &oinfo, H5P_DEFAULT);
- CHECK_I(ret, "H5Oget_info_by_name");
ret = H5Fclose(file);
CHECK_I(ret, "H5Fclose");
- norm_oh_size = oinfo.hdr.space.total;
/* Get the new file size */
norm_final_filesize = h5_get_file_size(FILENAME, fapl_id);
@@ -927,13 +921,6 @@ static void test_sohm_size1(void)
* headers. How the SOHM messages are stored shouldn't affect the
* size of the object header.
*/
- /* JAMES: this fails because while the headers are the same size, the
- * SOHM header is broken up by the SOHM table, so has to have a
- * continuation message and a NULL message.
-
- if(sohm_oh_size >= norm_oh_size)
- VERIFY(sohm_oh_size, 1, "H5Oget_info_by_name");
- */
if(sohm_oh_size != sohm_btree_oh_size)
VERIFY(sohm_btree_oh_size, 1, "H5Oget_info_by_name");
@@ -1378,14 +1365,14 @@ static void
size2_dump_struct(const char *name, size2_helper_struct *sizes)
{
puts(name);
- printf(" empty size: %llu\n", sizes->empty_size);
- printf(" first dataset: %llu \tdelta: %llu\n", sizes->first_dset, sizes->first_dset - sizes->empty_size);
- printf("second dataset: %llu \tdelta: %llu\n", sizes->second_dset, sizes->second_dset - sizes->first_dset);
- printf(" dsets 1: %llu \tdelta: %llu\n", sizes->dsets1, sizes->dsets1 - sizes->second_dset);
- printf(" dsets 2: %llu \tdelta: %llu\n", sizes->dsets2, sizes->dsets2 - sizes->dsets1);
- printf(" interleaved: %llu \tdelta: %llu\n", sizes->interleaved, sizes->interleaved - sizes->dsets2);
- printf(" attributes: %llu \tdelta: %llu\n", sizes->attrs1, sizes->attrs1 - sizes->interleaved);
- printf(" attributes 2: %llu \tdelta: %llu\n", sizes->attrs2, sizes->attrs2 - sizes->attrs1);
+ printf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
+ printf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
+ printf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
+ printf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
+ printf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
+ printf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
+ printf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
+ printf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
}