summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-08 15:26:02 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-08 15:26:02 (GMT)
commitd3ee3988b68292524b3a893b9db55c074f4b9e87 (patch)
tree64395dd8ffd157ccd761ea54f7ee2c739e7b48ed
parenta6f5c793469cba3e0c1168e07bd6c7f833321623 (diff)
downloadhdf5-d3ee3988b68292524b3a893b9db55c074f4b9e87.zip
hdf5-d3ee3988b68292524b3a893b9db55c074f4b9e87.tar.gz
hdf5-d3ee3988b68292524b3a893b9db55c074f4b9e87.tar.bz2
[svn-r14192] Description:
Deprecate H5Dextend in favor of H5Dset_extent (without using API versioning, due to changed behavior) and switch internal usage to H5Dset_extent Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
-rw-r--r--c++/src/H5DataSet.cpp8
-rw-r--r--examples/h5_extend_write.c12
-rw-r--r--fortran/src/H5Df.c29
-rw-r--r--hl/src/H5TB.c16
-rw-r--r--src/H5D.c69
-rw-r--r--src/H5Ddeprec.c6
-rw-r--r--src/H5Dpublic.h16
-rw-r--r--src/H5S.c130
-rw-r--r--src/H5Sprivate.h4
-rw-r--r--test/dsets.c1306
-rw-r--r--test/extend.c236
-rw-r--r--test/external.c207
-rw-r--r--test/fillval.c4
-rwxr-xr-xtest/objcopy.c2
-rw-r--r--test/testmeta.c15
-rw-r--r--test/tmisc.c56
-rw-r--r--test/tselect.c52
-rw-r--r--test/tsohm.c24
-rw-r--r--test/tvltypes.c23
-rw-r--r--testpar/t_chunk_alloc.c2
-rw-r--r--testpar/t_dset.c34
21 files changed, 1182 insertions, 1069 deletions
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index 4d3050c..9858e7d 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -405,11 +405,9 @@ int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& spa
//--------------------------------------------------------------------------
void DataSet::extend( const hsize_t* size ) const
{
- herr_t ret_value = H5Dextend( id, size );
- if( ret_value < 0 ) // raise exception when H5Dextend returns a neg value
- {
- throw DataSetIException("DataSet::extend", "H5Dextend failed");
- }
+ herr_t ret_value = H5Dset_extent( id, size );
+ if( ret_value < 0 ) // raise exception when H5Dset_extent returns a neg value
+ throw DataSetIException("DataSet::extend", "H5Dset_extent failed");
}
//--------------------------------------------------------------------------
diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c
index 4e605e0..b54cc66 100644
--- a/examples/h5_extend_write.c
+++ b/examples/h5_extend_write.c
@@ -89,12 +89,12 @@ main (void)
*/
size[0] = 3;
size[1] = 3;
- status = H5Dextend (dataset, size);
+ status = H5Dset_extent(dataset, size);
/*
* Select a hyperslab.
*/
- filespace = H5Dget_space (dataset);
+ filespace = H5Dget_space(dataset);
offset[0] = 0;
offset[1] = 0;
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
@@ -112,12 +112,12 @@ main (void)
dims[0] = dims1[0] + dims2[0];
size[0] = dims[0];
size[1] = dims[1];
- status = H5Dextend (dataset, size);
+ status = H5Dset_extent(dataset, size);
/*
* Select a hyperslab.
*/
- filespace = H5Dget_space (dataset);
+ filespace = H5Dget_space(dataset);
offset[0] = 3;
offset[1] = 0;
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
@@ -140,12 +140,12 @@ main (void)
dims[1] = dims1[1] + dims3[1];
size[0] = dims[0];
size[1] = dims[1];
- status = H5Dextend (dataset, size);
+ status = H5Dset_extent(dataset, size);
/*
* Select a hyperslab
*/
- filespace = H5Dget_space (dataset);
+ filespace = H5Dget_space(dataset);
offset[0] = 0;
offset[1] = 3;
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c
index b2d9a61..082bed5 100644
--- a/fortran/src/H5Df.c
+++ b/fortran/src/H5Df.c
@@ -1273,7 +1273,7 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id)
/*----------------------------------------------------------------------------
* Name: h5dextend_c
- * Purpose: Call H5Dextend to extend dataset with unlimited dimensions
+ * Purpose: Call H5Dset_extent to extend dataset with unlimited dimensions
* Inputs: dset_id - identifier of the dataset
* Outputs: dims - array with the dimension sizes
* Returns: 0 on success, -1 on failure
@@ -1285,34 +1285,27 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id)
int_f
nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims)
{
- int ret_value = -1;
- hsize_t *c_dims;
- int status;
+ hid_t c_space_id;
+ hsize_t c_dims[H5S_MAX_RANK];
int rank;
int i;
- hid_t c_dset_id;
- hid_t c_space_id;
-
- c_dset_id = (hid_t)*dset_id;
- c_space_id = H5Dget_space(c_dset_id);
- if (c_space_id < 0) return ret_value;
+ int status;
+ int ret_value = -1;
- rank = H5Sget_simple_extent_ndims(c_space_id);
- if (rank < 0) return ret_value;
+ if((c_space_id = H5Dget_space((hid_t)*dset_id)) < 0) return ret_value;
- c_dims = malloc(sizeof(hsize_t)*rank);
- if (!c_dims) return ret_value;
+ if((rank = H5Sget_simple_extent_ndims(c_space_id)) < 0) return ret_value;
/*
* Reverse dimensions due to C-FORTRAN storage order.
*/
- for (i=0; i < rank; i++)
+ for(i = 0; i < rank; i++)
c_dims[i] = dims[rank - i - 1];
- status = H5Dextend(c_dset_id, c_dims);
+ status = H5Dset_extent((hid_t)*dset_id, c_dims);
- if ( status >= 0 ) ret_value = 0;
- HDfree(c_dims);
+ if(status >= 0)
+ ret_value = 0;
return ret_value;
}
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index 3221cb4..9193bbd 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -1550,7 +1550,7 @@ herr_t H5TBinsert_record( hid_t loc_id,
goto out;
read_nrecords = ntotal_records - start;
- tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, type_size );
+ tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, type_size);
/* Read the records after the inserted one(s) */
if(H5TBread_records( loc_id, dset_name, start, read_nrecords, type_size, field_offset,
@@ -1560,7 +1560,7 @@ herr_t H5TBinsert_record( hid_t loc_id,
/* Extend the dataset */
dims[0] = ntotal_records + nrecords;
- if(H5Dextend ( did, dims ) < 0)
+ if(H5Dset_extent(did, dims) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1569,8 +1569,8 @@ herr_t H5TBinsert_record( hid_t loc_id,
*/
/* Create a simple memory data space */
- mem_dims[0]=nrecords;
- if((mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0)
+ mem_dims[0] = nrecords;
+ if((mem_space_id = H5Screate_simple(1, mem_dims, NULL)) < 0)
return -1;
/* Get the file data space */
@@ -3691,16 +3691,16 @@ herr_t H5TB_common_append_records( hid_t dataset_id,
/* Extend the dataset */
dims[0] = nrecords + orig_table_size;
- if(H5Dextend ( dataset_id, dims ) < 0)
+ if(H5Dset_extent(dataset_id, dims) < 0)
goto out;
/* Create a simple memory data space */
- mem_dims[0]=nrecords;
- if((mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0)
+ mem_dims[0] = nrecords;
+ if((mem_space_id = H5Screate_simple(1, mem_dims, NULL)) < 0)
goto out;
/* Get a copy of the new file data space for writing */
- if((space_id = H5Dget_space( dataset_id )) < 0)
+ if((space_id = H5Dget_space(dataset_id)) < 0)
goto out;
/* Define a hyperslab in the dataset */
diff --git a/src/H5D.c b/src/H5D.c
index a6b9a52..5133651 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -3077,8 +3077,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Dset_extent
*
- * Purpose: Modifies the dimensions of a dataset, based on H5Dextend.
- * Can change to a lower dimension.
+ * Purpose: Modifies the dimensions of a dataset.
+ * Can change to a smaller dimension.
*
* Return: Non-negative on success, negative on failure
*
@@ -3130,10 +3130,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
H5S_t *space; /* Dataset's dataspace */
int rank; /* Dataspace # of dimensions */
hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Current dimension sizes */
- hbool_t shrink = FALSE; /* Flag to indicate a dimension has shrank */
- hbool_t expand = FALSE; /* Flag to indicate a dimension has grown */
htri_t changed; /* Whether the dataspace changed size */
- unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5D_set_extent, FAIL)
@@ -3142,40 +3139,44 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
HDassert(dset);
HDassert(size);
- /*-------------------------------------------------------------------------
- * Get the data space
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Get the data space
+ *-------------------------------------------------------------------------
+ */
space = dset->shared->space;
- /*-------------------------------------------------------------------------
- * Check if we are shrinking or expanding any of the dimensions
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Check if we are shrinking or expanding any of the dimensions
+ *-------------------------------------------------------------------------
+ */
if((rank = H5S_get_simple_extent_dims(space, curr_dims, NULL)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions")
- /* Determine if we are shrinking and/or expanding any dimensions */
- for(u = 0; u < (unsigned)rank; u++) {
- if(size[u] < curr_dims[u])
- shrink = TRUE;
- if(size[u] > curr_dims[u])
- expand = TRUE;
- } /* end for */
-
- /*-------------------------------------------------------------------------
- * Modify the size of the data space
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Modify the size of the data space
+ *-------------------------------------------------------------------------
+ */
if((changed = H5S_set_extent(space, size)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
/* Don't bother updating things, unless they've changed */
if(changed) {
- /*-------------------------------------------------------------------------
- * Modify the dataset storage
- *-------------------------------------------------------------------------
- */
+ hbool_t shrink = FALSE; /* Flag to indicate a dimension has shrank */
+ hbool_t expand = FALSE; /* Flag to indicate a dimension has grown */
+ unsigned u; /* Local index variable */
+
+ /* Determine if we are shrinking and/or expanding any dimensions */
+ for(u = 0; u < (unsigned)rank; u++) {
+ if(size[u] < curr_dims[u])
+ shrink = TRUE;
+ if(size[u] > curr_dims[u])
+ expand = TRUE;
+ } /* end for */
+
+ /*-------------------------------------------------------------------------
+ * Modify the dataset storage
+ *-------------------------------------------------------------------------
+ */
/* Save the new dataspace in the file if necessary */
if(H5S_write(&(dset->oloc), space, TRUE, dxpl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace")
@@ -3191,11 +3192,11 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset storage")
- /*-------------------------------------------------------------------------
- * Remove chunk information in the case of chunked datasets
- * This removal takes place only in case we are shrinking the dateset
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Remove chunk information in the case of chunked datasets
+ * This removal takes place only in case we are shrinking the dateset
+ *-------------------------------------------------------------------------
+ */
if(shrink && H5D_CHUNKED == dset->shared->layout.type) {
H5D_io_info_t io_info; /* Dataset I/O info */
H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c
index fcb67e4..3d58557 100644
--- a/src/H5Ddeprec.c
+++ b/src/H5Ddeprec.c
@@ -65,7 +65,9 @@
/* Local Prototypes */
/********************/
+#ifndef H5_NO_DEPRECATED_SYMBOLS
static herr_t H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id);
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/*********************/
@@ -256,6 +258,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dopen() */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
/*-------------------------------------------------------------------------
* Function: H5Dextend
@@ -264,6 +267,8 @@ done:
* SIZE. The dimensionality of SIZE is the same as the data
* space of the dataset being changed.
*
+ * Note: Deprecated in favor of H5Dset_extent
+ *
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
@@ -377,4 +382,5 @@ H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_extend() */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h
index 3ddba7c..bbd74a6 100644
--- a/src/H5Dpublic.h
+++ b/src/H5Dpublic.h
@@ -124,8 +124,24 @@ H5_DLL herr_t H5Ddebug(hid_t dset_id);
H5_DLL hid_t H5Dcreate(hid_t file_id, const char *name, hid_t type_id,
hid_t space_id, hid_t plist_id);
H5_DLL hid_t H5Dopen(hid_t file_id, const char *name);
+
+/* Symbols defined for compatibility with previous versions of the HDF5 API.
+ *
+ * Use of these symbols is deprecated.
+ */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+/* Macros */
+
+
+/* Typedefs */
+
+
+/* Function prototypes */
H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t *size);
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
#ifdef __cplusplus
}
#endif
diff --git a/src/H5S.c b/src/H5S.c
index 45069c1..f990925 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1499,70 +1499,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5S_extend
- *
- * Purpose: Extend the dimensions of a data space.
- *
- * Return: Success: Number of dimensions whose size increased.
- *
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Friday, January 30, 1998
- *
- *-------------------------------------------------------------------------
- */
-int
-H5S_extend(H5S_t *space, const hsize_t *size)
-{
- unsigned u;
- int ret_value = 0;
-
- FUNC_ENTER_NOAPI(H5S_extend, FAIL)
-
- /* Check args */
- HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space));
- HDassert(size);
-
- /* Check through all the dimensions to see if modifying the dataspace is allowed */
- for(u = 0; u < space->extent.rank; u++) {
- if(space->extent.size[u]<size[u]) {
- if(space->extent.max && H5S_UNLIMITED!=space->extent.max[u] &&
- space->extent.max[u]<size[u])
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimension cannot be increased")
- ret_value++;
- } /* end if */
- } /* end for */
-
- /* Update */
- if(ret_value) {
- hsize_t nelem; /* Number of elements in extent */
-
- /* Change the dataspace size & re-compute the number of elements in the extent */
- for(u = 0, nelem = 1; u < space->extent.rank; u++) {
- if(space->extent.size[u] < size[u])
- space->extent.size[u] = size[u];
-
- nelem *= space->extent.size[u];
- } /* end for */
- space->extent.nelem = nelem;
-
- /* If the selection is 'all', update the number of elements selected */
- if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL)
- if(H5S_select_all(space, FALSE) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
-
- /* Mark the dataspace as no longer shared if it was before */
- if(H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_extend() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5Screate_simple
*
* Purpose: Creates a new simple data space object and opens it for
@@ -2355,3 +2291,69 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_set_latest_version() */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+/*-------------------------------------------------------------------------
+ * Function: H5S_extend
+ *
+ * Purpose: Extend the dimensions of a data space.
+ *
+ * Return: Success: Number of dimensions whose size increased.
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Friday, January 30, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5S_extend(H5S_t *space, const hsize_t *size)
+{
+ unsigned u;
+ int ret_value = 0;
+
+ FUNC_ENTER_NOAPI(H5S_extend, FAIL)
+
+ /* Check args */
+ HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space));
+ HDassert(size);
+
+ /* Check through all the dimensions to see if modifying the dataspace is allowed */
+ for(u = 0; u < space->extent.rank; u++) {
+ if(space->extent.size[u]<size[u]) {
+ if(space->extent.max && H5S_UNLIMITED!=space->extent.max[u] &&
+ space->extent.max[u]<size[u])
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimension cannot be increased")
+ ret_value++;
+ } /* end if */
+ } /* end for */
+
+ /* Update */
+ if(ret_value) {
+ hsize_t nelem; /* Number of elements in extent */
+
+ /* Change the dataspace size & re-compute the number of elements in the extent */
+ for(u = 0, nelem = 1; u < space->extent.rank; u++) {
+ if(space->extent.size[u] < size[u])
+ space->extent.size[u] = size[u];
+
+ nelem *= space->extent.size[u];
+ } /* end for */
+ space->extent.nelem = nelem;
+
+ /* If the selection is 'all', update the number of elements selected */
+ if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL)
+ if(H5S_select_all(space, FALSE) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+
+ /* Mark the dataspace as no longer shared if it was before */
+ if(H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace")
+ } /* end if */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_extend() */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index 69624c3..c6f2ce5 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -208,7 +208,6 @@ H5_DLL herr_t H5S_write(struct H5O_loc_t *loc, const H5S_t *space,
H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh,
const H5S_t *ds);
H5_DLL H5S_t *H5S_read(const struct H5O_loc_t *loc, hid_t dxpl_id);
-H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size);
H5_DLL int H5S_set_extent(H5S_t *space, const hsize_t *size);
H5_DLL herr_t H5S_set_extent_real(H5S_t *space, const hsize_t *size);
H5_DLL H5S_t *H5S_create(H5S_class_t type);
@@ -217,6 +216,9 @@ H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/],
H5_DLL herr_t H5S_set_latest_version(H5S_t *ds);
H5_DLL herr_t H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream,
int indent, int fwidth);
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size);
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
H5_DLL hsize_t H5S_extent_nelem(const H5S_extent_t *ext);
diff --git a/test/dsets.c b/test/dsets.c
index 6469a5e..cf1f650 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -234,7 +234,7 @@ test_create(hid_t file)
* existing datasets are accessed.
*/
if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) goto error;
- if ((dataset = H5Dopen(file, DSET_DEFAULT_NAME))<0) goto error;
+ if ((dataset = H5Dopen(file, DSET_DEFAULT_NAME)) < 0) goto error;
if (H5Dclose(dataset) < 0) goto error;
/*
@@ -354,29 +354,29 @@ test_simple_io(hid_t fapl)
for (j = 0; j < DSET_DIM2; j++)
points[i][j] = n++;
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
/* Create the data space */
dims[0] = DSET_DIM1;
dims[1] = DSET_DIM2;
- if ((space = H5Screate_simple(2, dims, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
/* Create a small conversion buffer to test strip mining */
tconv_buf = HDmalloc((size_t)1000);
xfer = H5Pcreate (H5P_DATASET_XFER);
assert (xfer>=0);
- if (H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL)<0) goto error;
+ if (H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT))<0) goto error;
+ H5P_DEFAULT)) < 0) goto error;
/* Test dataset address. Should be undefined. */
if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
/* Write the data to the dataset */
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points)<0)
+ if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points) < 0)
goto error;
/* Test dataset address in file. Open the same file as a C file, seek
@@ -385,7 +385,7 @@ test_simple_io(hid_t fapl)
if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error;
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check)<0)
+ if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check) < 0)
goto error;
/* Check that the values read are the same as the values written */
@@ -400,9 +400,9 @@ test_simple_io(hid_t fapl)
}
}
- if(H5Pclose (xfer)<0) goto error;
- if(H5Dclose(dataset)<0) goto error;
- if(H5Fclose(file)<0) goto error;
+ if(H5Pclose (xfer) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
+ if(H5Fclose(file) < 0) goto error;
f = HDopen(filename, O_RDONLY, 0);
HDlseek(f, (off_t)offset, SEEK_SET);
@@ -462,23 +462,23 @@ test_userblock_offset(hid_t fapl)
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
- if((fcpl=H5Pcreate(H5P_FILE_CREATE))<0) goto error;
- if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK)<0) goto error;
+ if((fcpl=H5Pcreate(H5P_FILE_CREATE)) < 0) goto error;
+ if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK) < 0) goto error;
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl))<0)
+ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
goto error;
/* Create the data space */
dims[0] = DSET_DIM1;
dims[1] = DSET_DIM2;
- if ((space = H5Screate_simple(2, dims, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_USERBLOCK_IO_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT))<0) goto error;
+ H5P_DEFAULT)) < 0) goto error;
/* Write the data to the dataset */
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
+ if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
goto error;
/* Test dataset address in file. Open the same file as a C file, seek
@@ -486,8 +486,8 @@ test_userblock_offset(hid_t fapl)
* compare it with the data written in.*/
if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error;
- if(H5Dclose(dataset)<0) goto error;
- if(H5Fclose(file)<0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
+ if(H5Fclose(file) < 0) goto error;
f = HDopen(filename, O_RDONLY, 0);
HDlseek(f, (off_t)offset, SEEK_SET);
@@ -558,7 +558,7 @@ test_compact_io(hid_t fapl)
/* Create a file */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
/* Create property list for compact dataset creation */
@@ -567,13 +567,13 @@ test_compact_io(hid_t fapl)
if(H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR
/* Create and write to a compact dataset */
- if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, plist))<0)
+ if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, plist)) < 0)
TEST_ERROR
/* Test dataset address. Should be undefined. */
if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf)<0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
TEST_ERROR
/* Test dataset address. Should be undefined. */
@@ -588,11 +588,11 @@ test_compact_io(hid_t fapl)
/*
* Open the file and check data
*/
- if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR
- if((dataset = H5Dopen(file, DSET_COMPACT_IO_NAME))<0)
+ if((dataset = H5Dopen(file, DSET_COMPACT_IO_NAME)) < 0)
TEST_ERROR
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf)<0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
TEST_ERROR
/* Check that the values read are the same as the values written */
@@ -668,7 +668,7 @@ test_max_compact(hid_t fapl)
/* Create a file */
h5_fixname(FILENAME[3], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
/* Create property list for compact dataset creation */
@@ -679,10 +679,10 @@ test_max_compact(hid_t fapl)
/* Create and write to a compact dataset */
if((dataset = H5Dcreate(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space,
- plist))<0)
+ plist)) < 0)
goto error;
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf)<0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
goto error;
/* Close file */
@@ -694,11 +694,11 @@ test_max_compact(hid_t fapl)
/*
* Open the file and check data
*/
- if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
goto error;
- if((dataset = H5Dopen(file, DSET_COMPACT_MAX_NAME))<0)
+ if((dataset = H5Dopen(file, DSET_COMPACT_MAX_NAME)) < 0)
goto error;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf)<0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
goto error;
/* Check that the values read are the same as the values written */
@@ -726,7 +726,7 @@ test_max_compact(hid_t fapl)
assert(space>=0);
/* Open file */
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
goto error;
/* Create property list for compact dataset creation */
@@ -819,7 +819,7 @@ test_conv_buffer(hid_t fid)
/* Create data space */
- if((space=H5Screate(H5S_SCALAR))<0) goto error;
+ if((space=H5Screate(H5S_SCALAR)) < 0) goto error;
/* Add members to the compound data type */
dimsa[0] = DIM1;
@@ -829,37 +829,37 @@ test_conv_buffer(hid_t fid)
dimsc[0] = DIM3;
/* Create the memory data type */
- if((ctype1 = H5Tcreate(H5T_COMPOUND, sizeof (CmpField)))<0) goto error;
+ 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(H5Tinsert(ctype1, "A", HOFFSET(CmpField, a), arr_type1)<0) goto error;
- if(H5Tinsert (ctype1, "B", HOFFSET(CmpField, b), arr_type2)<0) goto error;
- if(H5Tinsert (ctype1, "C", HOFFSET(CmpField, c), arr_type3)<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;
+ if(H5Tinsert (ctype1, "C", HOFFSET(CmpField, c), arr_type3) < 0) goto error;
/* Create the dataset */
- if((dataset = H5Dcreate(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT))<0) goto error;
- if(H5Dwrite(dataset, ctype1, H5S_ALL, H5S_ALL, H5P_DEFAULT, cf)<0) goto error;
+ if((dataset = H5Dcreate(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT)) < 0) goto error;
+ if(H5Dwrite(dataset, ctype1, H5S_ALL, H5S_ALL, H5P_DEFAULT, cf) < 0) goto error;
- if((ctype2 = H5Tcreate(H5T_COMPOUND, sizeof (CmpFieldR)))<0) goto error;
+ 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(H5Tinsert (ctype2, "B", HOFFSET(CmpFieldR, b), arr_type4)<0) goto error;
- if(H5Tinsert (ctype2, "C", HOFFSET(CmpFieldR, c), arr_type5)<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;
/* Read should succeed since library will set conversion buffer big enough */
cfrR = (CmpFieldR *)HDcalloc((size_t)1, sizeof(CmpFieldR));
- if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfrR)<0) goto error;
+ if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfrR) < 0) goto error;
/* Read should fail since conversion buffer isn't big enough */
xfer_list = H5Pcreate (H5P_DATASET_XFER);
size = (DIM2*DIM3*(sizeof(int))+ DIM2*(sizeof(float))+
DIM3*(sizeof(double)));
- if(H5Pset_buffer (xfer_list, size, NULL, NULL)<0) goto error;
+ if(H5Pset_buffer (xfer_list, size, NULL, NULL) < 0) goto error;
H5E_BEGIN_TRY {
status = H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR);
@@ -873,21 +873,21 @@ test_conv_buffer(hid_t fid)
/* Read will succeed since conversion buffer is big enough */
size = (DIM1*DIM2*DIM3*(sizeof(int))+ DIM2*(sizeof(float))+
DIM3*(sizeof(double)));
- if(H5Pset_buffer (xfer_list, size, NULL, NULL)<0) goto error;
+ if(H5Pset_buffer (xfer_list, size, NULL, NULL) < 0) goto error;
- if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR)<0) goto error;
+ if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR) < 0) goto error;
- if(H5Pclose(xfer_list)<0) goto error;
- if(H5Sclose(space)<0) goto error;
- if(H5Tclose(arr_type1)<0) goto error;
- if(H5Tclose(arr_type2)<0) goto error;
- if(H5Tclose(arr_type3)<0) goto error;
- if(H5Tclose(ctype1)<0) goto error;
- if(H5Tclose(ctype2)<0) goto error;
- if(H5Tclose(arr_type4)<0) goto error;
- if(H5Tclose(arr_type5)<0) goto error;
- if(H5Dclose(dataset)<0) goto error;
+ if(H5Pclose(xfer_list) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(arr_type1) < 0) goto error;
+ if(H5Tclose(arr_type2) < 0) goto error;
+ if(H5Tclose(arr_type3) < 0) goto error;
+ if(H5Tclose(ctype1) < 0) goto error;
+ if(H5Tclose(ctype2) < 0) goto error;
+ if(H5Tclose(arr_type4) < 0) goto error;
+ if(H5Tclose(arr_type5) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
if(cf)
HDfree(cf);
@@ -942,18 +942,18 @@ test_tconv(hid_t file)
/* Create the data space */
dims[0] = 1000000;
- if ((space = H5Screate_simple (1, dims, NULL))<0) goto error;
+ if ((space = H5Screate_simple (1, dims, NULL)) < 0) goto error;
/* Create the data set */
if ((dataset = H5Dcreate(file, DSET_TCONV_NAME, H5T_STD_I32LE, space,
- H5P_DEFAULT))<0) goto error;
+ H5P_DEFAULT)) < 0) goto error;
/* Write the data to the dataset */
if (H5Dwrite(dataset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- out)<0) goto error;
+ out) < 0) goto error;
/* Read data with byte order conversion */
- if (H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in)<0)
+ if (H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in) < 0)
goto error;
/* Check */
@@ -968,7 +968,7 @@ test_tconv(hid_t file)
}
}
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
free (out);
free (in);
puts(" PASSED");
@@ -1316,19 +1316,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
herr_t status; /* Error status */
/* Create the data space */
- if ((sid = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((sid = H5Screate_simple(2, size, NULL)) < 0) goto error;
/*
* Create a small conversion buffer to test strip mining. We
* might as well test all we can!
*/
- if ((dxpl = H5Pcreate(H5P_DATASET_XFER))<0) goto error;
+ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
tconv_buf = HDmalloc((size_t)1000);
- if (H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL)<0) goto error;
- if ((write_dxpl = H5Pcopy(dxpl))<0) TEST_ERROR;
+ if (H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error;
+ if ((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR;
if (if_fletcher32==DISABLE_FLETCHER32) {
- if(H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC)<0)
+ if(H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC) < 0)
goto error;
if(H5Z_DISABLE_EDC != H5Pget_edc_check(dxpl))
goto error;
@@ -1345,7 +1345,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
/* Create the dataset */
if ((dataset = H5Dcreate(fid, name, H5T_NATIVE_INT, sid,
- dcpl))<0) goto error;
+ dcpl)) < 0) goto error;
PASSED();
/*----------------------------------------------------------------------
@@ -1354,7 +1354,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (uninitialized read)");
- if (H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0)
+ if (H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
goto error;
for (i=0; i<(size_t)size[0]; i++) {
@@ -1383,7 +1383,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
}
}
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points)<0)
+ if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
TEST_ERROR;
if((*dset_size=H5Dget_storage_size(dataset))==0) TEST_ERROR;
@@ -1406,19 +1406,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(status>=0) TEST_ERROR;
/* Callback decides to continue inspite data is corrupted. */
- if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0)
+ if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR;
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Callback decides to fail when data is corrupted. */
- if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR;
+ if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
} else {
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0)
+ if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
@@ -1452,7 +1452,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
points[i][j] = (int)HDrandom ();
}
}
- if (H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points)<0)
+ if (H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
TEST_ERROR;
if(corrupted) {
@@ -1464,12 +1464,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(status>=0) TEST_ERROR;
/* Callback decides to continue inspite data is corrupted. */
- if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0)
+ if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR;
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Callback decides to fail when data is corrupted. */
- if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR;
+ if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
@@ -1477,7 +1477,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(status>=0) TEST_ERROR;
} else {
/* Read the dataset back and check it */
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0)
+ if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
@@ -1505,8 +1505,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (re-open)");
- if (H5Dclose (dataset)<0) TEST_ERROR;
- if ((dataset = H5Dopen (fid, name))<0) TEST_ERROR;
+ if (H5Dclose (dataset) < 0) TEST_ERROR;
+ if ((dataset = H5Dopen (fid, name)) < 0) TEST_ERROR;
if(corrupted) {
/* Default behavior is failure when data is corrupted. */
@@ -1517,19 +1517,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(status>=0) TEST_ERROR;
/* Callback decides to continue inspite data is corrupted. */
- if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0)
+ if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR;
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Callback decides to fail when data is corrupted. */
- if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR;
+ if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
} else {
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0)
+ if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
@@ -1563,9 +1563,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
}
}
if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size,
- NULL)<0) TEST_ERROR;
+ NULL) < 0) TEST_ERROR;
/* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */
- if (H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points)<0)
+ if (H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0)
TEST_ERROR;
if(corrupted) {
@@ -1577,19 +1577,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(status>=0) TEST_ERROR;
/* Callback decides to continue inspite data is corrupted. */
- if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0)
+ if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR;
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Callback decides to fail when data is corrupted. */
- if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR;
+ if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
} else {
- if (H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check)<0)
+ if (H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
@@ -1617,9 +1617,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
/* Get the storage size of the dataset */
if((*dset_size=H5Dget_storage_size(dataset))==0) goto error;
/* Clean up objects used for this test */
- if (H5Dclose (dataset)<0) goto error;
- if (H5Sclose (sid)<0) goto error;
- if (H5Pclose (dxpl)<0) goto error;
+ if (H5Dclose (dataset) < 0) goto error;
+ if (H5Sclose (sid) < 0) goto error;
+ if (H5Pclose (dxpl) < 0) goto error;
free (tconv_buf);
return(0);
@@ -1688,10 +1688,11 @@ test_filter_noencoder(const char *dset_name, hid_t fapl)
/* Read the dataset and make sure the decoder is working correctly */
err = H5Dread(dset_id, H5T_NATIVE_INT, space_id, space_id, H5P_DEFAULT, read_buf);
- if (err < 0) goto error;
+ if(err < 0) goto error;
for(i = 0; i < 10; i++)
- if ( read_buf[i] != i ) goto error;
+ if(read_buf[i] != i)
+ goto error;
H5Sclose(space_id);
@@ -1704,10 +1705,10 @@ test_filter_noencoder(const char *dset_name, hid_t fapl)
TESTING(" trying to write without encoder");
dcpl_id = H5Dget_create_plist(dset_id);
- if (dcpl_id < 0) goto error;
+ if(dcpl_id < 0) goto error;
space_id = H5Screate_simple(1, &dims, NULL);
- if (space_id < 0) goto error;
+ if(space_id < 0) goto error;
H5E_BEGIN_TRY{
test_dset_id = H5Dcreate(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id , dcpl_id);
@@ -1721,10 +1722,10 @@ test_filter_noencoder(const char *dset_name, hid_t fapl)
*/
dims = 20; /* Dataset is originally of size 10 */
H5E_BEGIN_TRY{
- err = H5Dextend(dset_id, &dims);
+ err = H5Dset_extent(dset_id, &dims);
}H5E_END_TRY
- if (err >= 0) goto error;
+ if(err >= 0) goto error;
/* Attempt to write to the dataset. This should fail because
* the filter does not have an encoder.
@@ -1733,7 +1734,7 @@ test_filter_noencoder(const char *dset_name, hid_t fapl)
err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints);
}H5E_END_TRY
- if (err >= 0) goto error;
+ if(err >= 0) goto error;
H5Fclose(file_id);
H5Dclose(dset_id);
@@ -1907,15 +1908,15 @@ UNUSED
*----------------------------------------------------------
*/
puts("Testing 'null' filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
- if (H5Zregister (H5Z_BOGUS)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if (H5Zregister (H5Z_BOGUS) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_BOGUS, 0, (size_t)0, NULL) < 0) goto error;
- if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size)<0) goto error;
+ if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc)<0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
/*----------------------------------------------------------
* STEP 1: Test Fletcher32 Checksum by itself.
@@ -1923,12 +1924,12 @@ UNUSED
*/
#ifdef H5_HAVE_FILTER_FLETCHER32
puts("Testing Fletcher32 checksum(enabled for read)");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL) < 0) goto error;
/* Enable checksum during read */
- if(test_filter_internal(file,DSET_FLETCHER32_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size)<0) goto error;
+ if(test_filter_internal(file,DSET_FLETCHER32_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size) < 0) goto error;
if(fletcher32_size<=null_size) {
H5_FAILED();
puts(" Size after checksumming is incorrect.");
@@ -1937,7 +1938,7 @@ UNUSED
/* Disable checksum during read */
puts("Testing Fletcher32 checksum(disabled for read)");
- if(test_filter_internal(file,DSET_FLETCHER32_NAME_2,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size)<0) goto error;
+ if(test_filter_internal(file,DSET_FLETCHER32_NAME_2,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size) < 0) goto error;
if(fletcher32_size<=null_size) {
H5_FAILED();
puts(" Size after checksumming is incorrect.");
@@ -1952,9 +1953,9 @@ UNUSED
/* Temporarily disable this test because the changes in chunk caching conflicts with
* the way this test is conducted. -slu 2007/7/20 */
- if (H5Zregister (H5Z_CORRUPT)<0) goto error;
+ if (H5Zregister (H5Z_CORRUPT) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_CORRUPT, 0, (size_t)3, data_corrupt) < 0) goto error;
- if(test_filter_internal(file,DSET_FLETCHER32_NAME_3,dc,DISABLE_FLETCHER32,DATA_CORRUPTED,&fletcher32_size)<0) goto error;
+ if(test_filter_internal(file,DSET_FLETCHER32_NAME_3,dc,DISABLE_FLETCHER32,DATA_CORRUPTED,&fletcher32_size) < 0) goto error;
if(fletcher32_size<=null_size) {
H5_FAILED();
puts(" Size after checksumming is incorrect.");
@@ -1962,7 +1963,7 @@ UNUSED
} /* end if */
/* Clean up objects used for this test */
- if (H5Pclose (dc)<0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_FLETCHER32 */
TESTING("fletcher32 checksum");
@@ -1976,13 +1977,13 @@ UNUSED
*/
#ifdef H5_HAVE_FILTER_DEFLATE
puts("Testing deflate filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
- if (H5Pset_deflate (dc, 6)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_deflate (dc, 6) < 0) goto error;
- if(test_filter_internal(file,DSET_DEFLATE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deflate_size)<0) goto error;
+ if(test_filter_internal(file,DSET_DEFLATE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deflate_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc)<0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_DEFLATE */
TESTING("deflate filter");
SKIPPED();
@@ -1996,13 +1997,13 @@ UNUSED
#ifdef H5_HAVE_FILTER_SZIP
TESTING("szip filter (with encoder)");
if ( h5_szip_can_encode() == 1) {
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
puts("");
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error;
- if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size)<0) goto error;
- if (H5Pclose (dc)<0) goto error;
+ if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size) < 0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
} else {
SKIPPED();
}
@@ -2028,11 +2029,11 @@ UNUSED
*/
#ifdef H5_HAVE_FILTER_SHUFFLE
puts("Testing shuffle filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
- if (H5Pset_shuffle (dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_shuffle (dc) < 0) goto error;
- if(test_filter_internal(file,DSET_SHUFFLE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&shuffle_size)<0) goto error;
+ if(test_filter_internal(file,DSET_SHUFFLE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&shuffle_size) < 0) goto error;
if(shuffle_size!=null_size) {
H5_FAILED();
puts(" Shuffled size not the same as uncompressed size.");
@@ -2040,7 +2041,7 @@ UNUSED
} /* end if */
/* Clean up objects used for this test */
- if (H5Pclose (dc)<0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_SHUFFLE */
TESTING("shuffle filter");
SKIPPED();
@@ -2053,28 +2054,28 @@ UNUSED
*/
#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
puts("Testing shuffle+deflate+checksum filters(checksum first)");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
- if (H5Pset_fletcher32 (dc)<0) goto error;
- if (H5Pset_shuffle (dc)<0) goto error;
- if (H5Pset_deflate (dc, 6)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_fletcher32 (dc) < 0) goto error;
+ if (H5Pset_shuffle (dc) < 0) goto error;
+ if (H5Pset_deflate (dc, 6) < 0) goto error;
- if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error;
+ if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc)<0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
puts("Testing shuffle+deflate+checksum filters(checksum last)");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
- if (H5Pset_shuffle (dc)<0) goto error;
- if (H5Pset_deflate (dc, 6)<0) goto error;
- if (H5Pset_fletcher32 (dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_shuffle (dc) < 0) goto error;
+ if (H5Pset_deflate (dc, 6) < 0) goto error;
+ if (H5Pset_fletcher32 (dc) < 0) goto error;
- if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error;
+ if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc)<0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
TESTING("shuffle+deflate+fletcher32 filters");
SKIPPED();
@@ -2088,16 +2089,16 @@ UNUSED
#if defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
TESTING("shuffle+szip+checksum filters(checksum first, with encoder)");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
- if (H5Pset_fletcher32 (dc)<0) goto error;
- if (H5Pset_shuffle (dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_fletcher32 (dc) < 0) goto error;
+ if (H5Pset_shuffle (dc) < 0) goto error;
/* Make sure encoding is enabled */
if ( h5_szip_can_encode() == 1) {
puts("");
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error;
- if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error;
+ if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
} else {
SKIPPED();
}
@@ -2112,23 +2113,23 @@ UNUSED
}
/* Clean up objects used for this test */
- if (H5Pclose (dc)<0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
TESTING("shuffle+szip+checksum filters(checksum last, with encoder)");
/* Make sure encoding is enabled */
if ( h5_szip_can_encode() == 1) {
puts("");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
- if (H5Pset_shuffle (dc)<0) goto error;
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error;
- if (H5Pset_fletcher32 (dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_shuffle (dc) < 0) goto error;
+ if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if (H5Pset_fletcher32 (dc) < 0) goto error;
- if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error;
+ if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc)<0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
} else {
SKIPPED();
@@ -2186,7 +2187,7 @@ test_missing_filter(hid_t file)
} /* end if */
/* Unregister deflate filter (use internal function) */
- if (H5Z_unregister(H5Z_FILTER_DEFLATE)<0) {
+ if (H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) {
H5_FAILED();
printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
@@ -2200,17 +2201,17 @@ test_missing_filter(hid_t file)
} /* end if */
/* Create dcpl with deflate filter */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) {
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
- if(H5Pset_chunk(dcpl, 2, chunk_dims)<0) {
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
printf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
- if(H5Pset_deflate(dcpl, 9)<0) {
+ if(H5Pset_deflate(dcpl, 9) < 0) {
H5_FAILED();
printf(" Line %d: Can't set deflate filter\n",__LINE__);
goto error;
@@ -2230,28 +2231,28 @@ test_missing_filter(hid_t file)
} /* end if */
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL))<0) {
+ if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
- if ((dsid = H5Dcreate(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, dcpl))<0) {
+ if ((dsid = H5Dcreate(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0) {
+ if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
- if (H5Fflush(file, H5F_SCOPE_GLOBAL)<0) {
+ if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
printf(" Line %d: Error flushing file\n",__LINE__);
goto error;
@@ -2273,7 +2274,7 @@ test_missing_filter(hid_t file)
} /* end if */
/* Read data */
- if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check)<0) {
+ if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
printf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
@@ -2295,21 +2296,21 @@ test_missing_filter(hid_t file)
} /* end for */
/* Close dataset */
- if(H5Dclose(dsid)<0) {
+ if(H5Dclose(dsid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
- if(H5Sclose(sid)<0) {
+ if(H5Sclose(sid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
- if(H5Pclose(dcpl)<0) {
+ if(H5Pclose(dcpl) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
@@ -2326,14 +2327,14 @@ test_missing_filter(hid_t file)
HDstrcat(testfile, FILE_DEFLATE_NAME);
/* Open existing file */
- if((fid=H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT))<0) {
+ if((fid=H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open existing deflated file\n",__LINE__);
goto error;
} /* end if */
/* Open dataset */
- if ((dsid = H5Dopen(fid, "Dataset1"))<0) {
+ if ((dsid = H5Dopen(fid, "Dataset1")) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataset\n",__LINE__);
goto error;
@@ -2350,14 +2351,14 @@ test_missing_filter(hid_t file)
} /* end if */
/* Close dataset */
- if(H5Dclose(dsid)<0) {
+ if(H5Dclose(dsid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close existing file */
- if(H5Fclose(fid)<0) {
+ if(H5Fclose(fid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close file\n",__LINE__);
goto error;
@@ -2372,7 +2373,7 @@ test_missing_filter(hid_t file)
} /* end if */
#ifdef H5_HAVE_FILTER_DEFLATE
/* Register deflate filter (use internal function to avoid range checks) */
- if(H5Z_register(H5Z_DEFLATE)<0) {
+ if(H5Z_register(H5Z_DEFLATE) < 0) {
H5_FAILED();
printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
@@ -2430,16 +2431,16 @@ test_onebyte_shuffle(hid_t file)
#ifdef H5_HAVE_FILTER_SHUFFLE
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use shuffling algorithm with 8-bit */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
- if (H5Pset_shuffle (dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_shuffle (dc) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
for (i= 0;i< 10; i++)
for (j = 0; j < 20; j++)
@@ -2460,7 +2461,7 @@ test_onebyte_shuffle(hid_t file)
#ifdef H5_HAVE_FILTER_SHUFFLE
if (H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0)
+ orig_data) < 0)
goto error;
PASSED();
@@ -2478,7 +2479,7 @@ test_onebyte_shuffle(hid_t file)
#ifdef H5_HAVE_FILTER_SHUFFLE
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0)
+ new_data) < 0)
goto error;
/* Check that the values read are the same as the values written */
@@ -2498,8 +2499,8 @@ test_onebyte_shuffle(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Pclose (dc)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Pclose (dc) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2552,27 +2553,27 @@ test_nbit_int(hid_t file)
/* Define dataset datatype (integer), and set precision, offset */
datatype = H5Tcopy(H5T_NATIVE_INT);
precision = 17; /* precision includes sign bit */
- if(H5Tset_precision(datatype,precision)<0) goto error;
+ if(H5Tset_precision(datatype,precision) < 0) goto error;
offset = 4;
- if(H5Tset_offset(datatype,offset)<0) goto error;
+ if(H5Tset_offset(datatype,offset) < 0) goto error;
/* Copy to memory datatype before setting order */
mem_datatype = H5Tcopy(datatype);
/* Set order of dataset datatype */
- if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_nbit(dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_NBIT_INT_NAME, datatype,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of int */
for (i= 0;i< (size_t)size[0]; i++)
@@ -2600,7 +2601,7 @@ test_nbit_int(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
if (H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0)
+ orig_data) < 0)
goto error;
PASSED();
#else
@@ -2617,7 +2618,7 @@ test_nbit_int(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
if (H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0)
+ new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
@@ -2639,11 +2640,11 @@ test_nbit_int(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype)<0) goto error;
- if (H5Tclose(mem_datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(datatype) < 0) goto error;
+ if (H5Tclose(mem_datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2697,23 +2698,23 @@ test_nbit_float(hid_t file)
datatype = H5Tcopy(H5T_IEEE_F32BE);
if(H5Tset_fields(datatype, (size_t)26, (size_t)20, (size_t)6, (size_t)7, (size_t)13) < 0) goto error;
offset = 7;
- if(H5Tset_offset(datatype,offset)<0) goto error;
+ if(H5Tset_offset(datatype,offset) < 0) goto error;
precision = 20;
- if(H5Tset_precision(datatype,precision)<0) goto error;
+ if(H5Tset_precision(datatype,precision) < 0) goto error;
if(H5Tset_size(datatype, (size_t)4) < 0) goto error;
if(H5Tset_ebias(datatype, (size_t)31) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_nbit(dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_NBIT_FLOAT_NAME, datatype,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
PASSED();
#else
SKIPPED();
@@ -2729,7 +2730,7 @@ test_nbit_float(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0)
+ orig_data) < 0)
goto error;
PASSED();
@@ -2747,7 +2748,7 @@ test_nbit_float(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0)
+ new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
@@ -2769,10 +2770,10 @@ test_nbit_float(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2830,23 +2831,23 @@ test_nbit_double(hid_t file)
datatype = H5Tcopy(H5T_IEEE_F64BE);
if(H5Tset_fields(datatype, (size_t)55, (size_t)46, (size_t)9, (size_t)5, (size_t)41) < 0) goto error;
offset = 5;
- if(H5Tset_offset(datatype,offset)<0) goto error;
+ if(H5Tset_offset(datatype,offset) < 0) goto error;
precision = 51;
- if(H5Tset_precision(datatype,precision)<0) goto error;
+ if(H5Tset_precision(datatype,precision) < 0) goto error;
if(H5Tset_size(datatype, (size_t)8) < 0) goto error;
if(H5Tset_ebias(datatype, (size_t)255) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_nbit(dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_NBIT_DOUBLE_NAME, datatype,
- space, dc))<0) goto error;
+ space, dc)) < 0) goto error;
PASSED();
#else
@@ -2863,7 +2864,7 @@ test_nbit_double(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0)
+ orig_data) < 0)
goto error;
PASSED();
#else
@@ -2880,7 +2881,7 @@ test_nbit_double(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0)
+ new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
@@ -2902,10 +2903,10 @@ test_nbit_double(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2958,15 +2959,15 @@ test_nbit_array(hid_t file)
/* Define dataset array datatype's base datatype and set precision, offset */
base_datatype = H5Tcopy(H5T_NATIVE_UINT);
precision = 22;
- if(H5Tset_precision(base_datatype,precision)<0) goto error;
+ if(H5Tset_precision(base_datatype,precision) < 0) goto error;
offset = 7;
- if(H5Tset_offset(base_datatype,offset)<0) goto error;
+ if(H5Tset_offset(base_datatype,offset) < 0) goto error;
/* Copy to memory array datatype's base datatype before setting order */
mem_base_datatype = H5Tcopy(base_datatype);
/* Set order of dataset array datatype's base datatype */
- if(H5Tset_order(base_datatype, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(base_datatype, H5T_ORDER_BE) < 0) goto error;
/* Create dataset array datatype */
array_datatype = H5Tarray_create(base_datatype, 2, adims, NULL);
@@ -2975,16 +2976,16 @@ test_nbit_array(hid_t file)
mem_array_datatype = H5Tarray_create(mem_base_datatype, 2, adims, NULL);
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_nbit(dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_NBIT_ARRAY_NAME, array_datatype,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of unsigned int */
for (i= 0;i< (size_t)size[0]; i++)
@@ -3008,7 +3009,7 @@ test_nbit_array(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
if (H5Dwrite(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0)
+ orig_data) < 0)
goto error;
PASSED();
@@ -3026,7 +3027,7 @@ test_nbit_array(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
if (H5Dread(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0)
+ new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
@@ -3048,13 +3049,13 @@ test_nbit_array(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(array_datatype)<0) goto error;
- if (H5Tclose(base_datatype)<0) goto error;
- if (H5Tclose(mem_array_datatype)<0) goto error;
- if (H5Tclose(mem_base_datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(array_datatype) < 0) goto error;
+ if (H5Tclose(base_datatype) < 0) goto error;
+ if (H5Tclose(mem_array_datatype) < 0) goto error;
+ if (H5Tclose(mem_base_datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3122,14 +3123,14 @@ test_nbit_compound(hid_t file)
f_tid=H5Tcopy(H5T_IEEE_F32BE);
/* Set precision and offset etc. */
- if(H5Tset_precision(i_tid,precision[0])<0) goto error;
- if(H5Tset_offset(i_tid,offset[0])<0) goto error;
+ if(H5Tset_precision(i_tid,precision[0]) < 0) goto error;
+ if(H5Tset_offset(i_tid,offset[0]) < 0) goto error;
- if(H5Tset_precision(c_tid,precision[1])<0) goto error;
- if(H5Tset_offset(c_tid,offset[1])<0) goto error;
+ if(H5Tset_precision(c_tid,precision[1]) < 0) goto error;
+ if(H5Tset_offset(c_tid,offset[1]) < 0) goto error;
- if(H5Tset_precision(s_tid,precision[2])<0) goto error;
- if(H5Tset_offset(s_tid,offset[2])<0) goto error;
+ if(H5Tset_precision(s_tid,precision[2]) < 0) goto error;
+ if(H5Tset_offset(s_tid,offset[2]) < 0) goto error;
if(H5Tset_fields(f_tid, (size_t)26, (size_t)20, (size_t)6, (size_t)7, (size_t)13) < 0) goto error;
if(H5Tset_offset(f_tid, (size_t)7) < 0) goto error;
@@ -3139,34 +3140,34 @@ test_nbit_compound(hid_t file)
/* Create a memory compound datatype before setting the order */
mem_cmpd_tid = H5Tcreate(H5T_COMPOUND, sizeof(atomic));
- if(H5Tinsert(mem_cmpd_tid, "i", HOFFSET(atomic, i), i_tid)<0) goto error;
- if(H5Tinsert(mem_cmpd_tid, "c", HOFFSET(atomic, c), c_tid)<0) goto error;
- if(H5Tinsert(mem_cmpd_tid, "s", HOFFSET(atomic, s), s_tid)<0) goto error;
- if(H5Tinsert(mem_cmpd_tid, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT)<0) goto error;
+ if(H5Tinsert(mem_cmpd_tid, "i", HOFFSET(atomic, i), i_tid) < 0) goto error;
+ if(H5Tinsert(mem_cmpd_tid, "c", HOFFSET(atomic, c), c_tid) < 0) goto error;
+ if(H5Tinsert(mem_cmpd_tid, "s", HOFFSET(atomic, s), s_tid) < 0) goto error;
+ if(H5Tinsert(mem_cmpd_tid, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT) < 0) goto error;
/* Set order of dataset compound member datatype */
- if(H5Tset_order(i_tid, H5T_ORDER_BE)<0) goto error;
- if(H5Tset_order(c_tid, H5T_ORDER_BE)<0) goto error;
- if(H5Tset_order(s_tid, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(i_tid, H5T_ORDER_BE) < 0) goto error;
+ if(H5Tset_order(c_tid, H5T_ORDER_BE) < 0) goto error;
+ if(H5Tset_order(s_tid, H5T_ORDER_BE) < 0) goto error;
/* Create a dataset compound datatype and insert some atomic types */
cmpd_tid = H5Tcreate(H5T_COMPOUND, sizeof(atomic));
- if(H5Tinsert(cmpd_tid, "i", HOFFSET(atomic, i), i_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid, "c", HOFFSET(atomic, c), c_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid, "s", HOFFSET(atomic, s), s_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid, "f", HOFFSET(atomic, f), f_tid)<0) goto error;
+ if(H5Tinsert(cmpd_tid, "i", HOFFSET(atomic, i), i_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid, "c", HOFFSET(atomic, c), c_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid, "s", HOFFSET(atomic, s), s_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid, "f", HOFFSET(atomic, f), f_tid) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_nbit(dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME, cmpd_tid,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of member datatypes */
for (i= 0;i< (size_t)size[0]; i++)
@@ -3201,7 +3202,7 @@ test_nbit_compound(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
if (H5Dwrite(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0)
+ orig_data) < 0)
goto error;
PASSED();
#else
@@ -3218,7 +3219,7 @@ test_nbit_compound(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
if (H5Dread(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0)
+ new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
@@ -3246,15 +3247,15 @@ test_nbit_compound(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(i_tid)<0) goto error;
- if (H5Tclose(c_tid)<0) goto error;
- if (H5Tclose(s_tid)<0) goto error;
- if (H5Tclose(f_tid)<0) goto error;
- if (H5Tclose(cmpd_tid)<0) goto error;
- if (H5Tclose(mem_cmpd_tid)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(i_tid) < 0) goto error;
+ if (H5Tclose(c_tid) < 0) goto error;
+ if (H5Tclose(s_tid) < 0) goto error;
+ if (H5Tclose(f_tid) < 0) goto error;
+ if (H5Tclose(cmpd_tid) < 0) goto error;
+ if (H5Tclose(mem_cmpd_tid) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3338,14 +3339,14 @@ test_nbit_compound_2(hid_t file)
f_tid=H5Tcopy(H5T_IEEE_F32BE);
/* Set precision and offset etc. of atomic compound datatype members */
- if(H5Tset_precision(i_tid,precision[0])<0) goto error;
- if(H5Tset_offset(i_tid,offset[0])<0) goto error;
+ if(H5Tset_precision(i_tid,precision[0]) < 0) goto error;
+ if(H5Tset_offset(i_tid,offset[0]) < 0) goto error;
- if(H5Tset_precision(c_tid,precision[1])<0) goto error;
- if(H5Tset_offset(c_tid,offset[1])<0) goto error;
+ if(H5Tset_precision(c_tid,precision[1]) < 0) goto error;
+ if(H5Tset_offset(c_tid,offset[1]) < 0) goto error;
- if(H5Tset_precision(s_tid,precision[2])<0) goto error;
- if(H5Tset_offset(s_tid,offset[2])<0) goto error;
+ if(H5Tset_precision(s_tid,precision[2]) < 0) goto error;
+ if(H5Tset_offset(s_tid,offset[2]) < 0) goto error;
if(H5Tset_fields(f_tid, (size_t)26, (size_t)20, (size_t)6, (size_t)7, (size_t)13) < 0) goto error;
if(H5Tset_offset(f_tid, (size_t)7) < 0) goto error;
@@ -3355,31 +3356,31 @@ test_nbit_compound_2(hid_t file)
/* Create a memory atomic compound datatype before setting the order */
mem_cmpd_tid1 = H5Tcreate(H5T_COMPOUND, sizeof(atomic));
- if(H5Tinsert(mem_cmpd_tid1, "i", HOFFSET(atomic, i), i_tid)<0) goto error;
- if(H5Tinsert(mem_cmpd_tid1, "c", HOFFSET(atomic, c), c_tid)<0) goto error;
- if(H5Tinsert(mem_cmpd_tid1, "s", HOFFSET(atomic, s), s_tid)<0) goto error;
- if(H5Tinsert(mem_cmpd_tid1, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT)<0) goto error;
+ if(H5Tinsert(mem_cmpd_tid1, "i", HOFFSET(atomic, i), i_tid) < 0) goto error;
+ if(H5Tinsert(mem_cmpd_tid1, "c", HOFFSET(atomic, c), c_tid) < 0) goto error;
+ if(H5Tinsert(mem_cmpd_tid1, "s", HOFFSET(atomic, s), s_tid) < 0) goto error;
+ if(H5Tinsert(mem_cmpd_tid1, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT) < 0) goto error;
/* Set order of dataset atomic compound member datatype */
- if(H5Tset_order(i_tid, H5T_ORDER_BE)<0) goto error;
- if(H5Tset_order(c_tid, H5T_ORDER_BE)<0) goto error;
- if(H5Tset_order(s_tid, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(i_tid, H5T_ORDER_BE) < 0) goto error;
+ if(H5Tset_order(c_tid, H5T_ORDER_BE) < 0) goto error;
+ if(H5Tset_order(s_tid, H5T_ORDER_BE) < 0) goto error;
/* Create a dataset atomic compound datatype and insert some atomic types */
cmpd_tid1 = H5Tcreate(H5T_COMPOUND, sizeof(atomic));
- if(H5Tinsert(cmpd_tid1, "i", HOFFSET(atomic, i), i_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid1, "c", HOFFSET(atomic, c), c_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid1, "s", HOFFSET(atomic, s), s_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid1, "f", HOFFSET(atomic, f), f_tid)<0) goto error;
+ if(H5Tinsert(cmpd_tid1, "i", HOFFSET(atomic, i), i_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid1, "c", HOFFSET(atomic, c), c_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid1, "s", HOFFSET(atomic, s), s_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid1, "f", HOFFSET(atomic, f), f_tid) < 0) goto error;
/* Set precision and offset of the other data member */
- if(H5Tset_precision(v_tid,precision[3])<0) goto error;
- if(H5Tset_offset(v_tid,offset[3])<0) goto error;
+ if(H5Tset_precision(v_tid,precision[3]) < 0) goto error;
+ if(H5Tset_offset(v_tid,offset[3]) < 0) goto error;
/* Create the simple array datatype */
base_tid = H5Tcopy(H5T_NATIVE_CHAR);
- if(H5Tset_precision(base_tid,precision[4])<0) goto error;
- if(H5Tset_offset(base_tid,offset[4])<0) goto error;
+ if(H5Tset_precision(base_tid,precision[4]) < 0) goto error;
+ if(H5Tset_offset(base_tid,offset[4]) < 0) goto error;
array_tid = H5Tarray_create(base_tid, 2, array_dims, NULL);
/* Create the complex memory and dataset array datatype */
@@ -3388,32 +3389,32 @@ test_nbit_compound_2(hid_t file)
/* Create a memory complex compound datatype before setting the order */
mem_cmpd_tid2 = H5Tcreate(H5T_COMPOUND, sizeof(complex));
- if(H5Tinsert(mem_cmpd_tid2, "a", HOFFSET(complex, a), mem_cmpd_tid1)<0) goto error;
- if(H5Tinsert(mem_cmpd_tid2, "v", HOFFSET(complex, v), v_tid)<0) goto error;
- if(H5Tinsert(mem_cmpd_tid2, "b", HOFFSET(complex, b), array_tid)<0) goto error;
- if(H5Tinsert(mem_cmpd_tid2, "d", HOFFSET(complex, d), mem_array_cmplx_tid)<0) goto error;
+ if(H5Tinsert(mem_cmpd_tid2, "a", HOFFSET(complex, a), mem_cmpd_tid1) < 0) goto error;
+ if(H5Tinsert(mem_cmpd_tid2, "v", HOFFSET(complex, v), v_tid) < 0) goto error;
+ if(H5Tinsert(mem_cmpd_tid2, "b", HOFFSET(complex, b), array_tid) < 0) goto error;
+ if(H5Tinsert(mem_cmpd_tid2, "d", HOFFSET(complex, d), mem_array_cmplx_tid) < 0) goto error;
/* Set order of dataset other complex compound member datatype */
- if(H5Tset_order(v_tid, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(v_tid, H5T_ORDER_BE) < 0) goto error;
/* Create a dataset complex compound datatype and insert members */
cmpd_tid2 = H5Tcreate(H5T_COMPOUND, sizeof(complex));
- if(H5Tinsert(cmpd_tid2, "a", HOFFSET(complex, a), cmpd_tid1)<0) goto error;
- if(H5Tinsert(cmpd_tid2, "v", HOFFSET(complex, v), v_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid2, "b", HOFFSET(complex, b), array_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid2, "d", HOFFSET(complex, d), array_cmplx_tid)<0) goto error;
+ if(H5Tinsert(cmpd_tid2, "a", HOFFSET(complex, a), cmpd_tid1) < 0) goto error;
+ if(H5Tinsert(cmpd_tid2, "v", HOFFSET(complex, v), v_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid2, "b", HOFFSET(complex, b), array_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid2, "d", HOFFSET(complex, d), array_cmplx_tid) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_nbit(dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME_2, cmpd_tid2,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of member datatypes */
for (i= 0;i< (size_t)size[0]; i++)
@@ -3461,7 +3462,7 @@ test_nbit_compound_2(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
if (H5Dwrite(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0)
+ orig_data) < 0)
goto error;
PASSED();
#else
@@ -3478,7 +3479,7 @@ test_nbit_compound_2(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
if (H5Dread(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0)
+ new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
@@ -3530,22 +3531,22 @@ test_nbit_compound_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(i_tid)<0) goto error;
- if (H5Tclose(c_tid)<0) goto error;
- if (H5Tclose(s_tid)<0) goto error;
- if (H5Tclose(f_tid)<0) goto error;
- if (H5Tclose(v_tid)<0) goto error;
- if (H5Tclose(cmpd_tid2)<0) goto error;
- if (H5Tclose(cmpd_tid1)<0) goto error;
- if (H5Tclose(mem_cmpd_tid2)<0) goto error;
- if (H5Tclose(mem_cmpd_tid1)<0) goto error;
- if (H5Tclose(array_tid)<0) goto error;
- if (H5Tclose(base_tid)<0) goto error;
- if (H5Tclose(array_cmplx_tid)<0) goto error;
- if (H5Tclose(mem_array_cmplx_tid)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(i_tid) < 0) goto error;
+ if (H5Tclose(c_tid) < 0) goto error;
+ if (H5Tclose(s_tid) < 0) goto error;
+ if (H5Tclose(f_tid) < 0) goto error;
+ if (H5Tclose(v_tid) < 0) goto error;
+ if (H5Tclose(cmpd_tid2) < 0) goto error;
+ if (H5Tclose(cmpd_tid1) < 0) goto error;
+ if (H5Tclose(mem_cmpd_tid2) < 0) goto error;
+ if (H5Tclose(mem_cmpd_tid1) < 0) goto error;
+ if (H5Tclose(array_tid) < 0) goto error;
+ if (H5Tclose(base_tid) < 0) goto error;
+ if (H5Tclose(array_cmplx_tid) < 0) goto error;
+ if (H5Tclose(mem_array_cmplx_tid) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3611,37 +3612,37 @@ test_nbit_compound_3(hid_t file)
if(H5Tset_size(str_tid, (size_t)30) < 0) goto error;
vl_str_tid = H5Tcopy(H5T_C_S1);
- if(H5Tset_size(vl_str_tid,H5T_VARIABLE)<0) goto error;
+ if(H5Tset_size(vl_str_tid,H5T_VARIABLE) < 0) goto error;
- if((v_tid = H5Tvlen_create(H5T_NATIVE_UINT))<0) goto error;
+ if((v_tid = H5Tvlen_create(H5T_NATIVE_UINT)) < 0) goto error;
if((o_tid = H5Tcreate(H5T_OPAQUE, (size_t)5)) < 0) goto error;
- if(H5Tset_tag(o_tid, "testing opaque field")<0) goto error;
+ if(H5Tset_tag(o_tid, "testing opaque field") < 0) goto error;
/* Create a dataset compound datatype and insert some atomic types */
cmpd_tid = H5Tcreate(H5T_COMPOUND, sizeof(atomic));
- if(H5Tinsert(cmpd_tid, "i", HOFFSET(atomic, i), i_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid, "str", HOFFSET(atomic, str), str_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid, "vl_str", HOFFSET(atomic, vl_str), vl_str_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid, "v", HOFFSET(atomic, v), v_tid)<0) goto error;
- if(H5Tinsert(cmpd_tid, "r", HOFFSET(atomic, r), H5T_STD_REF_OBJ)<0) goto error;
- if(H5Tinsert(cmpd_tid, "o", HOFFSET(atomic, o), o_tid)<0) goto error;
+ if(H5Tinsert(cmpd_tid, "i", HOFFSET(atomic, i), i_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid, "str", HOFFSET(atomic, str), str_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid, "vl_str", HOFFSET(atomic, vl_str), vl_str_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid, "v", HOFFSET(atomic, v), v_tid) < 0) goto error;
+ if(H5Tinsert(cmpd_tid, "r", HOFFSET(atomic, r), H5T_STD_REF_OBJ) < 0) goto error;
+ if(H5Tinsert(cmpd_tid, "o", HOFFSET(atomic, o), o_tid) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(1, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(1, size, NULL)) < 0) goto error;
/* Use nbit filter */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dc, 1, chunk_size)<0) goto error;
- if (H5Pset_nbit(dc)<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_chunk(dc, 1, chunk_size) < 0) goto error;
+ if (H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME_3, cmpd_tid,
- space, dc))<0) goto error;
+ space, dc)) < 0) goto error;
/* Create the dataset object reference points to */
if ((obj_ref_dataset = H5Dcreate(file, "nbit_obj_ref", H5T_NATIVE_INT,
- space, H5P_DEFAULT))<0) goto error;
+ space, H5P_DEFAULT)) < 0) goto error;
/* Initialize data */
for(i = 0; i < (size_t)size[0]; i++) {
@@ -3654,7 +3655,7 @@ test_nbit_compound_3(hid_t file)
for(k = 0; k < (i+1); k++) ((unsigned int *)orig_data[i].v.p)[k] = (unsigned int)(i*100 + k);
/* Create reference to the dataset "nbit_obj_ref" */
- if(H5Rcreate(&orig_data[i].r, file, "nbit_obj_ref", H5R_OBJECT, -1)<0) goto error;
+ if(H5Rcreate(&orig_data[i].r, file, "nbit_obj_ref", H5R_OBJECT, -1) < 0) goto error;
for(j = 0; j < 5; j++) orig_data[i].o[j] = (unsigned char)(i + j);
}
@@ -3674,7 +3675,7 @@ test_nbit_compound_3(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
if (H5Dwrite(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0)
+ orig_data) < 0)
goto error;
PASSED();
#else
@@ -3691,7 +3692,7 @@ test_nbit_compound_3(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
if (H5Dread(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0)
+ new_data) < 0)
goto error;
/* Check that the values read are the same as the values written */
@@ -3731,18 +3732,18 @@ test_nbit_compound_3(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data)<0) goto error;
- if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data)<0) goto error;
- if (H5Tclose(i_tid)<0) goto error;
- if (H5Tclose(str_tid)<0) goto error;
- if (H5Tclose(vl_str_tid)<0) goto error;
- if (H5Tclose(v_tid)<0) goto error;
- if (H5Tclose(o_tid)<0) goto error;
- if (H5Tclose(cmpd_tid)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(obj_ref_dataset)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error;
+ if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error;
+ if (H5Tclose(i_tid) < 0) goto error;
+ if (H5Tclose(str_tid) < 0) goto error;
+ if (H5Tclose(vl_str_tid) < 0) goto error;
+ if (H5Tclose(v_tid) < 0) goto error;
+ if (H5Tclose(o_tid) < 0) goto error;
+ if (H5Tclose(cmpd_tid) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(obj_ref_dataset) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3793,24 +3794,24 @@ test_scaleoffset_int(hid_t file)
datatype = H5Tcopy(H5T_NATIVE_INT);
/* Set order of dataset datatype */
- if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Fill value undefined */
- if (H5Pset_fill_value(dc, datatype, NULL)<0) goto error;
+ if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
/* Set up to use scaleoffset filter, let library calculate minbits */
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT)<0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME, datatype,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Initialize data */
for (i= 0;i< (size_t)size[0]; i++)
@@ -3837,7 +3838,7 @@ test_scaleoffset_int(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0) goto error;
+ orig_data) < 0) goto error;
PASSED();
#else
SKIPPED();
@@ -3853,7 +3854,7 @@ test_scaleoffset_int(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0) goto error;
+ new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
for (i=0; i<(size_t)size[0]; i++) {
@@ -3871,10 +3872,10 @@ test_scaleoffset_int(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3928,28 +3929,28 @@ test_scaleoffset_int_2(hid_t file)
datatype = H5Tcopy(H5T_NATIVE_INT);
/* Set order of dataset datatype */
- if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space for the dataset */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Set fill value */
fillval = 10000;
- if (H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval)<0) goto error;
+ if (H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval) < 0) goto error;
/* Set up to use scaleoffset filter, let library calculate minbits */
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT)<0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME_2, datatype,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Create the memory data space */
- if ((mspace = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Select hyperslab for data to write, using 1x5 blocks,
* (1,1) stride and (1,1) count starting at the position (0,0).
@@ -3959,7 +3960,7 @@ test_scaleoffset_int_2(hid_t file)
count[0] = 1; count[1] = 1;
block[0] = 1; block[1] = 5;
if(H5Sselect_hyperslab(mspace, H5S_SELECT_SET, start,
- stride, count, block)<0) goto error;
+ stride, count, block) < 0) goto error;
/* Initialize data of hyperslab */
for (j = 0; j < (size_t)size[1]; j++) {
@@ -3986,7 +3987,7 @@ test_scaleoffset_int_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* only data in the hyperslab will be written, other value should be fill value */
if (H5Dwrite(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
- orig_data)<0) goto error;
+ orig_data) < 0) goto error;
PASSED();
#else
SKIPPED();
@@ -4002,7 +4003,7 @@ test_scaleoffset_int_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
- new_data)<0) goto error;
+ new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
for (j=0; j<(size_t)size[1]; j++) {
@@ -4018,10 +4019,10 @@ test_scaleoffset_int_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4070,26 +4071,26 @@ test_scaleoffset_float(hid_t file)
datatype = H5Tcopy(H5T_NATIVE_FLOAT);
/* Set order of dataset datatype */
- if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Fill value undefined */
- if (H5Pset_fill_value(dc, datatype, NULL)<0) goto error;
+ if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 3,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3)<0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME, datatype,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Initialize data */
for (i= 0;i< (size_t)size[0]; i++)
@@ -4116,7 +4117,7 @@ test_scaleoffset_float(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0) goto error;
+ orig_data) < 0) goto error;
PASSED();
#else
SKIPPED();
@@ -4132,7 +4133,7 @@ test_scaleoffset_float(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0) goto error;
+ new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
for (i=0; i<(size_t)size[0]; i++) {
@@ -4150,10 +4151,10 @@ test_scaleoffset_float(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4207,30 +4208,30 @@ test_scaleoffset_float_2(hid_t file)
datatype = H5Tcopy(H5T_NATIVE_FLOAT);
/* Set order of dataset datatype */
- if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space for the dataset */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Set fill value */
fillval = 10000.0;
- if (H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval)<0) goto error;
+ if (H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 3,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3)<0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME_2, datatype,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Create the memory data space */
- if ((mspace = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Select hyperslab for data to write, using 1x5 blocks,
* (1,1) stride and (1,1) count starting at the position (0,0).
@@ -4240,7 +4241,7 @@ test_scaleoffset_float_2(hid_t file)
count[0] = 1; count[1] = 1;
block[0] = 1; block[1] = 5;
if(H5Sselect_hyperslab(mspace, H5S_SELECT_SET, start,
- stride, count, block)<0) goto error;
+ stride, count, block) < 0) goto error;
/* Initialize data of hyperslab */
for (j = 0; j < (size_t)size[1]; j++) {
@@ -4267,7 +4268,7 @@ test_scaleoffset_float_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* only data in the hyperslab will be written, other value should be fill value */
if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
- orig_data)<0) goto error;
+ orig_data) < 0) goto error;
PASSED();
#else
SKIPPED();
@@ -4283,7 +4284,7 @@ test_scaleoffset_float_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
- new_data)<0) goto error;
+ new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
for (j=0; j<(size_t)size[1]; j++) {
@@ -4298,10 +4299,10 @@ test_scaleoffset_float_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4350,26 +4351,26 @@ test_scaleoffset_double(hid_t file)
datatype = H5Tcopy(H5T_NATIVE_DOUBLE);
/* Set order of dataset datatype */
- if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Fill value undefined */
- if (H5Pset_fill_value(dc, datatype, NULL)<0) goto error;
+ if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 7,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7)<0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME, datatype,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Initialize data */
for (i= 0;i< (size_t)size[0]; i++)
@@ -4396,7 +4397,7 @@ test_scaleoffset_double(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data)<0) goto error;
+ orig_data) < 0) goto error;
PASSED();
#else
SKIPPED();
@@ -4412,7 +4413,7 @@ test_scaleoffset_double(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data)<0) goto error;
+ new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
for (i=0; i<(size_t)size[0]; i++) {
@@ -4430,10 +4431,10 @@ test_scaleoffset_double(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4487,30 +4488,30 @@ test_scaleoffset_double_2(hid_t file)
datatype = H5Tcopy(H5T_NATIVE_DOUBLE);
/* Set order of dataset datatype */
- if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error;
+ if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space for the dataset */
- if ((space = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Set fill value */
fillval = 10000.0;
- if (H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval)<0) goto error;
+ if (H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 7,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7)<0) goto error;
+ if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME_2, datatype,
- space,dc))<0) goto error;
+ space,dc)) < 0) goto error;
/* Create the memory data space */
- if ((mspace = H5Screate_simple(2, size, NULL))<0) goto error;
+ if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Select hyperslab for data to write, using 1x5 blocks,
* (1,1) stride and (1,1) count starting at the position (0,0).
@@ -4520,7 +4521,7 @@ test_scaleoffset_double_2(hid_t file)
count[0] = 1; count[1] = 1;
block[0] = 1; block[1] = 5;
if(H5Sselect_hyperslab(mspace, H5S_SELECT_SET, start,
- stride, count, block)<0) goto error;
+ stride, count, block) < 0) goto error;
/* Initialize data of hyperslab */
for (j = 0; j < (size_t)size[1]; j++) {
@@ -4547,7 +4548,7 @@ test_scaleoffset_double_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* only data in the hyperslab will be written, other value should be fill value */
if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
- orig_data)<0) goto error;
+ orig_data) < 0) goto error;
PASSED();
#else
SKIPPED();
@@ -4563,7 +4564,7 @@ test_scaleoffset_double_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
- new_data)<0) goto error;
+ new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
for (j=0; j<(size_t)size[1]; j++) {
@@ -4579,10 +4580,10 @@ test_scaleoffset_double_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype)<0) goto error;
- if (H5Pclose(dc)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Dclose(dataset)<0) goto error;
+ if (H5Tclose(datatype) < 0) goto error;
+ if (H5Pclose(dc) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4617,7 +4618,7 @@ error:
static herr_t
test_multiopen (hid_t file)
{
- hid_t dcpl=-1, space=-1, dset1=-1, dset2=-1;
+ hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1;
hsize_t cur_size[1] = {10};
static hsize_t max_size[1] = {H5S_UNLIMITED};
hsize_t tmp_size[1];
@@ -4625,41 +4626,40 @@ test_multiopen (hid_t file)
TESTING("multi-open with extending");
/* Create the dataset and open it twice */
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dcpl, 1, cur_size)<0) goto error;
- if ((space=H5Screate_simple (1, cur_size, max_size))<0) goto error;
- if ((dset1=H5Dcreate (file, "multiopen", H5T_NATIVE_INT, space,
- dcpl))<0) goto error;
- if ((dset2=H5Dopen (dset1, "."))<0) goto error;
- if (H5Sclose (space)<0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if(H5Pset_chunk(dcpl, 1, cur_size) < 0) goto error;
+ if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if((dset1 = H5Dcreate(file, "multiopen", H5T_NATIVE_INT, space, dcpl)) < 0) goto error;
+ if((dset2 = H5Dopen(dset1, ".")) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
/* Extend with the first handle */
cur_size[0] = 20;
- if (H5Dextend (dset1, cur_size)<0) goto error;
+ if(H5Dset_extent(dset1, cur_size) < 0) goto error;
/* Get the size from the second handle */
- if ((space = H5Dget_space (dset2))<0) goto error;
- if (H5Sget_simple_extent_dims (space, tmp_size, NULL)<0) goto error;
- if (cur_size[0]!=tmp_size[0]) {
+ if((space = H5Dget_space(dset2)) < 0) goto error;
+ if(H5Sget_simple_extent_dims(space, tmp_size, NULL) < 0) goto error;
+ if(cur_size[0] != tmp_size[0]) {
H5_FAILED();
- printf (" Got %d instead of %d!\n",
- (int)tmp_size[0], (int)cur_size[0]);
+ printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]);
goto error;
}
- if (H5Dclose (dset1)<0) goto error;
- if (H5Dclose (dset2)<0) goto error;
- if (H5Sclose (space)<0) goto error;
- if (H5Pclose (dcpl)<0) goto error;
+ if(H5Dclose(dset1) < 0) goto error;
+ if(H5Dclose(dset2) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
+
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Dclose (dset1);
- H5Dclose (dset2);
- H5Sclose (space);
- H5Pclose (dcpl);
+ H5Dclose(dset1);
+ H5Dclose(dset2);
+ H5Sclose(space);
+ H5Pclose(dcpl);
} H5E_END_TRY;
return -1;
}
@@ -4694,30 +4694,30 @@ test_types(hid_t file)
/* bitfield_1 */
nelmts = sizeof(buf);
- if ((type=H5Tcopy(H5T_STD_B8LE))<0 ||
- (space=H5Screate_simple(1, &nelmts, NULL))<0 ||
- (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT))<0)
+ if ((type=H5Tcopy(H5T_STD_B8LE)) < 0 ||
+ (space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
+ (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT)) < 0)
goto error;
for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
- if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
+ if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Tclose(type)<0) goto error;
- if (H5Dclose(dset)<0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Tclose(type) < 0) goto error;
+ if (H5Dclose(dset) < 0) goto error;
/* bitfield_2 */
nelmts = sizeof(buf)/2;
- if ((type=H5Tcopy(H5T_STD_B16LE))<0 ||
- (space=H5Screate_simple(1, &nelmts, NULL))<0 ||
- (dset=H5Dcreate(grp, "bitfield_2", type, space, H5P_DEFAULT))<0)
+ if ((type=H5Tcopy(H5T_STD_B16LE)) < 0 ||
+ (space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
+ (dset=H5Dcreate(grp, "bitfield_2", type, space, H5P_DEFAULT)) < 0)
goto error;
for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
- if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
+ if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Tclose(type)<0) goto error;
- if (H5Dclose(dset)<0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Tclose(type) < 0) goto error;
+ if (H5Dclose(dset) < 0) goto error;
/* opaque_1 */
nelmts = sizeof(buf);
@@ -4729,9 +4729,9 @@ test_types(hid_t file)
for(i = 0; i < sizeof buf; i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Tclose(type)<0) goto error;
- if (H5Dclose(dset)<0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Tclose(type) < 0) goto error;
+ if (H5Dclose(dset) < 0) goto error;
/* opaque_2 */
nelmts = sizeof(buf)/4;
@@ -4743,12 +4743,12 @@ test_types(hid_t file)
for(i = 0; i < sizeof buf; i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Tclose(type)<0) goto error;
- if (H5Dclose(dset)<0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Tclose(type) < 0) goto error;
+ if (H5Dclose(dset) < 0) goto error;
/* Cleanup */
- if (H5Gclose(grp)<0) goto error;
+ if (H5Gclose(grp) < 0) goto error;
PASSED();
return 0;
@@ -4802,17 +4802,17 @@ test_can_apply(hid_t file)
TESTING("dataset filter 'can apply' callback");
/* Create dcpl with special filter */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) {
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
- if(H5Pset_chunk(dcpl, 2, chunk_dims)<0) {
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
printf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
- if(H5Zregister (H5Z_CAN_APPLY_TEST)<0) {
+ if(H5Zregister (H5Z_CAN_APPLY_TEST) < 0) {
H5_FAILED();
printf(" Line %d: Can't register 'can apply' filter\n",__LINE__);
goto error;
@@ -4824,7 +4824,7 @@ test_can_apply(hid_t file)
}
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL))<0) {
+ if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
@@ -4843,21 +4843,21 @@ test_can_apply(hid_t file)
} /* end if */
/* Create new dataset */
- if ((dsid = H5Dcreate(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, dcpl))<0) {
+ if ((dsid = H5Dcreate(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0) {
+ if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
- if (H5Fflush(file, H5F_SCOPE_GLOBAL)<0) {
+ if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
printf(" Line %d: Error flushing file\n",__LINE__);
goto error;
@@ -4878,7 +4878,7 @@ test_can_apply(hid_t file)
} /* end if */
/* Read data */
- if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check)<0) {
+ if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
printf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
@@ -4900,21 +4900,21 @@ test_can_apply(hid_t file)
} /* end for */
/* Close dataset */
- if(H5Dclose(dsid)<0) {
+ if(H5Dclose(dsid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
- if(H5Sclose(sid)<0) {
+ if(H5Sclose(sid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
- if(H5Pclose(dcpl)<0) {
+ if(H5Pclose(dcpl) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
@@ -4969,19 +4969,19 @@ file)
if (h5_szip_can_encode() == 1) {
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL))<0) {
+ if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create dcpl with special filter */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) {
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
- if(H5Pset_chunk(dcpl, 2, chunk_dims)<0) {
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
printf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
@@ -5011,7 +5011,7 @@ file)
/* Set (invalid at dataset creation time) szip parameters */
szip_pixels_per_block=2;
- if(H5Pset_szip (dcpl, szip_options_mask, szip_pixels_per_block)<0) {
+ if(H5Pset_szip (dcpl, szip_options_mask, szip_pixels_per_block) < 0) {
H5_FAILED();
printf(" Line %d: Can't set szip filter\n",__LINE__);
goto error;
@@ -5030,40 +5030,40 @@ file)
} /* end if */
/* Close dataset */
- if(H5Dclose(dsid)<0) {
+ if(H5Dclose(dsid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
- if(H5Sclose(sid)<0) {
+ if(H5Sclose(sid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
- if(H5Pclose(dcpl)<0) {
+ if(H5Pclose(dcpl) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
} /* end if */
/* Create another data space */
- if ((sid = H5Screate_simple(2, dims2, NULL))<0) {
+ if ((sid = H5Screate_simple(2, dims2, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create dcpl with special filter */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) {
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
- if(H5Pset_chunk(dcpl, 2, chunk_dims2)<0) {
+ if(H5Pset_chunk(dcpl, 2, chunk_dims2) < 0) {
H5_FAILED();
printf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
@@ -5071,7 +5071,7 @@ file)
/* Set (invalid at dataset creation time) szip parameters */
szip_pixels_per_block=32;
- if(H5Pset_szip (dcpl, szip_options_mask, szip_pixels_per_block)<0) {
+ if(H5Pset_szip (dcpl, szip_options_mask, szip_pixels_per_block) < 0) {
H5_FAILED();
printf(" Line %d: Can't set szip filter\n",__LINE__);
goto error;
@@ -5090,14 +5090,14 @@ file)
} /* end if */
/* Close dataspace */
- if(H5Sclose(sid)<0) {
+ if(H5Sclose(sid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
- if(H5Pclose(dcpl)<0) {
+ if(H5Pclose(dcpl) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
@@ -5175,24 +5175,24 @@ test_set_local(hid_t fapl)
}
/* Open file */
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
+ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open file\n",__LINE__);
goto error;
}
/* Create dcpl with special filter */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) {
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
- if(H5Pset_chunk(dcpl, 2, chunk_dims)<0) {
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
printf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
- if(H5Zregister (H5Z_SET_LOCAL_TEST)<0) {
+ if(H5Zregister (H5Z_SET_LOCAL_TEST) < 0) {
H5_FAILED();
printf(" Line %d: Can't register 'set local' filter\n",__LINE__);
goto error;
@@ -5204,28 +5204,28 @@ test_set_local(hid_t fapl)
}
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL))<0) {
+ if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
- if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, dcpl))<0) {
+ if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0) {
+ if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Close dataset */
- if(H5Dclose(dsid)<0) {
+ if(H5Dclose(dsid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
@@ -5233,56 +5233,56 @@ test_set_local(hid_t fapl)
/* Create new dataset */
/* (Shouldn't get modified by output filter) */
- if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, dcpl))<0) {
+ if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, dcpl)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl)<0) {
+ if (H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Close dataset */
- if(H5Dclose(dsid)<0) {
+ if(H5Dclose(dsid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
- if(H5Sclose(sid)<0) {
+ if(H5Sclose(sid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
- if(H5Pclose(dcpl)<0) {
+ if(H5Pclose(dcpl) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
} /* end if */
/* Close file (flushes & empties cache) */
- if (H5Fclose(file)<0) {
+ if (H5Fclose(file) < 0) {
H5_FAILED();
printf(" Line %d: Can't close file\n",__LINE__);
goto error;
} /* end if */
/* Open file */
- if ((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0) {
+ if ((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open file\n",__LINE__);
goto error;
}
/* Re-open dataset */
- if ((dsid = H5Dopen(file, DSET_SET_LOCAL_NAME))<0) {
+ if ((dsid = H5Dopen(file, DSET_SET_LOCAL_NAME)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataset\n",__LINE__);
goto error;
@@ -5303,7 +5303,7 @@ test_set_local(hid_t fapl)
} /* end if */
/* Read data */
- if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check)<0) {
+ if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
printf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
@@ -5325,14 +5325,14 @@ test_set_local(hid_t fapl)
} /* end for */
/* Close dataset */
- if(H5Dclose(dsid)<0) {
+ if(H5Dclose(dsid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Re-open second dataset */
- if ((dsid = H5Dopen(file, DSET_SET_LOCAL_NAME_2))<0) {
+ if ((dsid = H5Dopen(file, DSET_SET_LOCAL_NAME_2)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataset\n",__LINE__);
goto error;
@@ -5353,7 +5353,7 @@ test_set_local(hid_t fapl)
} /* end if */
/* Read data */
- if (H5Dread(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_dbl)<0) {
+ if (H5Dread(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_dbl) < 0) {
H5_FAILED();
printf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
@@ -5377,14 +5377,14 @@ test_set_local(hid_t fapl)
} /* end for */
/* Close dataset */
- if(H5Dclose(dsid)<0) {
+ if(H5Dclose(dsid) < 0) {
H5_FAILED();
printf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close file */
- if (H5Fclose(file)<0) {
+ if (H5Fclose(file) < 0) {
H5_FAILED();
printf(" Line %d: Can't close file\n",__LINE__);
goto error;
@@ -5427,45 +5427,45 @@ test_compare_dcpl(hid_t file)
TESTING("comparing dataset creation property lists");
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR
+ if ((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
/* Create dcpl with special filter */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR
- if(H5Pset_chunk(dcpl, 2, chunk_dims)<0) TEST_ERROR
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR
/* Set gzip parameter (if available) */
#ifdef H5_HAVE_FILTER_DEFLATE
- if(H5Pset_deflate (dcpl, 9)<0) TEST_ERROR
+ if(H5Pset_deflate (dcpl, 9) < 0) TEST_ERROR
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Create first dataset */
if ((dsid = H5Dcreate(file, DSET_COMPARE_DCPL_NAME, H5T_NATIVE_INT, sid, dcpl)) <0) TEST_ERROR
/* Get copy of dataset's dataset creation property list */
- if ((dcpl1=H5Dget_create_plist(dsid))<0) TEST_ERROR
+ if ((dcpl1=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
/* Close dataset */
- if(H5Dclose (dsid)<0) TEST_ERROR
+ if(H5Dclose (dsid) < 0) TEST_ERROR
/* Create second dataset */
if ((dsid = H5Dcreate(file, DSET_COMPARE_DCPL_NAME_2, H5T_NATIVE_INT, sid, dcpl)) <0) TEST_ERROR
/* Get copy of dataset's dataset creation property list */
- if ((dcpl2=H5Dget_create_plist(dsid))<0) TEST_ERROR
+ if ((dcpl2=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
/* Close dataset */
- if(H5Dclose (dsid)<0) TEST_ERROR
+ if(H5Dclose (dsid) < 0) TEST_ERROR
/* Close dataspace */
- if(H5Sclose(sid)<0) TEST_ERROR
+ if(H5Sclose(sid) < 0) TEST_ERROR
/* Compare dataset creation property lists */
if(H5Pequal(dcpl1,dcpl2)<=0) TEST_ERROR
/* Close dataset creation property lists */
- if(H5Pclose(dcpl)<0) TEST_ERROR
- if(H5Pclose(dcpl1)<0) TEST_ERROR
- if(H5Pclose(dcpl2)<0) TEST_ERROR
+ if(H5Pclose(dcpl) < 0) TEST_ERROR
+ if(H5Pclose(dcpl1) < 0) TEST_ERROR
+ if(H5Pclose(dcpl2) < 0) TEST_ERROR
PASSED();
@@ -5517,31 +5517,31 @@ test_filter_delete(hid_t file)
#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
/* create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL))<0) goto error;
+ if ((sid = H5Screate_simple(2, dims, NULL)) < 0) goto error;
/* create dcpl */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if(H5Pset_chunk(dcpl, 2, chunk_dims)<0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) goto error;
- if (H5Pset_fletcher32 (dcpl)<0) goto error;
- if (H5Pset_deflate (dcpl, 6)<0) goto error;
- if (H5Pset_shuffle (dcpl)<0) goto error;
+ if (H5Pset_fletcher32 (dcpl) < 0) goto error;
+ if (H5Pset_deflate (dcpl, 6) < 0) goto error;
+ if (H5Pset_shuffle (dcpl) < 0) goto error;
/* create a dataset */
if ((dsid = H5Dcreate(file,"dsetdel", H5T_NATIVE_INT, sid, dcpl)) <0) goto error;
/* get copy of dataset's dataset creation property list */
- if ((dcpl1=H5Dget_create_plist(dsid))<0) goto error;
+ if ((dcpl1=H5Dget_create_plist(dsid)) < 0) goto error;
/*----------------------------------------------------------------------
* delete the deflate filter
*----------------------------------------------------------------------
*/
/* delete the deflate filter */
- if (H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE)<0) goto error;
+ if (H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE) < 0) goto error;
/* get information about filters */
- if ((nfilters = H5Pget_nfilters(dcpl1))<0) goto error;
+ if ((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
/* check if filter was deleted */
for (i=0; i<nfilters; i++) {
@@ -5569,10 +5569,10 @@ test_filter_delete(hid_t file)
*----------------------------------------------------------------------
*/
/* delete all filters */
- if (H5Premove_filter(dcpl1,H5Z_FILTER_ALL)<0) goto error;
+ if (H5Premove_filter(dcpl1,H5Z_FILTER_ALL) < 0) goto error;
/* get information about filters */
- if ((nfilters = H5Pget_nfilters(dcpl1))<0) goto error;
+ if ((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
/* check if filters were deleted */
if (nfilters)goto error;
@@ -5583,10 +5583,10 @@ test_filter_delete(hid_t file)
*/
/* clean up objects used for this test */
- if (H5Pclose (dcpl)<0) goto error;
- if (H5Pclose (dcpl1)<0) goto error;
- if (H5Dclose (dsid)<0) goto error;
- if (H5Sclose (sid)<0) goto error;
+ if (H5Pclose (dcpl) < 0) goto error;
+ if (H5Pclose (dcpl1) < 0) goto error;
+ if (H5Dclose (dsid) < 0) goto error;
+ if (H5Sclose (sid) < 0) goto error;
PASSED();
#else
@@ -5636,23 +5636,23 @@ auxread_fdata(hid_t fid, const char *name)
hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */
int i;
- if ((dset_id=H5Dopen(fid,name))<0)
+ if ((dset_id=H5Dopen(fid,name)) < 0)
goto error;
- if ((space_id=H5Dget_space(dset_id))<0)
+ if ((space_id=H5Dget_space(dset_id)) < 0)
goto error;
- if ((ftype_id=H5Dget_type (dset_id))<0)
+ if ((ftype_id=H5Dget_type (dset_id)) < 0)
goto error;
- if ((dcpl_id=H5Dget_create_plist(dset_id))<0)
+ if ((dcpl_id=H5Dget_create_plist(dset_id)) < 0)
goto error;
- if ( (rank=H5Sget_simple_extent_ndims(space_id))<0)
+ if ( (rank=H5Sget_simple_extent_ndims(space_id)) < 0)
goto error;
HDmemset(dims, 0, sizeof dims);
- if ( H5Sget_simple_extent_dims(space_id,dims,NULL)<0)
+ if ( H5Sget_simple_extent_dims(space_id,dims,NULL) < 0)
goto error;
nelmts=1;
for (i=0; i<rank; i++)
nelmts*=dims[i];
- if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0)
+ if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT)) < 0)
goto error;
if ((msize=H5Tget_size(mtype_id))==0)
goto error;
@@ -5664,15 +5664,15 @@ auxread_fdata(hid_t fid, const char *name)
printf( "cannot read into memory\n" );
goto error;
}
- if (H5Dread(dset_id,mtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if (H5Dread(dset_id,mtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto error;
}
- if (H5Pclose(dcpl_id)<0)
+ if (H5Pclose(dcpl_id) < 0)
goto error;
- if (H5Sclose(space_id)<0)
+ if (H5Sclose(space_id) < 0)
goto error;
- if (H5Dclose(dset_id)<0)
+ if (H5Dclose(dset_id) < 0)
goto error;
if (buf)
free(buf);
@@ -5736,25 +5736,25 @@ test_filters_endianess(hid_t fapl)
if((fid = H5Fcreate("test_filters.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error;
/* create a data space */
- if ((sid = H5Screate_simple(rank,dims,NULL))<0) goto error;
+ if ((sid = H5Screate_simple(rank,dims,NULL)) < 0) goto error;
/* create dcpl */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if(H5Pset_chunk(dcpl,rank,chunk_dims)<0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if(H5Pset_chunk(dcpl,rank,chunk_dims) < 0) goto error;
- if (H5Pset_fletcher32 (dcpl)<0) goto error;
+ if (H5Pset_fletcher32 (dcpl) < 0) goto error;
/* create a dataset */
if ((dsid = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,dcpl)) <0) goto error;
- if(H5Dwrite(dsid,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if(H5Dwrite(dsid,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto error;
/* close */
- if (H5Pclose (dcpl)<0) goto error;
- if (H5Dclose (dsid)<0) goto error;
- if (H5Sclose (sid)<0) goto error;
- if (H5Fclose (fid)<0) goto error;
+ if (H5Pclose (dcpl) < 0) goto error;
+ if (H5Dclose (dsid) < 0) goto error;
+ if (H5Sclose (sid) < 0) goto error;
+ if (H5Fclose (fid) < 0) goto error;
/*-------------------------------------------------------------------------
* step 2: open a file written on a little-endian machine in step 1
@@ -5773,10 +5773,10 @@ test_filters_endianess(hid_t fapl)
if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error;
/* read */
- if (auxread_fdata(fid,"dset")<0) goto error;
+ if (auxread_fdata(fid,"dset") < 0) goto error;
/* close */
- if (H5Fclose(fid)<0) goto error;
+ if (H5Fclose(fid) < 0) goto error;
/*-------------------------------------------------------------------------
* step 3: open a file written on a big-endian machine in step 1
@@ -5795,10 +5795,10 @@ test_filters_endianess(hid_t fapl)
if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error;
/* read */
- if (auxread_fdata(fid,"dset")<0) goto error;
+ if (auxread_fdata(fid,"dset") < 0) goto error;
/* close */
- if (H5Fclose(fid)<0) goto error;
+ if (H5Fclose(fid) < 0) goto error;
PASSED();
#else
@@ -5840,16 +5840,16 @@ test_zero_dims(hid_t file)
TESTING("I/O on datasets with zero-sized dims");
- if((s = H5Screate_simple(1, &dsize, &dmax))<0) TEST_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR;
- if(H5Pset_chunk(dcpl, 1, &csize)<0) TEST_ERROR;
- if((d = H5Dcreate(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, dcpl))<0) TEST_ERROR;
+ if((s = H5Screate_simple(1, &dsize, &dmax)) < 0) TEST_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+ if(H5Pset_chunk(dcpl, 1, &csize) < 0) TEST_ERROR;
+ if((d = H5Dcreate(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
- if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911)<0) TEST_ERROR;
+ if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911) < 0) TEST_ERROR;
- if(H5Pclose(dcpl)<0) TEST_ERROR;
- if(H5Sclose(s)<0) TEST_ERROR;
- if(H5Dclose(d)<0) TEST_ERROR;
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Sclose(s) < 0) TEST_ERROR;
+ if(H5Dclose(d) < 0) TEST_ERROR;
PASSED();
return 0;
@@ -5903,19 +5903,19 @@ test_missing_chunk(hid_t file)
} /* end for */
/* Create dataspace */
- if((s = H5Screate_simple(1, &dsize, &dmax))<0) TEST_ERROR;
+ if((s = H5Screate_simple(1, &dsize, &dmax)) < 0) TEST_ERROR;
/* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
/* Set to chunked */
- if(H5Pset_chunk(dcpl, 1, &csize)<0) TEST_ERROR;
+ if(H5Pset_chunk(dcpl, 1, &csize) < 0) TEST_ERROR;
/* Undefine fill value */
- if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, NULL)<0) TEST_ERROR;
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, NULL) < 0) TEST_ERROR;
/* Create dataset */
- if((d = H5Dcreate(file, MISSING_CHUNK_DATASET, H5T_NATIVE_INT, s, dcpl))<0) TEST_ERROR;
+ if((d = H5Dcreate(file, MISSING_CHUNK_DATASET, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
/* Select elements in every other chunk */
hs_start[0]=0;
@@ -5923,13 +5923,13 @@ test_missing_chunk(hid_t file)
hs_count[0]=10;
hs_block[0]=5;
if (H5Sselect_hyperslab(s, H5S_SELECT_SET, hs_start, hs_stride, hs_count,
- hs_block)<0) TEST_ERROR;
+ hs_block) < 0) TEST_ERROR;
/* Write selected data */
- if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, wdata)<0) TEST_ERROR;
+ if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, wdata) < 0) TEST_ERROR;
/* Read all data */
- if(H5Dread(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata)<0) TEST_ERROR;
+ if(H5Dread(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0) TEST_ERROR;
/* Validata values read */
for(u=0; u<MISSING_CHUNK_DIM; u++) {
@@ -5948,9 +5948,9 @@ test_missing_chunk(hid_t file)
} /* end for */
/* Close everything */
- if(H5Pclose(dcpl)<0) TEST_ERROR;
- if(H5Sclose(s)<0) TEST_ERROR;
- if(H5Dclose(d)<0) TEST_ERROR;
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Sclose(s) < 0) TEST_ERROR;
+ if(H5Dclose(d) < 0) TEST_ERROR;
PASSED();
return 0;
@@ -6003,22 +6003,22 @@ test_random_chunks(void)
assert(NPOINTS < 100);
/* Create file for first test */
- if ((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) TEST_ERROR;
+ if ((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create dataspace */
- if((s = H5Screate_simple(2, dsize, NULL))<0) TEST_ERROR;
+ if((s = H5Screate_simple(2, dsize, NULL)) < 0) TEST_ERROR;
/* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
/* Set chunked layout */
- if(H5Pset_chunk(dcpl, 2, csize)<0) TEST_ERROR;
+ if(H5Pset_chunk(dcpl, 2, csize) < 0) TEST_ERROR;
/* Set early allocation time */
- if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY)<0) TEST_ERROR;
+ if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR;
/* Create dataset */
- if((d = H5Dcreate(file, dname, H5T_NATIVE_INT, s, dcpl))<0) TEST_ERROR;
+ if((d = H5Dcreate(file, dname, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
/* Initialization of check array for repeated coordinates */
for (i=0; i<dsize[0]/csize[0]; i++)
@@ -6038,38 +6038,38 @@ test_random_chunks(void)
}
/* Create dataspace for write buffer */
- if ((m = H5Screate_simple(1, msize, NULL))<0) TEST_ERROR;
+ if ((m = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
/* Select the random points for writing */
- if (H5Sselect_elements (s, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord)<0) TEST_ERROR;
+ if (H5Sselect_elements (s, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord) < 0) TEST_ERROR;
/* Write into dataset */
- if (H5Dwrite(d, H5T_NATIVE_INT, m, s, H5P_DEFAULT, wbuf)<0) TEST_ERROR;
+ if (H5Dwrite(d, H5T_NATIVE_INT, m, s, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
/* Close resources*/
- if (H5Sclose(s)<0) TEST_ERROR;
- if (H5Sclose(m)<0) TEST_ERROR;
- if (H5Pclose(dcpl)<0) TEST_ERROR;
- if (H5Dclose(d)<0) TEST_ERROR;
- if (H5Fclose(file)<0) TEST_ERROR;
+ if (H5Sclose(s) < 0) TEST_ERROR;
+ if (H5Sclose(m) < 0) TEST_ERROR;
+ if (H5Pclose(dcpl) < 0) TEST_ERROR;
+ if (H5Dclose(d) < 0) TEST_ERROR;
+ if (H5Fclose(file) < 0) TEST_ERROR;
/* Open file again */
- if ((file = H5Fopen(RC_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT))<0) TEST_ERROR;
+ if ((file = H5Fopen(RC_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Open dataset */
- if ((d = H5Dopen(file, dname))<0) TEST_ERROR;
+ if ((d = H5Dopen(file, dname)) < 0) TEST_ERROR;
/* Get dataset dataspace */
- if ((s = H5Dget_space(d))<0) TEST_ERROR;
+ if ((s = H5Dget_space(d)) < 0) TEST_ERROR;
/* Create dataspace for read buffer */
- if ((m = H5Screate_simple(1, msize, NULL))<0) TEST_ERROR;
+ if ((m = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
/* Select the random points for reading */
- if (H5Sselect_elements (s, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord)<0) TEST_ERROR;
+ if (H5Sselect_elements (s, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord) < 0) TEST_ERROR;
/* Read from dataset */
- if (H5Dread(d, H5T_NATIVE_INT, m, s, H5P_DEFAULT, rbuf)<0) TEST_ERROR;
+ if (H5Dread(d, H5T_NATIVE_INT, m, s, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
/* Verify that written and read data are the same */
for (i=0; i<NPOINTS; i++)
@@ -6079,89 +6079,89 @@ test_random_chunks(void)
} /* end if */
/* Close resources */
- if (H5Sclose(s)<0) TEST_ERROR;
- if (H5Sclose(m)<0) TEST_ERROR;
- if (H5Dclose(d)<0) TEST_ERROR;
- if (H5Fclose(file)<0) TEST_ERROR;
+ if (H5Sclose(s) < 0) TEST_ERROR;
+ if (H5Sclose(m) < 0) TEST_ERROR;
+ if (H5Dclose(d) < 0) TEST_ERROR;
+ if (H5Fclose(file) < 0) TEST_ERROR;
/* Remove file */
HDremove(RC_FILENAME);
/* Create file for second test */
- if ((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) TEST_ERROR;
+ if((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create dataspace with unlimited maximum dimensions */
- if((s = H5Screate_simple(2, dsize, dmax))<0) TEST_ERROR;
+ if((s = H5Screate_simple(2, dsize, dmax)) < 0) TEST_ERROR;
/* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
/* Set chunked layout */
- if(H5Pset_chunk(dcpl, 2, csize)<0) TEST_ERROR;
+ if(H5Pset_chunk(dcpl, 2, csize) < 0) TEST_ERROR;
/* Set allocation time to early */
- if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY)<0) TEST_ERROR;
+ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR;
/* Create dataset */
- if((d = H5Dcreate(file, dname, H5T_NATIVE_INT, s, dcpl))<0) TEST_ERROR;
+ if((d = H5Dcreate(file, dname, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
/* Extend both dimensions of the dataset */
- if (H5Dextend(d, nsize)<0) TEST_ERROR;
+ if(H5Dset_extent(d, nsize) < 0) TEST_ERROR;
/* Reset the dataset dataspace to new dimensions */
- if (H5Sset_extent_simple(s, 2, nsize, dmax)<0) TEST_ERROR;
+ if(H5Sset_extent_simple(s, 2, nsize, dmax) < 0) TEST_ERROR;
/* Initialize check buffer for repeated coordinates */
- for (i=0; i<nsize[0]/csize[0]; i++)
- for (j=0; j<nsize[1]/csize[1]; j++)
+ for(i = 0; i < nsize[0]/csize[0]; i++)
+ for(j = 0; j < nsize[1] / csize[1]; j++)
check[i][j] = 0;
/* Generate random point coordinates. Only one point is selected per chunk */
- for (i=0; i<NPOINTS; i++){
+ for(i = 0; i < NPOINTS; i++){
do {
- chunk_row = (int)HDrandom () % (nsize[0]/csize[0]);
- chunk_col = (int)HDrandom () % (nsize[1]/csize[1]);
+ chunk_row = (int)HDrandom() % (nsize[0] / csize[0]);
+ chunk_col = (int)HDrandom() % (nsize[1] / csize[1]);
} while (check[chunk_row][chunk_col]);
- wbuf[i] = check[chunk_row][chunk_col] = chunk_row+chunk_col+1;
+ wbuf[i] = check[chunk_row][chunk_col] = chunk_row + chunk_col + 1;
coord[i][0] = chunk_row * csize[0];
coord[i][1] = chunk_col * csize[1];
}
/* Create dataspace for write buffer */
- if ((m = H5Screate_simple(1, msize, NULL))<0) TEST_ERROR;
+ if ((m = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
/* Select the random points for writing */
- if (H5Sselect_elements (s, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord)<0) TEST_ERROR;
+ if (H5Sselect_elements (s, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord) < 0) TEST_ERROR;
/* Write into dataset */
- if (H5Dwrite(d, H5T_NATIVE_INT, m, s, H5P_DEFAULT, wbuf)<0) TEST_ERROR;
+ if (H5Dwrite(d, H5T_NATIVE_INT, m, s, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
/* Close resources */
- if (H5Sclose(s)<0) TEST_ERROR;
- if (H5Sclose(m)<0) TEST_ERROR;
- if (H5Pclose(dcpl)<0) TEST_ERROR;
- if (H5Dclose(d)<0) TEST_ERROR;
- if (H5Fclose(file)<0) TEST_ERROR;
+ if (H5Sclose(s) < 0) TEST_ERROR;
+ if (H5Sclose(m) < 0) TEST_ERROR;
+ if (H5Pclose(dcpl) < 0) TEST_ERROR;
+ if (H5Dclose(d) < 0) TEST_ERROR;
+ if (H5Fclose(file) < 0) TEST_ERROR;
/* Open file again */
- if ((file = H5Fopen(RC_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT))<0) TEST_ERROR;
+ if ((file = H5Fopen(RC_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Open dataset */
- if ((d = H5Dopen(file, dname))<0) TEST_ERROR;
+ if ((d = H5Dopen(file, dname)) < 0) TEST_ERROR;
/* Get dataset dataspace */
- if ((s = H5Dget_space(d))<0) TEST_ERROR;
+ if ((s = H5Dget_space(d)) < 0) TEST_ERROR;
/* Create dataspace for read buffer */
- if ((m = H5Screate_simple(1, msize, NULL))<0) TEST_ERROR;
+ if ((m = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
/* Select the random points for reading */
- if (H5Sselect_elements (s, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord)<0) TEST_ERROR;
+ if (H5Sselect_elements (s, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord) < 0) TEST_ERROR;
/* Read from dataset */
- if (H5Dread(d, H5T_NATIVE_INT, m, s, H5P_DEFAULT, rbuf)<0) TEST_ERROR;
+ if (H5Dread(d, H5T_NATIVE_INT, m, s, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
/* Verify that written and read data are the same */
for (i=0; i<NPOINTS; i++)
@@ -6171,10 +6171,10 @@ test_random_chunks(void)
} /* end if */
/* Close resources */
- if (H5Sclose(s)<0) TEST_ERROR;
- if (H5Sclose(m)<0) TEST_ERROR;
- if (H5Dclose(d)<0) TEST_ERROR;
- if (H5Fclose(file)<0) TEST_ERROR;
+ if (H5Sclose(s) < 0) TEST_ERROR;
+ if (H5Sclose(m) < 0) TEST_ERROR;
+ if (H5Dclose(d) < 0) TEST_ERROR;
+ if (H5Fclose(file) < 0) TEST_ERROR;
/* Remove file */
HDremove(RC_FILENAME);
diff --git a/test/extend.c b/test/extend.c
index 5433b44..64037fa 100644
--- a/test/extend.c
+++ b/test/extend.c
@@ -31,7 +31,7 @@ const char *FILENAME[] = {
#define NY 100 /* USE AN EVEN NUMBER!*/
/* Data buffers */
-static int buf1[NY][NX], buf2[NX/2][NY/2];
+static int buf1[NY][NX], buf2[NX / 2][NY / 2];
/*-------------------------------------------------------------------------
@@ -45,8 +45,6 @@ static int buf1[NY][NX], buf2[NX/2][NY/2];
* Programmer: Quincey Koziol
* Tuesday, June 10, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -54,80 +52,172 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me
{
hid_t dataset, file_space, half_space;
static const hsize_t dims[2] = {NX, NY};
- static const hsize_t half_dims[2] = {NX/2, NY/2};
+ static const hsize_t half_dims[2] = {NX / 2, NY / 2};
+ hsize_t size[2];
+ hsize_t max_size[2] = {0, 0};
+ hsize_t offset[2];
+ int i, j, k, m;
+
+ TESTING(msg);
+
+ /* Create the dataset */
+ if((dataset = H5Dcreate(file, name, H5T_NATIVE_INT, mem_space, cparms)) < 0) TEST_ERROR;
+
+ /* Write the data */
+ for(i = 0; i < 5; i++)
+ for(j = 0; j < 5; j++) {
+
+ /* Extend the dataset */
+ offset[0] = i * NX;
+ offset[1] = j * NY;
+ size[0] = offset[0] + NX;
+ size[1] = offset[1] + NY;
+ if(size[0] > max_size[0] || size[1] > max_size[1]) {
+ if(size[0] > max_size[0])
+ max_size[0] = size[0];
+ if(size[1] > max_size[1])
+ max_size[1] = size[1];
+ if(H5Dset_extent(dataset, max_size) < 0) TEST_ERROR;
+ } /* end if */
+
+ /* Select a hyperslab */
+ if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR;
+ if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR;
+
+ /* Write to the hyperslab */
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1) < 0) TEST_ERROR;
+ if(H5Sclose(file_space) < 0) TEST_ERROR;
+ } /* end for */
+
+ /* Read the data */
+ if((half_space = H5Screate_simple(2, half_dims, NULL)) < 0) TEST_ERROR;
+ if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR;
+ for(i = 0; i < 10; i++) {
+ for(j = 0; j < 10; j++) {
+
+ /* Select a hyperslab */
+ offset[0] = i * (NX / 2);
+ offset[1] = j * (NY / 2);
+ if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR;
+
+ /* Read */
+ if(H5Dread(dataset, H5T_NATIVE_INT, half_space, file_space, H5P_DEFAULT, buf2) < 0) TEST_ERROR;
+
+ /* Compare */
+ for(k = 0; k < (NX / 2); k++)
+ for(m = 0; m < (NY / 2); m++)
+ if(buf2[k][m] != buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]) {
+ printf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m);
+ printf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]);
+ printf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]);
+ TEST_ERROR;
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+
+ /* Cleanup */
+ if(H5Dclose(dataset) < 0) TEST_ERROR;
+ if(H5Sclose(file_space) < 0) TEST_ERROR;
+ if(H5Sclose(half_space) < 0) TEST_ERROR;
+
+ PASSED();
+ return 0;
+
+error:
+ return -1;
+} /* end write_data() */
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+/*-------------------------------------------------------------------------
+ * Function: write_data_deprec
+ *
+ * Purpose: Create extendible dataset and test extend/write/read, with
+ * deprecated API routine (H5Dextend)
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Quincey Koziol
+ * Monday, October 8, 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t mem_space)
+{
+ hid_t dataset, file_space, half_space;
+ static const hsize_t dims[2] = {NX, NY};
+ static const hsize_t half_dims[2] = {NX / 2, NY / 2};
static hsize_t size[2];
hsize_t offset[2];
int i, j, k, m;
TESTING(msg);
- if ((dataset = H5Dcreate (file, name, H5T_NATIVE_INT, mem_space,
- cparms))<0) TEST_ERROR;
+ /* Create the dataset */
+ if((dataset = H5Dcreate(file, name, H5T_NATIVE_INT, mem_space, cparms)) < 0) TEST_ERROR;
+
/* Write the data */
- for (i=0; i<5; i++) {
- for (j=0; j<5; j++) {
+ for(i = 0; i < 5; i++)
+ for(j = 0; j < 5; j++) {
/* Extend the dataset */
offset[0] = i * NX;
offset[1] = j * NY;
size[0] = offset[0] + NX;
size[1] = offset[1] + NY;
- if (H5Dextend (dataset, size)<0) TEST_ERROR;
+ if(H5Dextend(dataset, size) < 0) TEST_ERROR;
/* Select a hyperslab */
- if ((file_space = H5Dget_space (dataset))<0) TEST_ERROR;
- if (H5Sselect_hyperslab (file_space, H5S_SELECT_SET, offset,
- NULL, dims, NULL)<0) TEST_ERROR;
+ if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR;
+ if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR;
/* Write to the hyperslab */
- if (H5Dwrite (dataset, H5T_NATIVE_INT, mem_space, file_space,
- H5P_DEFAULT, buf1)<0) TEST_ERROR;
- if (H5Sclose (file_space)<0) TEST_ERROR;
- }
- }
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1) < 0) TEST_ERROR;
+ if(H5Sclose(file_space) < 0) TEST_ERROR;
+ } /* end for */
/* Read the data */
- if ((half_space = H5Screate_simple (2, half_dims, NULL))<0) TEST_ERROR;
- if ((file_space = H5Dget_space (dataset))<0) TEST_ERROR;
- for (i=0; i<10; i++) {
- for (j=0; j<10; j++) {
+ if((half_space = H5Screate_simple(2, half_dims, NULL)) < 0) TEST_ERROR;
+ if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR;
+ for(i = 0; i < 10; i++) {
+ for(j = 0; j < 10; j++) {
/* Select a hyperslab */
- offset[0] = i * NX/2;
- offset[1] = j * NY/2;
- if (H5Sselect_hyperslab (file_space, H5S_SELECT_SET, offset,
- NULL, half_dims, NULL)<0) TEST_ERROR;
+ offset[0] = i * (NX / 2);
+ offset[1] = j * (NY / 2);
+ if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR;
/* Read */
- if (H5Dread (dataset, H5T_NATIVE_INT, half_space, file_space,
- H5P_DEFAULT, buf2)<0) TEST_ERROR;
+ if(H5Dread(dataset, H5T_NATIVE_INT, half_space, file_space, H5P_DEFAULT, buf2) < 0) TEST_ERROR;
/* Compare */
- for (k=0; k<NX/2; k++) {
- for (m=0; m<NY/2; m++) {
- if (buf2[k][m]!=buf1[(i%2)*NX/2+k][(j%2)*NY/2+m]) {
+ for(k = 0; k < (NX / 2); k++)
+ for(m = 0; m < (NY / 2); m++)
+ if(buf2[k][m] != buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]) {
printf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m);
- printf(" buf2[%d][%d]=%d\n",k,m,buf2[k][m]);
- printf(" buf1[%d][%d]=%d\n",(i%2)*NX/2+k,(j%2)*NY/2+m,buf1[(i%2)*NX/2+k][(j%2)*NY/2+m]);
+ printf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]);
+ printf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]);
TEST_ERROR;
- }
- }
- }
- }
- }
+ } /* end if */
+ } /* end for */
+ } /* end for */
/* Cleanup */
- if (H5Dclose (dataset)<0) TEST_ERROR;
- if (H5Sclose (file_space)<0) TEST_ERROR;
- if (H5Sclose (half_space)<0) TEST_ERROR;
+ if(H5Dclose(dataset) < 0) TEST_ERROR;
+ if(H5Sclose(file_space) < 0) TEST_ERROR;
+ if(H5Sclose(half_space) < 0) TEST_ERROR;
PASSED();
return 0;
error:
return -1;
-}
+} /* end write_data_deprec() */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/*-------------------------------------------------------------------------
@@ -164,51 +254,59 @@ main (void)
const char *envval = NULL;
envval = HDgetenv("HDF5_DRIVER");
- if (envval == NULL)
+ if(envval == NULL)
envval = "nomatch";
- if (HDstrcmp(envval, "split")) {
+ if(HDstrcmp(envval, "split")) {
h5_reset();
fapl = h5_fileaccess();
/* Initialize buffer and space */
- for (i=0; i<NX; i++) {
- for (j=0; j<NY; j++) {
- buf1[i][j] = i*NY+j;
- }
- }
- if ((mem_space = H5Screate_simple (2, dims, maxdims))<0) TEST_ERROR;
+ for(i = 0; i < NX; i++)
+ for(j = 0; j < NY; j++)
+ buf1[i][j] = i * NY + j;
+
+ if((mem_space = H5Screate_simple(2, dims, maxdims)) < 0) TEST_ERROR;
/* Create the file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR;
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+ if(H5Pset_chunk(cparms, 2, chunk_dims) < 0) TEST_ERROR;
- /* Create the dataset which is originally NX by NY */
- if((cparms = H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR;
- if (H5Pset_chunk (cparms, 2, chunk_dims)<0) TEST_ERROR;
- nerrors += write_data("extendible dataset with incremental allocation",file,"dataset1",cparms,mem_space)<0 ?1:0;
- if(H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY)<0) TEST_ERROR;
- nerrors += write_data("extendible dataset with early allocation",file,"dataset2",cparms,mem_space)<0 ?1:0;
+ /* Test with incremental allocation */
+ nerrors += write_data("extendible dataset with incr. allocation", file, "dataset1a", cparms, mem_space) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += write_data_deprec("extendible dataset with incr. allocation w/deprec. symbols", file, "dataset1b", cparms, mem_space) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
- if (H5Pclose (cparms)<0) TEST_ERROR;
- if (H5Sclose (mem_space)<0) TEST_ERROR;
+ /* Test with early allocation */
+ if(H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR;
+ nerrors += write_data("extendible dataset with early allocation", file, "dataset2a", cparms, mem_space) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += write_data_deprec("extendible dataset with early allocation w/deprec. symbols", file, "dataset2b", cparms, mem_space) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
- if (H5Fclose (file)<0) TEST_ERROR;
- if (nerrors) {
- printf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S");
+ if(H5Pclose(cparms) < 0) TEST_ERROR;
+ if(H5Sclose(mem_space) < 0) TEST_ERROR;
+ if(H5Fclose(file) < 0) TEST_ERROR;
+
+ if(nerrors) {
+ printf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S");
exit(1);
- }
+ } /* end if */
+
printf("All extend tests passed.\n");
h5_cleanup(FILENAME, fapl);
- }
+ } /* end if */
else
- {
puts("All extend tests skipped - Incompatible with current Virtual File Driver");
- }
- return 0;
- error:
- printf("*** One or more extend tests failed ***\n");
- return 1;
+ return 0;
+error:
+ printf("*** One or more extend tests failed ***\n");
+ return 1;
}
diff --git a/test/external.c b/test/external.c
index 518527b..0186d53 100644
--- a/test/external.c
+++ b/test/external.c
@@ -107,25 +107,25 @@ test_1a(hid_t file)
TESTING("fixed-size data space, exact storage");
/* Create the dataset */
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = max_size[0] = 100;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)))<0) goto error;
- if ((space = H5Screate_simple (1, cur_size, max_size))<0) goto error;
- if ((dset = H5Dcreate (file, "dset1", H5T_NATIVE_INT, space, dcpl))<0)
+ (hsize_t)(max_size[0]*sizeof(int))) < 0) goto error;
+ if ((space = H5Screate_simple (1, cur_size, max_size)) < 0) goto error;
+ if ((dset = H5Dcreate (file, "dset1", H5T_NATIVE_INT, space, dcpl)) < 0)
goto error;
- if (H5Dclose (dset)<0) goto error;
- if (H5Sclose (space)<0) goto error;
- if (H5Pclose (dcpl)<0) goto error;
+ if (H5Dclose (dset) < 0) goto error;
+ if (H5Sclose (space) < 0) goto error;
+ if (H5Pclose (dcpl) < 0) goto error;
/* Read dataset creation information */
- if ((dset = H5Dopen (file, "dset1"))<0) goto error;
+ if ((dset = H5Dopen (file, "dset1")) < 0) goto error;
/* Test dataset address. Should be undefined. */
if (H5Dget_offset(dset)!=HADDR_UNDEF) goto error;
- if ((dcpl = H5Dget_create_plist (dset))<0) goto error;
- if ((n=H5Pget_external_count (dcpl))<0) goto error;
+ if ((dcpl = H5Dget_create_plist (dset)) < 0) goto error;
+ if ((n=H5Pget_external_count (dcpl)) < 0) goto error;
if (1!=n) {
H5_FAILED();
puts(" Returned external count is wrong.");
@@ -134,7 +134,7 @@ test_1a(hid_t file)
}
strcpy (name+sizeof(name)-4, "...");
if (H5Pget_external (dcpl, 0, sizeof(name)-4, name, &file_offset,
- &file_size)<0) goto error;
+ &file_size) < 0) goto error;
if (file_offset!=0) {
H5_FAILED();
puts(" Wrong file offset.");
@@ -148,8 +148,8 @@ test_1a(hid_t file)
(unsigned long)max_size[0]*sizeof(int));
goto error;
}
- if (H5Pclose (dcpl)<0) goto error;
- if (H5Dclose (dset)<0) goto error;
+ if (H5Pclose (dcpl) < 0) goto error;
+ if (H5Dclose (dset) < 0) goto error;
PASSED();
return 0;
error:
@@ -189,11 +189,11 @@ test_1b(hid_t file)
hsize_t max_size[1]; /*maximum data space size */
TESTING("external storage is too small");
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = max_size[0] = 100;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)-1))<0) goto error;
- if ((space = H5Screate_simple (1, cur_size, max_size))<0) goto error;
+ (hsize_t)(max_size[0]*sizeof(int)-1)) < 0) goto error;
+ if ((space = H5Screate_simple (1, cur_size, max_size)) < 0) goto error;
H5E_BEGIN_TRY {
dset = H5Dcreate (file, "dset2", H5T_NATIVE_INT, space, dcpl);
} H5E_END_TRY;
@@ -202,8 +202,8 @@ test_1b(hid_t file)
puts(" Small external file succeeded instead of failing.");
goto error;
}
- if (H5Sclose (space)<0) goto error;
- if (H5Pclose (dcpl)<0) goto error;
+ if (H5Sclose (space) < 0) goto error;
+ if (H5Pclose (dcpl) < 0) goto error;
PASSED();
return 0;
@@ -245,17 +245,17 @@ test_1c(hid_t file)
hsize_t max_size[1]; /*maximum data space size */
TESTING("extendible dataspace, exact external size");
- if((dcpl=H5Pcreate (H5P_DATASET_CREATE))<0) goto error;
+ if((dcpl=H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = 100;
max_size[0] = 200;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)))<0) goto error;
- if ((space = H5Screate_simple (1, cur_size, max_size))<0) goto error;
- if ((dset = H5Dcreate (file, "dset3", H5T_NATIVE_INT, space, dcpl))<0)
+ (hsize_t)(max_size[0]*sizeof(int))) < 0) goto error;
+ if ((space = H5Screate_simple (1, cur_size, max_size)) < 0) goto error;
+ if ((dset = H5Dcreate (file, "dset3", H5T_NATIVE_INT, space, dcpl)) < 0)
goto error;
- if (H5Dclose (dset)<0) goto error;
- if (H5Sclose (space)<0) goto error;
- if (H5Pclose (dcpl)<0) goto error;
+ if (H5Dclose (dset) < 0) goto error;
+ if (H5Sclose (space) < 0) goto error;
+ if (H5Pclose (dcpl) < 0) goto error;
PASSED();
return 0;
@@ -296,12 +296,12 @@ test_1d(hid_t file)
hsize_t max_size[1]; /*maximum data space size */
TESTING("extendible dataspace, external storage is too small");
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = 100;
max_size[0] = 200;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)-1))<0) goto error;
- if ((space=H5Screate_simple(1, cur_size, max_size))<0) goto error;
+ (hsize_t)(max_size[0]*sizeof(int)-1)) < 0) goto error;
+ if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
H5E_BEGIN_TRY {
dset = H5Dcreate (file, "dset4", H5T_NATIVE_INT, space, dcpl);
} H5E_END_TRY;
@@ -310,8 +310,8 @@ test_1d(hid_t file)
puts(" Small external file succeeded instead of failing.");
goto error;
}
- if (H5Sclose (space)<0) goto error;
- if (H5Pclose (dcpl)<0) goto error;
+ if (H5Sclose (space) < 0) goto error;
+ if (H5Pclose (dcpl) < 0) goto error;
PASSED();
return 0;
@@ -359,20 +359,20 @@ test_1e(hid_t file)
/* Create dataset */
if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED)<0) goto error;
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED) < 0) goto error;
cur_size[0] = 100;
max_size[0] = H5S_UNLIMITED;
- if ((space=H5Screate_simple(1, cur_size, max_size))<0) goto error;
- if ((dset=H5Dcreate(file, "dset5", H5T_NATIVE_INT, space, dcpl))<0)
+ if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if ((dset=H5Dcreate(file, "dset5", H5T_NATIVE_INT, space, dcpl)) < 0)
goto error;
- if (H5Dclose (dset)<0) goto error;
- if (H5Sclose (space)<0) goto error;
- if (H5Pclose (dcpl)<0) goto error;
+ if (H5Dclose (dset) < 0) goto error;
+ if (H5Sclose (space) < 0) goto error;
+ if (H5Pclose (dcpl) < 0) goto error;
/* Read dataset creation information */
- if ((dset = H5Dopen (file, "dset5"))<0) goto error;
- if ((dcpl = H5Dget_create_plist (dset))<0) goto error;
- if ((n = H5Pget_external_count (dcpl))<0) goto error;
+ if ((dset = H5Dopen (file, "dset5")) < 0) goto error;
+ if ((dcpl = H5Dget_create_plist (dset)) < 0) goto error;
+ if ((n = H5Pget_external_count (dcpl)) < 0) goto error;
if (1!=n) {
H5_FAILED();
puts(" Returned external count is wrong.");
@@ -381,7 +381,7 @@ test_1e(hid_t file)
}
strcpy (name+sizeof(name)-4, "...");
if (H5Pget_external (dcpl, 0, sizeof(name)-4, name, &file_offset,
- &file_size)<0) goto error;
+ &file_size) < 0) goto error;
if (file_offset!=0) {
H5_FAILED();
puts(" Wrong file offset.");
@@ -394,8 +394,8 @@ test_1e(hid_t file)
printf(" got: %lu\n ans: INF\n", (unsigned long)file_size);
goto error;
}
- if (H5Pclose (dcpl)<0) goto error;
- if (H5Dclose (dset)<0) goto error;
+ if (H5Pclose (dcpl) < 0) goto error;
+ if (H5Dclose (dset) < 0) goto error;
PASSED();
return 0;
@@ -435,22 +435,22 @@ test_1f(hid_t file)
hsize_t max_size[1]; /*data space maximum size */
TESTING("multiple external files");
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = max_size[0] = 100;
if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error;
+ (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error;
if (H5Pset_external(dcpl, "ext2.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error;
+ (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error;
if (H5Pset_external(dcpl, "ext3.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error;
+ (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error;
if (H5Pset_external(dcpl, "ext4.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error;
- if ((space=H5Screate_simple(1, cur_size, max_size))<0) goto error;
- if ((dset=H5Dcreate(file, "dset6", H5T_NATIVE_INT, space, dcpl))<0)
+ (hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error;
+ if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if ((dset=H5Dcreate(file, "dset6", H5T_NATIVE_INT, space, dcpl)) < 0)
goto error;
- if (H5Dclose(dset)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Pclose(dcpl)<0) goto error;
+ if (H5Dclose(dset) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Pclose(dcpl) < 0) goto error;
PASSED();
return 0;
@@ -489,8 +489,8 @@ test_1g(void)
int n; /*number of external files */
TESTING("external file following unlimited file");
- if ((dcpl=H5Pcreate (H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED)<0) goto error;
+ if ((dcpl=H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED) < 0) goto error;
H5E_BEGIN_TRY {
status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100);
} H5E_END_TRY;
@@ -499,13 +499,13 @@ test_1g(void)
puts (" H5Pset_external() succeeded when it should have failed.");
goto error;
}
- if ((n = H5Pget_external_count(dcpl))<0) goto error;
+ if ((n = H5Pget_external_count(dcpl)) < 0) goto error;
if (1!=n) {
H5_FAILED();
puts(" Wrong external file count returned.");
goto error;
}
- if (H5Pclose(dcpl)<0) goto error;
+ if (H5Pclose(dcpl) < 0) goto error;
PASSED();
return 0;
@@ -541,8 +541,8 @@ test_1h(void)
herr_t status; /*return status */
TESTING("address overflow in external files");
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED-1)<0) goto error;
+ if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED-1) < 0) goto error;
H5E_BEGIN_TRY {
status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100);
} H5E_END_TRY;
@@ -551,7 +551,7 @@ test_1h(void)
puts(" H5Pset_external() succeeded when it should have failed.");
goto error;
}
- if (H5Pclose(dcpl)<0) goto error;
+ if (H5Pclose(dcpl) < 0) goto error;
PASSED();
return 0;
@@ -628,7 +628,7 @@ test_2 (hid_t fapl)
if(H5Gclose(grp) < 0) FAIL_STACK_ERROR
/* Create the dataset */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_external(dcpl, "extern_1a.raw", (off_t)0, (hsize_t)sizeof part) < 0 ||
H5Pset_external(dcpl, "extern_2a.raw", (off_t)10, (hsize_t)sizeof part) < 0 ||
H5Pset_external(dcpl, "extern_3a.raw", (off_t)20, (hsize_t)sizeof part) < 0 ||
@@ -654,13 +654,13 @@ test_2 (hid_t fapl)
/*
* Read the middle of the dataset
*/
- if ((hs_space=H5Scopy(space))<0) goto error;
+ if ((hs_space=H5Scopy(space)) < 0) goto error;
if (H5Sselect_hyperslab(hs_space, H5S_SELECT_SET, &hs_start, NULL,
- &hs_count, NULL)<0) goto error;
+ &hs_count, NULL) < 0) goto error;
memset(whole, 0, sizeof(whole));
if (H5Dread (dset, H5T_NATIVE_INT, hs_space, hs_space, H5P_DEFAULT,
- whole)<0) goto error;
- if (H5Sclose (hs_space)<0) goto error;
+ whole) < 0) goto error;
+ if (H5Sclose (hs_space) < 0) goto error;
for (i=hs_start; i<hs_start+hs_count; i++) {
if (whole[i]!=(signed)i) {
H5_FAILED();
@@ -669,10 +669,10 @@ test_2 (hid_t fapl)
}
}
- if (H5Dclose(dset)<0) goto error;
- if (H5Pclose(dcpl)<0) goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Fclose(file)<0) goto error;
+ if (H5Dclose(dset) < 0) goto error;
+ if (H5Pclose(dcpl) < 0) goto error;
+ if (H5Sclose(space) < 0) goto error;
+ if (H5Fclose(file) < 0) goto error;
PASSED();
return 0;
@@ -725,22 +725,22 @@ test_3 (hid_t fapl)
/* Create another file */
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
+ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
goto error;
}
/* Create the external file list */
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_external(dcpl, "extern_1b.raw", (off_t)0, (hsize_t)sizeof part)<0 ||
- H5Pset_external(dcpl, "extern_2b.raw", (off_t)10, (hsize_t)sizeof part)<0 ||
- H5Pset_external(dcpl, "extern_3b.raw", (off_t)20, (hsize_t)sizeof part)<0 ||
- H5Pset_external(dcpl, "extern_4b.raw", (off_t)30, H5F_UNLIMITED)<0)
+ if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if (H5Pset_external(dcpl, "extern_1b.raw", (off_t)0, (hsize_t)sizeof part) < 0 ||
+ H5Pset_external(dcpl, "extern_2b.raw", (off_t)10, (hsize_t)sizeof part) < 0 ||
+ H5Pset_external(dcpl, "extern_3b.raw", (off_t)20, (hsize_t)sizeof part) < 0 ||
+ H5Pset_external(dcpl, "extern_4b.raw", (off_t)30, H5F_UNLIMITED) < 0)
goto error;
/* Make sure the output files are fresh*/
for (i=1; i<=4; i++) {
sprintf(filename, "extern_%db.raw", i);
- if ((fd= open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666))<0) {
+ if ((fd= open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) {
H5_FAILED();
printf(" cannot open %s: %s\n", filename, strerror(errno));
goto error;
@@ -751,44 +751,45 @@ test_3 (hid_t fapl)
}
/* Create the dataset */
- if ((mem_space=H5Screate_simple(1, &cur_size, &max_size))<0) goto error;
- if ((file_space=H5Scopy(mem_space))<0) goto error;
- if ((dset=H5Dcreate(file, "dset1", H5T_NATIVE_INT, file_space, dcpl))<0)
+ if((mem_space = H5Screate_simple(1, &cur_size, &max_size)) < 0) goto error;
+ if((file_space = H5Scopy(mem_space)) < 0) goto error;
+ if((dset = H5Dcreate(file, "dset1", H5T_NATIVE_INT, file_space, dcpl)) < 0)
goto error;
/* Write the entire dataset and compare with the original */
- for (i=0; i<cur_size; i++) whole[i] = i;
- if (H5Dwrite(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT,
- whole)<0) goto error;
- for (i=0; i<4; i++) {
+ for(i = 0; i < cur_size; i++)
+ whole[i] = i;
+ if(H5Dwrite(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, whole) < 0) goto error;
+ for(i = 0; i < 4; i++) {
char name1[64], name2[64];
- sprintf (name1, "extern_%da.raw", i+1);
- sprintf (name2, "extern_%db.raw", i+1);
- if (!same_contents (name1, name2)) {
+
+ sprintf(name1, "extern_%da.raw", i + 1);
+ sprintf(name2, "extern_%db.raw", i + 1);
+ if(!same_contents(name1, name2)) {
H5_FAILED();
puts (" Output differs from expected value.");
goto error;
- }
- }
+ } /* end if */
+ } /* end for */
/* Extend the dataset by another 100 elements */
- if (H5Dextend(dset, &max_size)<0) goto error;
- if (H5Sclose(file_space)<0) goto error;
- if ((file_space=H5Dget_space(dset))<0) goto error;
+ if(H5Dset_extent(dset, &max_size) < 0) goto error;
+ if(H5Sclose(file_space) < 0) goto error;
+ if((file_space = H5Dget_space(dset)) < 0) goto error;
/* Write second half of dataset */
- for (i=0; i<hs_count; i++) whole[i] = 100+i;
- if (H5Sselect_hyperslab(file_space, H5S_SELECT_SET, &hs_start, NULL,
- &hs_count, NULL)<0) goto error;
- if (H5Dwrite(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT,
- whole)<0) goto error;
-
-
- if (H5Dclose (dset)<0) goto error;
- if (H5Pclose (dcpl)<0) goto error;
- if (H5Sclose (mem_space)<0) goto error;
- if (H5Sclose (file_space)<0) goto error;
- if (H5Fclose (file)<0) goto error;
+ for(i = 0; i < hs_count; i++)
+ whole[i] = 100 + i;
+ if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, &hs_start, NULL, &hs_count, NULL) < 0) goto error;
+ if(H5Dwrite(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, whole) < 0) goto error;
+
+
+ if(H5Dclose(dset) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
+ if(H5Sclose(mem_space) < 0) goto error;
+ if(H5Sclose(file_space) < 0) goto error;
+ if(H5Fclose(file) < 0) goto error;
+
PASSED();
return 0;
@@ -854,7 +855,7 @@ main (void)
nerrors += test_3(fapl);
if (nerrors>0) goto error;
- if (H5Fclose(file)<0) goto error;
+ if (H5Fclose(file) < 0) goto error;
puts("All external storage tests passed.");
if (h5_cleanup(FILENAME, fapl)) {
remove("extern_1a.raw");
diff --git a/test/fillval.c b/test/fillval.c
index 6d4597b..53ff8f3 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -1569,7 +1569,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
/* Extend the dataset one element in each dimension */
for(i = 0; i < 5; i++)
extend_size[i] = start_size[i] + 1;
- if(H5Dextend(dset, extend_size) < 0) TEST_ERROR
+ if(H5Dset_extent(dset, extend_size) < 0) TEST_ERROR
/* Re-open file dataspace */
if(H5Sclose(fspace) < 0) TEST_ERROR
@@ -1608,7 +1608,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
/* Extend the dataset to the maximum dimension sizes */
- if(H5Dextend(dset, max_size) < 0) TEST_ERROR
+ if(H5Dset_extent(dset, max_size) < 0) TEST_ERROR
/* Re-open file dataspace */
if(H5Sclose(fspace) < 0) TEST_ERROR
diff --git a/test/objcopy.c b/test/objcopy.c
index 5e620fa..be6d236 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -2335,7 +2335,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
new_dim2d[1] = DIM_SIZE_2 * 2;
/* Extend dataset's dimensions */
- if(H5Dextend(did, new_dim2d) < 0) TEST_ERROR
+ if(H5Dset_extent(did, new_dim2d) < 0) TEST_ERROR
/* close dataspace */
if(H5Sclose(sid) < 0) TEST_ERROR
diff --git a/test/testmeta.c b/test/testmeta.c
index db97b28..74e9aa8 100644
--- a/test/testmeta.c
+++ b/test/testmeta.c
@@ -180,27 +180,24 @@ int main(void)
status = H5Gclose(group_id);
/* Extend attribute arrays */
- for(i=0; i<NEXTARRAYS; i++)
- {
+ for(i = 0; i < NEXTARRAYS; i++) {
/* Open extendable dataset */
sprintf(name, "/ExtArray%06d", i);
dataset_id = H5Dopen(file_id, name);
- if(dataset_id < 0)
- {
+ if(dataset_id < 0) {
fprintf(stderr, "Failed to open ExtArray dataset.\n");
status = H5Fclose(file_id);
return -1;
- }
+ } /* end if */
/* Extend attribute dataset */
dims[0] = (hsize_t)j + 1;
- status = H5Dextend(dataset_id, dims);
- if(status < 0)
- {
+ status = H5Dset_extent(dataset_id, dims);
+ if(status < 0) {
fprintf(stderr, "Failed to extend DataArray dataset.\n");
status = H5Fclose(file_id);
return -1;
- }
+ } /* end if */
/* Select element and write value to attribute dataset */
dims[0] = 1;
diff --git a/test/tmisc.c b/test/tmisc.c
index 1a7da71..959c7a8 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -1967,15 +1967,15 @@ test_misc12(void)
MESSAGE(5, ("Testing VL-type in chunked dataset\n"));
/* This test requirese a relatively "fresh" library environment */
- ret=H5garbage_collect();
+ ret = H5garbage_collect();
CHECK(ret, FAIL, "H5garbage_collect");
/* Create file */
- fid1 = H5Fcreate (MISC12_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid1 = H5Fcreate(MISC12_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fcreate");
/* Create dataspace for datasets */
- sid1 = H5Screate_simple (MISC12_SPACE1_RANK, dims1, maxdims1);
+ sid1 = H5Screate_simple(MISC12_SPACE1_RANK, dims1, maxdims1);
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a datatype to refer to */
@@ -1988,66 +1988,66 @@ test_misc12(void)
cparms = H5Pcreate(H5P_DATASET_CREATE);
CHECK(cparms, FAIL, "H5Pcreate");
- ret = H5Pset_chunk ( cparms, 1, chkdims1);
+ ret = H5Pset_chunk(cparms, 1, chkdims1);
CHECK(ret, FAIL, "H5Pset_chunk");
/* Create a dataset */
- dataset = H5Dcreate (fid1, MISC12_DSET_NAME, tid1, sid1, cparms);
+ dataset = H5Dcreate(fid1, MISC12_DSET_NAME, tid1, sid1, cparms);
CHECK(dataset, FAIL, "H5Dcreate");
/* Write dataset to disk */
- ret = H5Dwrite (dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Extend dataset */
- ret = H5Dextend (dataset, newsize);
- CHECK(ret, FAIL, "H5Dextend");
+ ret = H5Dset_extent(dataset, newsize);
+ CHECK(ret, FAIL, "H5Dset_extent");
- memspace = H5Screate_simple (MISC12_SPACE1_RANK, dimsn, NULL);
+ memspace = H5Screate_simple(MISC12_SPACE1_RANK, dimsn, NULL);
CHECK(memspace, FAIL, "H5Screate_simple");
- space = H5Dget_space (dataset);
+ space = H5Dget_space(dataset);
CHECK(space, FAIL, "H5Dget_space");
- ret = H5Sselect_hyperslab (space, H5S_SELECT_SET, offset, NULL, count, NULL);
+ ret = H5Sselect_hyperslab(space, H5S_SELECT_SET, offset, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Write data to new portion of dataset */
- ret = H5Dwrite (dataset, tid1, memspace, space, H5P_DEFAULT, wdata1);
+ ret = H5Dwrite(dataset, tid1, memspace, space, H5P_DEFAULT, wdata1);
CHECK(ret, FAIL, "H5Dwrite");
/* Read all data back */
- ret= H5Dread (dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ ret= H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
- for(i=0; i<MISC12_SPACE1_DIM1; i++)
- if(HDstrcmp(wdata[i],rdata[i]))
- TestErrPrintf("Error on line %d: wdata[%d]=%s, rdata[%d]=%s\n",__LINE__,i,wdata[i],i,rdata[i]);
- for(; i<(MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE); i++)
- if(HDstrcmp(wdata1[i-MISC12_SPACE1_DIM1],rdata[i]))
- TestErrPrintf("Error on line %d: wdata1[%d]=%s, rdata[%d]=%s\n",__LINE__,i-MISC12_SPACE1_DIM1,wdata1[i-MISC12_SPACE1_DIM1],i,rdata[i]);
+ for(i = 0; i < MISC12_SPACE1_DIM1; i++)
+ if(HDstrcmp(wdata[i], rdata[i]))
+ TestErrPrintf("Error on line %d: wdata[%d]=%s, rdata[%d]=%s\n", __LINE__, i, wdata[i], i, rdata[i]);
+ for(; i < (MISC12_SPACE1_DIM1 + MISC12_APPEND_SIZE); i++)
+ if(HDstrcmp(wdata1[i - MISC12_SPACE1_DIM1], rdata[i]))
+ TestErrPrintf("Error on line %d: wdata1[%d]=%s, rdata[%d]=%s\n", __LINE__, i - MISC12_SPACE1_DIM1, wdata1[i - MISC12_SPACE1_DIM1], i, rdata[i]);
- ret = H5Sselect_all (space);
+ ret = H5Sselect_all(space);
CHECK(ret, FAIL, "H5Sselect_all");
/* Reclaim VL data memory */
- ret = H5Dvlen_reclaim (tid1, space, H5P_DEFAULT, rdata);
+ ret = H5Dvlen_reclaim(tid1, space, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Close Everything */
- ret = H5Dclose (dataset);
+ ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
- ret = H5Tclose (tid1);
+ ret = H5Tclose(tid1);
CHECK(ret, FAIL, "H5Tclose");
- ret = H5Sclose (space);
+ ret = H5Sclose(space);
CHECK(ret, FAIL, "H5Sclose");
- ret = H5Sclose (memspace);
+ ret = H5Sclose(memspace);
CHECK(ret, FAIL, "H5Sclose");
- ret = H5Sclose (sid1);
+ ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
- ret = H5Pclose (cparms);
+ ret = H5Pclose(cparms);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Fclose (fid1);
+ ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc12() */
diff --git a/test/tselect.c b/test/tselect.c
index 1c2c598..45b8c88 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -7309,48 +7309,48 @@ test_select_hyper_chunk_offset(void)
CHECK(did, FAIL, "H5Dcreate");
/* Close the dataspace */
- ret=H5Sclose (sid);
+ ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
/* Close the dataset creation property list */
- ret=H5Pclose (dcpl);
+ ret = H5Pclose(dcpl);
CHECK(ret, FAIL, "H5Pclose");
/* Loop over writing out each chunk */
- for(i=SPACE10_CHUNK_SIZE; i<=SPACE10_DIM1; i+=SPACE10_CHUNK_SIZE) {
+ for(i = SPACE10_CHUNK_SIZE; i <= SPACE10_DIM1; i += SPACE10_CHUNK_SIZE) {
hssize_t offset[1]; /* Offset of selection */
hid_t fsid; /* File dataspace ID */
hsize_t size[1]; /* The size to extend the dataset to */
/* Extend the dataset */
size[0] = i; /* The size to extend the dataset to */
- ret=H5Dextend (did, size);
- CHECK(ret, FAIL, "H5Dextend");
+ ret = H5Dset_extent(did, size);
+ CHECK(ret, FAIL, "H5Dset_extent");
/* Get the (extended) dataspace from the dataset */
- fsid = H5Dget_space (did);
+ fsid = H5Dget_space(did);
CHECK(fsid, FAIL, "H5Dget_space");
/* Select the correct chunk in the dataset */
- ret=H5Sselect_hyperslab (fsid, H5S_SELECT_SET, start, NULL, count, NULL);
+ ret = H5Sselect_hyperslab (fsid, H5S_SELECT_SET, start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Set the selection offset for the file dataspace */
offset[0] = i - SPACE10_CHUNK_SIZE;
- ret=H5Soffset_simple (fsid, offset);
+ ret = H5Soffset_simple(fsid, offset);
CHECK(ret, FAIL, "H5Soffset_simple");
/* Set the selection offset for the memory dataspace */
offset[0] = SPACE10_DIM1-i;
- ret=H5Soffset_simple (msid, offset);
+ ret = H5Soffset_simple(msid, offset);
CHECK(ret, FAIL, "H5Soffset_simple");
/* Write the data to the chunk */
- ret=H5Dwrite (did, H5T_NATIVE_INT, msid, fsid, H5P_DEFAULT, wbuf);
+ ret = H5Dwrite(did, H5T_NATIVE_INT, msid, fsid, H5P_DEFAULT, wbuf);
CHECK(ret, FAIL, "H5Soffset_simple");
/* Close the file dataspace copy */
- ret=H5Sclose (fsid);
+ ret = H5Sclose(fsid);
CHECK(ret, FAIL, "H5Sclose");
}
@@ -7369,28 +7369,28 @@ test_select_hyper_chunk_offset(void)
*/
/* Re-initialize the write buffer */
- for(i=0; i<SPACE10_DIM1; i++)
- wbuf[i]=i*2;
+ for(i = 0; i < SPACE10_DIM1; i++)
+ wbuf[i] = i * 2;
/* Change the selected the region in the memory dataspace */
start[0] = 0;
count[0] = SPACE10_CHUNK_SIZE/3;
- ret=H5Sselect_hyperslab (msid, H5S_SELECT_SET, start, NULL, count, NULL);
+ ret = H5Sselect_hyperslab(msid, H5S_SELECT_SET, start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- start[0] = (2*SPACE10_CHUNK_SIZE)/3;
- ret=H5Sselect_hyperslab (msid, H5S_SELECT_OR, start, NULL, count, NULL);
+ start[0] = (2 * SPACE10_CHUNK_SIZE)/3;
+ ret = H5Sselect_hyperslab(msid, H5S_SELECT_OR, start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Loop over writing out each chunk */
- for(i=SPACE10_CHUNK_SIZE; i<=SPACE10_DIM1; i+=SPACE10_CHUNK_SIZE) {
+ for(i = SPACE10_CHUNK_SIZE; i <= SPACE10_DIM1; i += SPACE10_CHUNK_SIZE) {
hssize_t offset[1]; /* Offset of selection */
hid_t fsid; /* File dataspace ID */
hsize_t size[1]; /* The size to extend the dataset to */
/* Extend the dataset */
size[0] = i; /* The size to extend the dataset to */
- ret=H5Dextend (did, size);
- CHECK(ret, FAIL, "H5Dextend");
+ ret = H5Dset_extent(did, size);
+ CHECK(ret, FAIL, "H5Dset_extent");
/* Get the (extended) dataspace from the dataset */
fsid = H5Dget_space (did);
@@ -7398,33 +7398,33 @@ test_select_hyper_chunk_offset(void)
/* Select the correct region in the dataset */
start[0] = 0;
- ret=H5Sselect_hyperslab (fsid, H5S_SELECT_SET, start, NULL, count, NULL);
+ ret = H5Sselect_hyperslab(fsid, H5S_SELECT_SET, start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
start[0] = (2*SPACE10_CHUNK_SIZE)/3;
- ret=H5Sselect_hyperslab (fsid, H5S_SELECT_OR, start, NULL, count, NULL);
+ ret = H5Sselect_hyperslab(fsid, H5S_SELECT_OR, start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Set the selection offset for the file dataspace */
offset[0] = i - SPACE10_CHUNK_SIZE;
- ret=H5Soffset_simple (fsid, offset);
+ ret = H5Soffset_simple(fsid, offset);
CHECK(ret, FAIL, "H5Soffset_simple");
/* Set the selection offset for the memory dataspace */
offset[0] = SPACE10_DIM1-i;
- ret=H5Soffset_simple (msid, offset);
+ ret = H5Soffset_simple(msid, offset);
CHECK(ret, FAIL, "H5Soffset_simple");
/* Write the data to the chunk */
- ret=H5Dwrite (did, H5T_NATIVE_INT, msid, fsid, H5P_DEFAULT, wbuf);
+ ret = H5Dwrite(did, H5T_NATIVE_INT, msid, fsid, H5P_DEFAULT, wbuf);
CHECK(ret, FAIL, "H5Soffset_simple");
/* Close the file dataspace copy */
- ret=H5Sclose (fsid);
+ ret = H5Sclose(fsid);
CHECK(ret, FAIL, "H5Sclose");
}
/* Read the data back in */
- ret=H5Dread (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
+ ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
CHECK(ret, FAIL, "H5Soffset_simple");
/* Verify the information read in */
diff --git a/test/tsohm.c b/test/tsohm.c
index 894f0bc..350e9b8 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -3267,8 +3267,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
}
/* Extend the first dataset */
- ret = H5Dextend(dset1_id, dims2);
- CHECK_I(ret, "H5Dextend");
+ ret = H5Dset_extent(dset1_id, dims2);
+ CHECK_I(ret, "H5Dset_extent");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
ret = H5Dclose(dset1_id);
@@ -3329,8 +3329,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
CHECK_I(ret, "H5Sclose");
/* Extend the second dataset */
- ret = H5Dextend(dset2_id, dims2);
- CHECK_I(ret, "H5Dextend");
+ ret = H5Dset_extent(dset2_id, dims2);
+ CHECK_I(ret, "H5Dset_extent");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
ret = H5Dclose(dset1_id);
@@ -3391,8 +3391,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
CHECK_I(ret, "H5Sclose");
/* Extend the third dataset */
- ret = H5Dextend(dset3_id, dims2);
- CHECK_I(ret, "H5Dextend");
+ ret = H5Dset_extent(dset3_id, dims2);
+ CHECK_I(ret, "H5Dset_extent");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
ret = H5Dclose(dset1_id);
@@ -3486,8 +3486,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
}
/* Extend the first dataset */
- ret = H5Dextend(dset1_id, dims2);
- CHECK_I(ret, "H5Dextend");
+ ret = H5Dset_extent(dset1_id, dims2);
+ CHECK_I(ret, "H5Dset_extent");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
ret = H5Dclose(dset1_id);
@@ -3524,8 +3524,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
}
/* Extend the second dataset */
- ret = H5Dextend(dset2_id, dims2);
- CHECK_I(ret, "H5Dextend");
+ ret = H5Dset_extent(dset2_id, dims2);
+ CHECK_I(ret, "H5Dset_extent");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
ret = H5Dclose(dset1_id);
@@ -3570,8 +3570,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
}
/* Extend the third dataset */
- ret = H5Dextend(dset3_id, dims2);
- CHECK_I(ret, "H5Dextend");
+ ret = H5Dset_extent(dset3_id, dims2);
+ CHECK_I(ret, "H5Dset_extent");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
ret = H5Dclose(dset1_id);
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 12c523c..ac6e0e5 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -1251,7 +1251,7 @@ test_vltypes_compound_vlstr(void)
/* Create a VL datatype of first layer compound type */
- tid1 = H5Tvlen_create (tid5);
+ tid1 = H5Tvlen_create(tid5);
CHECK(tid1, FAIL, "H5Tvlen_create");
/* Create the base compound type */
@@ -1259,33 +1259,32 @@ test_vltypes_compound_vlstr(void)
CHECK(tid2, FAIL, "H5Tcreate");
/* Insert fields */
- ret=H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1);
+ ret = H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1);
CHECK(ret, FAIL, "H5Tinsert");
/* Modify dataset creation properties, i.e. enable chunking */
- cparms = H5Pcreate (H5P_DATASET_CREATE);
- ret = H5Pset_chunk ( cparms, SPACE1_RANK, chunk_dims);
+ cparms = H5Pcreate(H5P_DATASET_CREATE);
+ ret = H5Pset_chunk(cparms, SPACE1_RANK, chunk_dims);
CHECK(ret, FAIL, "H5Pset_chunk");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,cparms);
+ dataset = H5Dcreate(fid1, "Dataset1", tid2, sid1, cparms);
CHECK(dataset, FAIL, "H5Dcreate");
/* Extend the dataset. This call assures that dataset is 4.*/
- ret = H5Dextend (dataset, size);
- CHECK(ret, FAIL, "H5Dextend");
+ ret = H5Dset_extent(dataset, size);
+ CHECK(ret, FAIL, "H5Dset_extent");
/* Select a hyperslab */
- filespace = H5Dget_space (dataset);
- ret = H5Sselect_hyperslab (filespace, H5S_SELECT_SET, offset, NULL,
- dims1, NULL);
+ filespace = H5Dget_space(dataset);
+ ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dims1, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid2,sid1,filespace,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid2, sid1, filespace, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
- ret=H5Fflush(fid1,H5F_SCOPE_GLOBAL);
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
CHECK(ret, FAIL, "H5Fflush");
/* Close Dataset */
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c
index 5b60c0e..6703687 100644
--- a/testpar/t_chunk_alloc.c
+++ b/testpar/t_chunk_alloc.c
@@ -290,7 +290,7 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
/* only extends the dataset */
case extend_only:
/* Extend dataset*/
- hrc = H5Dextend(*dataset, size);
+ hrc = H5Dset_extent(*dataset, size);
VRFY((hrc >= 0), "");
break;
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 40c7e0c..4f8de21 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -1238,8 +1238,8 @@ extend_writeInd(void)
/* Extend its current dim sizes before writing */
dims[0] = dim0;
dims[1] = dim1;
- ret = H5Dextend (dataset1, dims);
- VRFY((ret >= 0), "H5Dextend succeeded");
+ ret = H5Dset_extent(dataset1, dims);
+ VRFY((ret >= 0), "H5Dset_extent succeeded");
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
@@ -1298,8 +1298,8 @@ extend_writeInd(void)
/* Extend dataset2 and try again. Should succeed. */
dims[0] = dim0;
dims[1] = dim1;
- ret = H5Dextend (dataset2, dims);
- VRFY((ret >= 0), "H5Dextend succeeded");
+ ret = H5Dset_extent(dataset2, dims);
+ VRFY((ret >= 0), "H5Dset_extent succeeded");
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
@@ -1448,9 +1448,9 @@ extend_writeInd2(void)
/* -------------------------
* Extend the dataset & retrieve new dataspace
* -------------------------*/
- ret =H5Dextend(dataset, &new_size);
- VRFY((ret >= 0), "H5Dextend succeeded");
- ret=H5Sclose(fs);
+ ret = H5Dset_extent(dataset, &new_size);
+ VRFY((ret >= 0), "H5Dset_extent succeeded");
+ ret = H5Sclose(fs);
VRFY((ret >= 0), "H5Sclose succeeded");
fs = H5Dget_space(dataset);
VRFY((fs >= 0), "H5Dget_space succeeded");
@@ -1572,11 +1572,11 @@ extend_readInd(void)
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sget_simple_extent_dims(file_dataspace, dims, NULL);
+ ret = H5Sget_simple_extent_dims(file_dataspace, dims, NULL);
VRFY((ret > 0), "H5Sget_simple_extent_dims succeeded");
dims[0]++;
- ret=H5Dextend(dataset1, dims);
- VRFY((ret < 0), "H5Dextend failed as expected");
+ ret = H5Dset_extent(dataset1, dims);
+ VRFY((ret < 0), "H5Dset_extent failed as expected");
/* restore auto error reporting */
H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);
@@ -1812,8 +1812,8 @@ extend_writeAll(void)
/* Extend its current dim sizes before writing */
dims[0] = dim0;
dims[1] = dim1;
- ret = H5Dextend (dataset1, dims);
- VRFY((ret >= 0), "H5Dextend succeeded");
+ ret = H5Dset_extent(dataset1, dims);
+ VRFY((ret >= 0), "H5Dset_extent succeeded");
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
@@ -1895,8 +1895,8 @@ extend_writeAll(void)
/* Extend dataset2 and try again. Should succeed. */
dims[0] = dim0;
dims[1] = dim1;
- ret = H5Dextend (dataset2, dims);
- VRFY((ret >= 0), "H5Dextend succeeded");
+ ret = H5Dset_extent(dataset2, dims);
+ VRFY((ret >= 0), "H5Dset_extent succeeded");
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
@@ -2004,11 +2004,11 @@ extend_readAll(void)
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sget_simple_extent_dims(file_dataspace, dims, NULL);
+ ret = H5Sget_simple_extent_dims(file_dataspace, dims, NULL);
VRFY((ret > 0), "H5Sget_simple_extent_dims succeeded");
dims[0]++;
- ret=H5Dextend(dataset1, dims);
- VRFY((ret < 0), "H5Dextend failed as expected");
+ ret = H5Dset_extent(dataset1, dims);
+ VRFY((ret < 0), "H5Dset_extent failed as expected");
/* restore auto error reporting */
H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);