summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cmpd_dset.c8
-rw-r--r--test/dsets.c10
-rw-r--r--test/dt_arith.c14
-rw-r--r--test/dtypes.c34
-rw-r--r--test/flush1.c3
-rw-r--r--test/flush2.c6
-rw-r--r--test/ntypes.c12
-rwxr-xr-xtest/reserved.c12
-rw-r--r--test/tarray.c54
-rw-r--r--test/th5o.c4
-rw-r--r--test/th5s.c2
11 files changed, 88 insertions, 71 deletions
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 993ab55..0f9c7e6 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -196,7 +196,7 @@ main (int argc, char *argv[])
/* Create the memory data type */
if ((s1_tid = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)))<0)
goto error;
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL);
if (H5Tinsert (s1_tid, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT)<0 ||
H5Tinsert (s1_tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0 ||
H5Tinsert (s1_tid, "c", HOFFSET(s1_t,c), array_dt)<0 ||
@@ -227,7 +227,7 @@ main (int argc, char *argv[])
/* Create a data type for s2 */
if ((s2_tid = H5Tcreate (H5T_COMPOUND, sizeof(s2_t)))<0)
goto error;
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL);
if (H5Tinsert (s2_tid, "a", HOFFSET(s2_t,a), H5T_NATIVE_INT)<0 ||
H5Tinsert (s2_tid, "b", HOFFSET(s2_t,b), H5T_NATIVE_INT)<0 ||
H5Tinsert (s2_tid, "c", HOFFSET(s2_t,c), array_dt)<0 ||
@@ -269,7 +269,7 @@ main (int argc, char *argv[])
/* Create a data type for s3 */
if ((s3_tid = H5Tcreate (H5T_COMPOUND, sizeof(s3_t)))<0)
goto error;
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL);
if (H5Tinsert (s3_tid, "a", HOFFSET(s3_t,a), H5T_NATIVE_INT)<0 ||
H5Tinsert (s3_tid, "b", HOFFSET(s3_t,b), H5T_NATIVE_INT)<0 ||
H5Tinsert (s3_tid, "c", HOFFSET(s3_t,c), array_dt)<0 ||
@@ -346,7 +346,7 @@ main (int argc, char *argv[])
/* Create a data type for s5 */
if ((s5_tid = H5Tcreate (H5T_COMPOUND, sizeof(s5_t)))<0)
goto error;
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL);
if (H5Tinsert (s5_tid, "a", HOFFSET(s5_t,a), H5T_NATIVE_INT)<0 ||
H5Tinsert (s5_tid, "b", HOFFSET(s5_t,b), H5T_NATIVE_INT)<0 ||
H5Tinsert (s5_tid, "c", HOFFSET(s5_t,c), array_dt)<0 ||
diff --git a/test/dsets.c b/test/dsets.c
index 66e9e90..8a8f9f0 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -833,9 +833,9 @@ test_conv_buffer(hid_t fid)
/* Create the memory data type */
if((ctype1 = H5Tcreate(H5T_COMPOUND, sizeof (CmpField)))<0) goto error;
- if((arr_type1 = H5Tarray_create(H5T_NATIVE_INT, 3, dimsa, NULL))<0) goto error;
- if((arr_type2 = H5Tarray_create(H5T_NATIVE_FLOAT, 1, dimsb, NULL))<0) goto error;
- if((arr_type3 = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, dimsc, NULL))<0) goto error;
+ if((arr_type1 = H5Tarray_create(H5T_NATIVE_INT, 3, dimsa, NULL)) < 0) goto error;
+ if((arr_type2 = H5Tarray_create(H5T_NATIVE_FLOAT, 1, dimsb, NULL)) < 0) goto error;
+ if((arr_type3 = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, dimsc, NULL)) < 0) goto error;
if(H5Tinsert(ctype1, "A", HOFFSET(CmpField, a), arr_type1)<0) goto error;
if(H5Tinsert (ctype1, "B", HOFFSET(CmpField, b), arr_type2)<0) goto error;
@@ -847,8 +847,8 @@ test_conv_buffer(hid_t fid)
if((ctype2 = H5Tcreate(H5T_COMPOUND, sizeof (CmpFieldR)))<0) goto error;
- if((arr_type4 = H5Tarray_create(H5T_NATIVE_FLOAT, 1, dimsb, NULL))<0) goto error;
- if((arr_type5 = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, dimsc, NULL))<0) goto error;
+ if((arr_type4 = H5Tarray_create(H5T_NATIVE_FLOAT, 1, dimsb, NULL)) < 0) goto error;
+ if((arr_type5 = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, dimsc, NULL)) < 0) goto error;
if(H5Tinsert (ctype2, "B", HOFFSET(CmpFieldR, b), arr_type4)<0) goto error;
if(H5Tinsert (ctype2, "C", HOFFSET(CmpFieldR, c), arr_type5)<0) goto error;
diff --git a/test/dt_arith.c b/test/dt_arith.c
index 21a35b1..69699f7 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -390,7 +390,7 @@ static int without_hardware_g = 0;
void some_dummy_func(float x);
static hbool_t overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits);
static int my_isnan(dtype_t type, void *val);
-static int my_isinf(dtype_t type, int endian, unsigned char *val, size_t size,
+static int my_isinf(int endian, unsigned char *val, size_t size,
size_t mpos, size_t msize, size_t epos, size_t esize);
/*-------------------------------------------------------------------------
@@ -2717,7 +2717,7 @@ my_isnan(dtype_t type, void *val)
*-------------------------------------------------------------------------
*/
static int
-my_isinf(dtype_t type, int endian, unsigned char *val, size_t size,
+my_isinf(int endian, unsigned char *val, size_t size,
size_t mpos, size_t msize, size_t epos, size_t esize)
{
unsigned char *bits;
@@ -2801,7 +2801,9 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
unsigned char *hw=NULL; /*ptr to hardware-conv'd*/
int underflow; /*underflow occurred */
int overflow; /*overflow occurred */
+#ifdef H5_VMS
int maximal; /*maximal value occurred, for VMS only. */
+#endif /* H5_VMS */
int uflow=0; /*underflow debug counters*/
size_t j, k; /*counters */
int sendian; /* source type endianess */
@@ -3193,11 +3195,11 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
if (underflow &&
HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN)
continue; /* all underflowed, no error */
- if (overflow && my_isinf(dst_type, dendian, buf+j*sizeof(float),
+ if (overflow && my_isinf(dendian, buf+j*sizeof(float),
dst_size, dst_mpos, dst_msize, dst_epos, dst_esize))
continue; /* all overflowed, no error */
#ifdef H5_VMS
- if (maximal && my_isinf(dst_type, dendian, buf+j*sizeof(float),
+ if (maximal && my_isinf(dendian, buf+j*sizeof(float),
dst_size, dst_mpos, dst_msize, dst_epos, dst_esize))
continue; /* maximal value, no error */
#endif /*H5_VMS*/
@@ -3209,11 +3211,11 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
if (underflow &&
HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN)
continue; /* all underflowed, no error */
- if (overflow && my_isinf(dst_type, dendian, buf+j*sizeof(double),
+ if (overflow && my_isinf(dendian, buf+j*sizeof(double),
dst_size, dst_mpos, dst_msize, dst_epos, dst_esize))
continue; /* all overflowed, no error */
#ifdef H5_VMS
- if (maximal && my_isinf(dst_type, dendian, buf+j*sizeof(double),
+ if (maximal && my_isinf(dendian, buf+j*sizeof(double),
dst_size, dst_mpos, dst_msize, dst_epos, dst_esize))
continue; /* maximal value, no error */
#endif /*H5_VMS*/
diff --git a/test/dtypes.c b/test/dtypes.c
index 98c2796..c9e7143 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -328,7 +328,7 @@ test_detect(void)
hid_t atom_vlc_id; /* Atomic VL datatype of char */
hid_t atom_vls_id; /* Atomic VL string datatype */
hid_t cplx_cmpd_id; /* Complex Compound datatype */
- int rank=2; /* Rank for array datatype */
+ unsigned rank = 2; /* Rank for array datatype */
hsize_t dims[2]={3,3}; /* Dimensions for array datatype */
TESTING("H5Tdetect_class()");
@@ -366,8 +366,20 @@ test_detect(void)
/*--------------------------------------------------------------------------------
* Test class of some complex types.
*------------------------------------------------------------------------------*/
+ /* Try to create array datatype with a dimension permutation (should fail) */
+ H5E_BEGIN_TRY {
+ int perm[2]={0,1}; /* Dimensions permutations for array datatype */
+
+ atom_arr_id = H5Tarray_create(H5T_STD_REF_OBJ, rank, dims, perm);
+ } H5E_END_TRY;
+ if(atom_arr_id>=0) {
+ H5_FAILED();
+ printf("Dimension permutation accepted?\n");
+ goto error;
+ } /* end if */
+
/* Create an array datatype with an atomic base type */
- if((atom_arr_id=H5Tarray_create(H5T_STD_REF_OBJ, rank, dims, NULL))<0) TEST_ERROR
+ if((atom_arr_id = H5Tarray_create(H5T_STD_REF_OBJ, rank, dims, NULL)) < 0) TEST_ERROR
/* Make certain that the correct classes can be detected */
if(H5Tdetect_class(atom_arr_id,H5T_ARRAY)!=TRUE) TEST_ERROR
@@ -687,7 +699,7 @@ test_compound_2(void)
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
/* Build hdf5 datatypes */
- array_dt=H5Tarray_create(H5T_NATIVE_INT,1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT,1, &four, NULL);
if ((st=H5Tcreate(H5T_COMPOUND, sizeof(struct st)))<0 ||
H5Tinsert(st, "a", HOFFSET(struct st, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(st, "b", HOFFSET(struct st, b), H5T_NATIVE_INT)<0 ||
@@ -697,7 +709,7 @@ test_compound_2(void)
goto error;
H5Tclose(array_dt);
- array_dt=H5Tarray_create(H5T_NATIVE_INT,1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((dt=H5Tcreate(H5T_COMPOUND, sizeof(struct dt)))<0 ||
H5Tinsert(dt, "a", HOFFSET(struct dt, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(dt, "b", HOFFSET(struct dt, b), H5T_NATIVE_INT)<0 ||
@@ -804,7 +816,7 @@ test_compound_3(void)
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
/* Build hdf5 datatypes */
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((st=H5Tcreate(H5T_COMPOUND, sizeof(struct st)))<0 ||
H5Tinsert(st, "a", HOFFSET(struct st, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(st, "b", HOFFSET(struct st, b), H5T_NATIVE_INT)<0 ||
@@ -814,7 +826,7 @@ test_compound_3(void)
goto error;
H5Tclose(array_dt);
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((dt=H5Tcreate(H5T_COMPOUND, sizeof(struct dt)))<0 ||
H5Tinsert(dt, "a", HOFFSET(struct dt, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(dt, "c", HOFFSET(struct dt, c), array_dt)<0 ||
@@ -922,7 +934,7 @@ test_compound_4(void)
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
/* Build hdf5 datatypes */
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((st=H5Tcreate(H5T_COMPOUND, sizeof(struct st)))<0 ||
H5Tinsert(st, "a", HOFFSET(struct st, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(st, "b", HOFFSET(struct st, b), H5T_NATIVE_INT)<0 ||
@@ -932,7 +944,7 @@ test_compound_4(void)
goto error;
H5Tclose(array_dt);
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((dt=H5Tcreate(H5T_COMPOUND, sizeof(struct dt)))<0 ||
H5Tinsert(dt, "a", HOFFSET(struct dt, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(dt, "b", HOFFSET(struct dt, b), H5T_NATIVE_SHORT)<0 ||
@@ -1040,12 +1052,12 @@ test_compound_5(void)
/* Build datatypes */
short_array = H5Tcreate(H5T_COMPOUND, 4*sizeof(short));
- array_dt=H5Tarray_create(H5T_NATIVE_SHORT, 1, dims, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_SHORT, 1, dims, NULL);
H5Tinsert(short_array, "_", 0, array_dt);
H5Tclose(array_dt);
int_array = H5Tcreate(H5T_COMPOUND, 4*sizeof(int));
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, dims, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, dims, NULL);
H5Tinsert(int_array, "_", 0, array_dt);
H5Tclose(array_dt);
@@ -1794,7 +1806,7 @@ test_compound_10(void)
} /* end if */
/* Create the array data type for c_string data */
- if((arr_tid = H5Tarray_create(cmpd_tid,1,arr_dim, NULL))<0) {
+ if((arr_tid = H5Tarray_create(cmpd_tid, 1, arr_dim, NULL)) < 0) {
H5_FAILED(); AT();
printf("Can't create array type\n");
goto error;
diff --git a/test/flush1.c b/test/flush1.c
index 9adf06d..50601fe 100644
--- a/test/flush1.c
+++ b/test/flush1.c
@@ -49,7 +49,8 @@ static double the_data[100][100];
*
*-------------------------------------------------------------------------
*/
-hid_t create_file(char* name, hid_t fapl)
+static hid_t
+create_file(char* name, hid_t fapl)
{
hid_t file, dcpl, space, dset, groups, grp;
hsize_t ds_size[2] = {100, 100};
diff --git a/test/flush2.c b/test/flush2.c
index 0156961..6c6ad85 100644
--- a/test/flush2.c
+++ b/test/flush2.c
@@ -47,7 +47,8 @@ static double the_data[100][100];
*
*-------------------------------------------------------------------------
*/
-int check_dset(hid_t file, const char* name)
+static int
+check_dset(hid_t file, const char* name)
{
hid_t space, dset;
hsize_t ds_size[2] = {100, 100};
@@ -103,7 +104,8 @@ error:
*
*-------------------------------------------------------------------------
*/
-int check_file(char* filename, hid_t fapl, int flag)
+static int
+check_file(char* filename, hid_t fapl, int flag)
{
hid_t file, groups, grp;
char name[1024];
diff --git a/test/ntypes.c b/test/ntypes.c
index 881d34b..f491b55 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -752,7 +752,7 @@ test_compound_dtype3(hid_t file)
if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR;
/* Create array datatype */
- if((tid2=H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL))<0) TEST_ERROR;
+ if((tid2 = H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Create compound datatype for disk storage */
if((tid=H5Tcreate(H5T_COMPOUND, 29))<0) TEST_ERROR;
@@ -767,7 +767,7 @@ test_compound_dtype3(hid_t file)
H5P_DEFAULT))<0) TEST_ERROR;
/* Create array datatype */
- if((tid_m2=H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL))<0) TEST_ERROR;
+ if((tid_m2 = H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Create compound datatype for datatype in memory */
if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1)))<0) TEST_ERROR;
@@ -1275,7 +1275,7 @@ test_array_dtype(hid_t file)
if(H5Tinsert(tid2, "l", 5, H5T_STD_I64BE)<0) TEST_ERROR;
/* Create array datatype for disk storage */
- if((tid=H5Tarray_create(tid2, 1, array_dims, NULL))<0) TEST_ERROR;
+ if((tid = H5Tarray_create(tid2, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ARRAY_NAME, tid, space,
@@ -1288,7 +1288,7 @@ test_array_dtype(hid_t file)
if(H5Tinsert(tid3, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG)<0) TEST_ERROR;
/* Create array datatype for memory */
- if((tid_m=H5Tarray_create(tid3, 1, array_dims, NULL))<0) TEST_ERROR;
+ if((tid_m = H5Tarray_create(tid3, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
@@ -1403,14 +1403,14 @@ test_array_dtype2(hid_t file)
if ((space = H5Screate_simple(2, space_dims, NULL))<0) TEST_ERROR;
/* Create array datatype for disk storage */
- if((tid=H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL))<0) TEST_ERROR;
+ if((tid = H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ARRAY2_NAME, tid, space,
H5P_DEFAULT))<0) TEST_ERROR;
/* Create array datatype for memory */
- if((tid_m=H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL))<0) TEST_ERROR;
+ if((tid_m = H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints3)<0)
diff --git a/test/reserved.c b/test/reserved.c
index 0b64d3f..769cfb5 100755
--- a/test/reserved.c
+++ b/test/reserved.c
@@ -14,6 +14,7 @@
#include "h5test.h"
+#ifdef BROKEN
const char *FILENAME[] = {
"rsrv_heap",
"rsrv_ohdr",
@@ -402,6 +403,7 @@ rsrv_vlen(void)
} H5E_END_TRY
return 1;
}
+#endif /* BROKEN */
/*-------------------------------------------------------------------------
* Function: main
@@ -422,14 +424,14 @@ rsrv_vlen(void)
int
main(void)
{
- int num_errs=0;
- hid_t fapl;
- const char *envval = NULL;
-
/* This test is currently not working properly; it should be revisted
* when we have time.
*/
#ifdef BROKEN
+ int num_errs=0;
+ hid_t fapl;
+ const char *envval = NULL;
+
envval = HDgetenv("HDF5_DRIVER");
if (envval == NULL)
envval = "nomatch";
@@ -451,7 +453,7 @@ main(void)
{
puts("All address space reservation tests skippped - Incompatible with current Virtual File Driver");
}
-#endif
+#endif /* BROKEN */
SKIPPED();
return 0;
diff --git a/test/tarray.c b/test/tarray.c
index 22fb02b..14dfcd8 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -92,7 +92,7 @@ test_array_atomic_1d(void)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a datatype to refer to */
- tid1 = H5Tarray_create (H5T_NATIVE_INT,ARRAY1_RANK,tdims1,NULL);
+ tid1 = H5Tarray_create(H5T_NATIVE_INT, ARRAY1_RANK, tdims1, NULL);
CHECK(tid1, FAIL, "H5Tarray_create");
/* Create a dataset */
@@ -137,7 +137,7 @@ test_array_atomic_1d(void)
VERIFY(ndims,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(tid1,rdims1,NULL);
+ ret=H5Tget_array_dims(tid1, rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -194,7 +194,7 @@ test_array_funcs(void)
herr_t ret; /* Generic return value */
/* Create a datatype to refer to */
- type = H5Tarray_create (H5T_IEEE_F32BE,ARRAY1_RANK,tdims1,NULL);
+ type = H5Tarray_create(H5T_IEEE_F32BE, ARRAY1_RANK, tdims1, NULL);
CHECK(type, FAIL, "H5Tarray_create");
size=H5Tget_precision(type);
@@ -274,7 +274,7 @@ test_array_atomic_3d(void)
CHECK(sid, FAIL, "H5Screate_simple");
/* Create a datatype to refer to */
- tid = H5Tarray_create (H5T_NATIVE_INT,ARRAY2_RANK,tdims2,NULL);
+ tid = H5Tarray_create(H5T_NATIVE_INT, ARRAY2_RANK, tdims2, NULL);
CHECK(tid, FAIL, "H5Tarray_create");
/* Create a dataset */
@@ -319,7 +319,7 @@ test_array_atomic_3d(void)
VERIFY(ndims,ARRAY2_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(tid,rdims2,NULL);
+ ret = H5Tget_array_dims(tid, rdims2, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -406,11 +406,11 @@ test_array_array_atomic(void)
CHECK(sid, FAIL, "H5Screate_simple");
/* Create a 2-D datatype to refer to */
- tid2 = H5Tarray_create (H5T_NATIVE_INT,ARRAY3_RANK,tdims2,NULL);
+ tid2 = H5Tarray_create(H5T_NATIVE_INT, ARRAY3_RANK, tdims2, NULL);
CHECK(tid2, FAIL, "H5Tarray_create");
/* Create a 1-D datatype to refer to */
- tid1 = H5Tarray_create (tid2,ARRAY1_RANK,tdims1,NULL);
+ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
CHECK(tid1, FAIL, "H5Tarray_create");
/* Create a dataset */
@@ -453,11 +453,11 @@ test_array_array_atomic(void)
CHECK(tid1, FAIL, "H5Dget_type");
/* Check the 1-D array rank */
- ndims1=H5Tget_array_ndims(tid1);
+ ndims1 = H5Tget_array_ndims(tid1);
VERIFY(ndims1,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the 1-D array dimensions */
- ret=H5Tget_array_dims(tid1,rdims1,NULL);
+ ret = H5Tget_array_dims(tid1, rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -476,7 +476,7 @@ test_array_array_atomic(void)
VERIFY(ndims2,ARRAY3_RANK,"H5Tget_array_ndims");
/* Get the 2-D array dimensions */
- ret=H5Tget_array_dims(tid2,rdims2,NULL);
+ ret = H5Tget_array_dims(tid2, rdims2, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -582,7 +582,7 @@ test_array_compound_atomic(void)
CHECK(ret, FAIL, "H5Tinsert");
/* Create an array datatype to refer to */
- tid1 = H5Tarray_create (tid2,ARRAY1_RANK,tdims1,NULL);
+ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
CHECK(tid1, FAIL, "H5Tarray_create");
/* Close compound datatype */
@@ -631,7 +631,7 @@ test_array_compound_atomic(void)
VERIFY(ndims,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(tid1,rdims1,NULL);
+ ret = H5Tget_array_dims(tid1, rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -784,7 +784,7 @@ test_array_compound_array(void)
CHECK(ret, FAIL, "H5Tinsert");
/* Create an array of floats datatype */
- tid3 = H5Tarray_create (H5T_NATIVE_FLOAT,ARRAY1_RANK,tdims1,NULL);
+ tid3 = H5Tarray_create(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1, NULL);
CHECK(tid3, FAIL, "H5Tarray_create");
/* Insert float array field */
@@ -796,7 +796,7 @@ test_array_compound_array(void)
CHECK(ret, FAIL, "H5Tclose");
/* Create an array datatype to refer to */
- tid1 = H5Tarray_create (tid2,ARRAY1_RANK,tdims1,NULL);
+ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
CHECK(tid1, FAIL, "H5Tarray_create");
/* Close compound datatype */
@@ -845,7 +845,7 @@ test_array_compound_array(void)
VERIFY(ndims,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(tid1,rdims1,NULL);
+ ret = H5Tget_array_dims(tid1, rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -906,7 +906,7 @@ test_array_compound_array(void)
VERIFY(ndims,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(mtid,rdims1,NULL);
+ ret = H5Tget_array_dims(mtid, rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -1079,7 +1079,7 @@ test_array_vlen_atomic(void)
CHECK(tid2, FAIL, "H5Tcreate");
/* Create an array datatype to refer to */
- tid1 = H5Tarray_create (tid2,ARRAY1_RANK,tdims1,NULL);
+ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
CHECK(tid1, FAIL, "H5Tarray_create");
/* Close VL datatype */
@@ -1132,7 +1132,7 @@ test_array_vlen_atomic(void)
VERIFY(ndims,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(tid1,rdims1,NULL);
+ ret = H5Tget_array_dims(tid1, rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -1287,7 +1287,7 @@ test_array_vlen_array(void)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create the nested array datatype to refer to */
- tid3 = H5Tarray_create(H5T_NATIVE_UINT,ARRAY1_RANK,tdims1,NULL);
+ tid3 = H5Tarray_create(H5T_NATIVE_UINT, ARRAY1_RANK, tdims1, NULL);
CHECK(tid3, FAIL, "H5Tcreate");
/* Create a VL datatype of 1-D arrays to refer to */
@@ -1299,7 +1299,7 @@ test_array_vlen_array(void)
CHECK(ret, FAIL, "H5Tclose");
/* Create an array datatype to refer to */
- tid1 = H5Tarray_create (tid2,ARRAY1_RANK,tdims1,NULL);
+ tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
CHECK(tid1, FAIL, "H5Tarray_create");
/* Close VL datatype */
@@ -1352,7 +1352,7 @@ test_array_vlen_array(void)
VERIFY(ndims,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(tid1,rdims1,NULL);
+ ret = H5Tget_array_dims(tid1, rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -1383,7 +1383,7 @@ test_array_vlen_array(void)
VERIFY(ndims,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(tid3,rdims1,NULL);
+ ret = H5Tget_array_dims(tid3, rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -1522,7 +1522,7 @@ test_array_bkg(void)
hsize_t dima[] = {ALEN};
int i, j;
- int ndims[3] = {1,1,1};
+ unsigned ndims[3] = {1,1,1};
typedef struct
{
@@ -1606,7 +1606,7 @@ test_array_bkg(void)
/* -------------------------------------- */
for ( i = 0; i < dtsinfo.nsubfields; i++)
{
- array_dt = H5Tarray_create (dtsinfo.datatype[i], ndims[i], dima, NULL);
+ array_dt = H5Tarray_create(dtsinfo.datatype[i], ndims[i], dima, NULL);
CHECK(array_dt, FAIL, "H5Tarray_create");
status = H5Tinsert (type, dtsinfo.name[i], dtsinfo.offset[i], array_dt);
@@ -1683,7 +1683,7 @@ test_array_bkg(void)
type = H5Tcreate(H5T_COMPOUND, sizeof(fld_t));
CHECK(type, FAIL, "H5Tcreate");
- array_dt = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dima, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_FLOAT, 1, dima, NULL);
CHECK(array_dt, FAIL, "H5Tarray_create");
status = H5Tinsert (type, "Two", HOFFSET(fld_t, b), array_dt);
@@ -2005,7 +2005,7 @@ test_compat(void)
VERIFY(ndims,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(mtid,rdims1,NULL);
+ ret = H5Tget_array_dims(mtid, rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
@@ -2050,7 +2050,7 @@ test_compat(void)
VERIFY(ndims,ARRAY1_RANK,"H5Tget_array_ndims");
/* Get the array dimensions */
- ret=H5Tget_array_dims(mtid,rdims1,NULL);
+ ret = H5Tget_array_dims(mtid,rdims1, NULL);
CHECK(ret, FAIL, "H5Tget_array_dims");
/* Check the array dimensions */
diff --git a/test/th5o.c b/test/th5o.c
index fde15c7..019dda2 100644
--- a/test/th5o.c
+++ b/test/th5o.c
@@ -46,7 +46,7 @@ test_h5o_open(void)
hid_t grp, dset, dtype, dspace; /* Object identifiers */
hsize_t dims[RANK];
H5I_type_t id_type; /* Type of IDs returned from H5Oopen */
- hsize_t num_objs=-1; /* Number of objects in the group */
+ hsize_t num_objs = 0; /* Number of objects in the group */
H5T_class_t type_class; /* Class of the datatype */
herr_t ret; /* Value returned from API calls */
@@ -248,7 +248,7 @@ test_h5o_open_by_addr(void)
haddr_t dtype_addr;
hsize_t dims[RANK];
H5I_type_t id_type; /* Type of IDs returned from H5Oopen */
- hsize_t num_objs=-1; /* Number of objects in the group */
+ hsize_t num_objs = 0; /* Number of objects in the group */
H5T_class_t type_class; /* Class of the datatype */
herr_t ret; /* Value returned from API calls */
diff --git a/test/th5s.c b/test/th5s.c
index 1d1b1dd..9fbe35f 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -544,8 +544,6 @@ test_h5s_encode(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataspace Encoding and Decoding\n"));
- H5open();
-
/*-------------------------------------------------------------------------
* Test encoding and decoding of simple dataspace and hyperslab selection.
*-------------------------------------------------------------------------