diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-12-22 21:17:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-22 21:17:05 (GMT) |
commit | 366f2d94a3f5ee20287de8062a2a2c895e9eb856 (patch) | |
tree | 723c29f3a08b73b1e69bd824c392960e4bab3bd9 /HDF5Examples/C/H5D | |
parent | 11e15aeed1b82201ea0805dcef5bfce3ac02b9cb (diff) | |
download | hdf5-366f2d94a3f5ee20287de8062a2a2c895e9eb856.zip hdf5-366f2d94a3f5ee20287de8062a2a2c895e9eb856.tar.gz hdf5-366f2d94a3f5ee20287de8062a2a2c895e9eb856.tar.bz2 |
Add CMake api checks to test the new Examples folder. (#3907)
* Fix missing build-mode value
* Use 110 version file only for the 1.10 library
* Fix H5_LIBVER_DIR variable
* Disable 1.6 API tests for now.
Diffstat (limited to 'HDF5Examples/C/H5D')
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_alloc.c | 13 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_checksum.c | 12 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_chunk.c | 18 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_compact.c | 11 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_extern.c | 11 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_fillval.c | 21 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_gzip.c | 18 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_hyper.c | 16 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_rdwr.c | 10 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_shuffle.c | 18 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_szip.c | 19 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_unlimadd.c | 23 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_unlimgzip.c | 23 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/16/h5ex_d_unlimmod.c | 20 | ||||
-rw-r--r-- | HDF5Examples/C/H5D/CMakeLists.txt | 2 |
15 files changed, 155 insertions, 80 deletions
diff --git a/HDF5Examples/C/H5D/16/h5ex_d_alloc.c b/HDF5Examples/C/H5D/16/h5ex_d_alloc.c index d4ae7b9..78f0ce8 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_alloc.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_alloc.c @@ -26,13 +26,18 @@ int main(void) { - hid_t file, space, dset1, dset2, dcpl; + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset1 = H5I_INVALID_HID; + hid_t dset2 = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; /* Handles */ herr_t status; H5D_space_status_t space_status; - hsize_t dims[2] = {DIM0, DIM1}, storage_size; - int wdata[DIM0][DIM1], /* Write buffer */ - i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t storage_size; + int wdata[DIM0][DIM1]; /* Write buffer */ + hsize_t i, j; /* * Initialize data. diff --git a/HDF5Examples/C/H5D/16/h5ex_d_checksum.c b/HDF5Examples/C/H5D/16/h5ex_d_checksum.c index ce057aa..a03e004 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_checksum.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_checksum.c @@ -27,7 +27,10 @@ int main(void) { - hid_t file, space, dset, dcpl; + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; /* Handles */ herr_t status; htri_t avail; @@ -35,9 +38,10 @@ main(void) hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts; unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - max, i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int max; + hsize_t i, j; /* * Check if the Fletcher32 filter is available and can be used for diff --git a/HDF5Examples/C/H5D/16/h5ex_d_chunk.c b/HDF5Examples/C/H5D/16/h5ex_d_chunk.c index b19e7c7..4697261 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_chunk.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_chunk.c @@ -27,13 +27,21 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; H5D_layout_t layout; - hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}, start[2], stride[2], count[2], block[2]; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + hsize_t start[2]; + hsize_t stride[2]; + hsize_t count[2]; + hsize_t block[2]; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data to "1", to make it easier to see the selections. diff --git a/HDF5Examples/C/H5D/16/h5ex_d_compact.c b/HDF5Examples/C/H5D/16/h5ex_d_compact.c index 2d199ec..0c10a87 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_compact.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_compact.c @@ -22,13 +22,16 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; H5D_layout_t layout; hsize_t dims[2] = {DIM0, DIM1}; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data. diff --git a/HDF5Examples/C/H5D/16/h5ex_d_extern.c b/HDF5Examples/C/H5D/16/h5ex_d_extern.c index f0cc60d..6291c3c 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_extern.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_extern.c @@ -25,13 +25,16 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; hsize_t dims[2] = {DIM0, DIM1}; char name[NAME_BUF_SIZE]; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data. diff --git a/HDF5Examples/C/H5D/16/h5ex_d_fillval.c b/HDF5Examples/C/H5D/16/h5ex_d_fillval.c index e2fd100..4f6eee3 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_fillval.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_fillval.c @@ -30,15 +30,20 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; - hsize_t dims[2] = {DIM0, DIM1}, extdims[2] = {EDIM0, EDIM1}, maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}, - chunk[2] = {CHUNK0, CHUNK1}; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - rdata2[EDIM0][EDIM1], /* Read buffer for - extension */ - fillval, i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t extdims[2] = {EDIM0, EDIM1}; + hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int rdata2[EDIM0][EDIM1]; /* Read buffer for extension */ + int fillval; + hsize_t i, j; /* * Initialize data. diff --git a/HDF5Examples/C/H5D/16/h5ex_d_gzip.c b/HDF5Examples/C/H5D/16/h5ex_d_gzip.c index cd44d8e..2b35559 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_gzip.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_gzip.c @@ -26,16 +26,22 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; htri_t avail; H5Z_filter_t filter_type; - hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts; - unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - max, i, j; + unsigned int flags; + unsigned int filter_info; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int max; + hsize_t i, j; /* * Check if gzip compression is available and can be used for both diff --git a/HDF5Examples/C/H5D/16/h5ex_d_hyper.c b/HDF5Examples/C/H5D/16/h5ex_d_hyper.c index df361d6..1d81ec2 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_hyper.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_hyper.c @@ -25,12 +25,18 @@ int main(void) { - hid_t file, space, dset; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; herr_t status; - hsize_t dims[2] = {DIM0, DIM1}, start[2], stride[2], count[2], block[2]; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t start[2]; + hsize_t stride[2]; + hsize_t count[2]; + hsize_t block[2]; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data to "1", to make it easier to see the selections. diff --git a/HDF5Examples/C/H5D/16/h5ex_d_rdwr.c b/HDF5Examples/C/H5D/16/h5ex_d_rdwr.c index 4b6a56a..fbdc180 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_rdwr.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_rdwr.c @@ -22,12 +22,14 @@ int main(void) { - hid_t file, space, dset; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; herr_t status; hsize_t dims[2] = {DIM0, DIM1}; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data. diff --git a/HDF5Examples/C/H5D/16/h5ex_d_shuffle.c b/HDF5Examples/C/H5D/16/h5ex_d_shuffle.c index cff4730..137b4b8 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_shuffle.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_shuffle.c @@ -27,16 +27,22 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; htri_t avail; H5Z_filter_t filter_type; - hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts; - unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - max, nfilters, i, j; + unsigned int flags; + unsigned int filter_info; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int max, nfilters; + int i, j; /* * Check if gzip compression is available and can be used for both diff --git a/HDF5Examples/C/H5D/16/h5ex_d_szip.c b/HDF5Examples/C/H5D/16/h5ex_d_szip.c index 6ecc6ef..cf2f639 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_szip.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_szip.c @@ -26,16 +26,23 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + herr_t status; htri_t avail; H5Z_filter_t filter_type; - hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts; - unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - max, i, j; + unsigned int flags; + unsigned int filter_info; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int max; + hsize_t i, j; /* * Check if szip compression is available and can be used for both diff --git a/HDF5Examples/C/H5D/16/h5ex_d_unlimadd.c b/HDF5Examples/C/H5D/16/h5ex_d_unlimadd.c index 1c271d3..6f855ea 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_unlimadd.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_unlimadd.c @@ -29,15 +29,22 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; - hsize_t dims[2] = {DIM0, DIM1}, extdims[2] = {EDIM0, EDIM1}, maxdims[2], chunk[2] = {CHUNK0, CHUNK1}, - start[2], count[2]; - int wdata[DIM0][DIM1], /* Write buffer */ - wdata2[EDIM0][EDIM1], /* Write buffer for - extension */ - **rdata, /* Read buffer */ - ndims, i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t extdims[2] = {EDIM0, EDIM1}; + hsize_t maxdims[2]; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + hsize_t start[2]; + hsize_t count[2]; + int wdata[DIM0][DIM1]; /* Write buffer */ + int wdata2[EDIM0][EDIM1]; /* Write buffer for extension */ + int **rdata = NULL; /* Read buffer */ + int ndims; + hsize_t i, j; /* * Initialize data. diff --git a/HDF5Examples/C/H5D/16/h5ex_d_unlimgzip.c b/HDF5Examples/C/H5D/16/h5ex_d_unlimgzip.c index 3e90506..227b3aa 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_unlimgzip.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_unlimgzip.c @@ -30,19 +30,26 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; htri_t avail; H5Z_filter_t filter_type; - hsize_t dims[2] = {DIM0, DIM1}, extdims[2] = {EDIM0, EDIM1}, maxdims[2], chunk[2] = {CHUNK0, CHUNK1}, - start[2], count[2]; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t extdims[2] = {EDIM0, EDIM1}; + hsize_t maxdims[2]; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + hsize_t start[2]; + hsize_t count[2]; size_t nelmts; unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - wdata2[EDIM0][EDIM1], /* Write buffer for - extension */ - **rdata, /* Read buffer */ - ndims, i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int wdata2[EDIM0][EDIM1]; /* Write buffer for extension */ + int **rdata = NULL; /* Read buffer */ + int ndims; + hsize_t i, j; /* * Check if gzip compression is available and can be used for both diff --git a/HDF5Examples/C/H5D/16/h5ex_d_unlimmod.c b/HDF5Examples/C/H5D/16/h5ex_d_unlimmod.c index 6601427..f06a1ff 100644 --- a/HDF5Examples/C/H5D/16/h5ex_d_unlimmod.c +++ b/HDF5Examples/C/H5D/16/h5ex_d_unlimmod.c @@ -29,14 +29,20 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; - hsize_t dims[2] = {DIM0, DIM1}, extdims[2] = {EDIM0, EDIM1}, maxdims[2], chunk[2] = {CHUNK0, CHUNK1}; - int wdata[DIM0][DIM1], /* Write buffer */ - wdata2[EDIM0][EDIM1], /* Write buffer for - extension */ - **rdata, /* Read buffer */ - ndims, i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t extdims[2] = {EDIM0, EDIM1}; + hsize_t maxdims[2]; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + int wdata[DIM0][DIM1]; /* Write buffer */ + int wdata2[EDIM0][EDIM1]; /* Write buffer for extension */ + int **rdata = NULL; /* Read buffer */ + int ndims; + hsize_t i, j; /* * Initialize data. diff --git a/HDF5Examples/C/H5D/CMakeLists.txt b/HDF5Examples/C/H5D/CMakeLists.txt index 02f9ac7..b530f4c 100644 --- a/HDF5Examples/C/H5D/CMakeLists.txt +++ b/HDF5Examples/C/H5D/CMakeLists.txt @@ -7,7 +7,7 @@ project (HDF5Examples_C_H5D C) include (C_sourcefiles.cmake) foreach (example_name ${common_examples}) - if (${H5_LIBVER_DIR} EQUAL 16) + if (${H5_LIBVER_DIR} EQUAL 16 OR ${EXAMPLE_VARNAME}_USE_16_API) add_executable (${EXAMPLE_VARNAME}_${example_name} ${PROJECT_SOURCE_DIR}/16/${example_name}.c) else () add_executable (${EXAMPLE_VARNAME}_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.c) |