diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-08-23 19:09:20 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2019-08-23 19:09:20 (GMT) |
commit | d20d355b79bf25d2685dc9e3967951b1532951bb (patch) | |
tree | c862028f2d6c7ea540c6ffd2ca34d6ac9b715686 /test | |
parent | c951ee8eded3cd63adfeaa87dcdd966ceb3e58c1 (diff) | |
download | hdf5-d20d355b79bf25d2685dc9e3967951b1532951bb.zip hdf5-d20d355b79bf25d2685dc9e3967951b1532951bb.tar.gz hdf5-d20d355b79bf25d2685dc9e3967951b1532951bb.tar.bz2 |
OESS-29 Update HD prefix and compare against develop
Diffstat (limited to 'test')
-rw-r--r-- | test/atomic_reader.c | 30 | ||||
-rw-r--r-- | test/atomic_writer.c | 10 | ||||
-rw-r--r-- | test/cache_image.c | 2999 | ||||
-rw-r--r-- | test/cache_tagging.c | 272 | ||||
-rw-r--r-- | test/cmpd_dset.c | 2 | ||||
-rw-r--r-- | test/enc_dec_plist.c | 2 | ||||
-rw-r--r-- | test/external.c | 1 | ||||
-rw-r--r-- | test/istore.c | 2 | ||||
-rw-r--r-- | test/mf.c | 146 | ||||
-rw-r--r-- | test/objcopy.c | 20 | ||||
-rw-r--r-- | test/tattr.c | 2 | ||||
-rw-r--r-- | test/testframe.c | 202 | ||||
-rw-r--r-- | test/testhdf5.h | 90 | ||||
-rw-r--r-- | test/testmeta.c | 110 | ||||
-rw-r--r-- | test/th5s.c | 4 | ||||
-rw-r--r-- | test/trefer.c | 8 | ||||
-rw-r--r-- | test/tselect.c | 2058 | ||||
-rw-r--r-- | test/vds.c | 2 |
18 files changed, 2968 insertions, 2992 deletions
diff --git a/test/atomic_reader.c b/test/atomic_reader.c index 3e3a20a..5c1241f 100644 --- a/test/atomic_reader.c +++ b/test/atomic_reader.c @@ -55,7 +55,7 @@ int verify(int fd, unsigned int k); void print_info(int *info, unsigned int lastr, unsigned iteration); - + /*------------------------------------------------------------------------- * Function: usage * @@ -63,7 +63,7 @@ void print_info(int *info, unsigned int lastr, unsigned iteration); * * Parameters: None * - * Return: void + * Return: void * *------------------------------------------------------------------------- */ @@ -78,13 +78,13 @@ usage(void) printf("\n"); } /* usage() */ - + /*------------------------------------------------------------------------- * Function: verify * * Purpose: To verify that the data read is the pattern expected. * Each integer read should be the same as the index. - * When a difference is encountered, the remaining integers + * When a difference is encountered, the remaining integers * read should be the same as the previous index. * For example, the pattern expected should be either: * a) 01234567....n-1 @@ -93,11 +93,11 @@ usage(void) * the remaining integers should be all "3"s as: * 012333333333333 * - * Parameters: + * Parameters: * fd -- the file descriptor * k -- the number of integers to read * - * Return: + * Return: * positive on success * negative on failure * @@ -106,9 +106,9 @@ usage(void) int verify(int fd, unsigned int k) { - unsigned int i; /* local index variable */ - ssize_t bytes_read; /* the number of bytes read */ - unsigned int *buf = NULL; /* buffer to hold data read */ + unsigned int i; /* local index variable */ + ssize_t bytes_read; /* the number of bytes read */ + unsigned int *buf = NULL; /* buffer to hold data read */ /* Allocate buffer for data read */ if((buf = (unsigned int *)malloc(k * sizeof(unsigned int))) == NULL) { @@ -165,13 +165,13 @@ error: } /* end verify() */ - + /*------------------------------------------------------------------------- * Function: print_info * * Purpose: To print the statistics gathered for re-reads * - * Parameters: + * Parameters: * info -- the array storing the statistics for re-reads * lastr -- the last read completed * iteration -- the current iteration @@ -183,7 +183,7 @@ error: void print_info(int *info, unsigned int lastr, unsigned iteration) { - unsigned j; /* local index variable */ + unsigned j; /* local index variable */ printf("--------statistics for %u reads (iteration %u)--------\n", lastr, iteration); @@ -193,13 +193,13 @@ print_info(int *info, unsigned int lastr, unsigned iteration) printf("--------end statistics for %u reads (iteration %u)--------\n", lastr, iteration); } /* print_info() */ - + /*------------------------------------------------------------------------- * Function: main * * Purpose: To verify that the data read is the pattern expected. - * (1) Make sure the file opens successfully and the # of bytes read is as expected - * (2) Iterate the reader with i iterations + * (1) Make sure the file opens successfully and the # of bytes read is as expected + * (2) Iterate the reader with i iterations * (3) Read and verify n integers for each iteration * (4) On verification error, re-read the data at most READ_TRIES * times to see if correct data can be obtained diff --git a/test/atomic_writer.c b/test/atomic_writer.c index 218d4da..b9ea03a 100644 --- a/test/atomic_writer.c +++ b/test/atomic_writer.c @@ -14,7 +14,7 @@ * * Created: atomic_writer.c * - * Purpose: This is the "writer" part of the standalone test to check + * Purpose: This is the "writer" part of the standalone test to check * atomic read-write operation on a system. * a) atomic_writer.c--the writer (this file) * b) atomic_reader.c--the reader @@ -53,7 +53,7 @@ static void usage(void); - + /*------------------------------------------------------------------------- * Function: usage * @@ -77,12 +77,12 @@ usage(void) } /* usage() */ - + /*------------------------------------------------------------------------- * Function: main * * Purpose: To write a series of integers to a file for the reader to verify the data. - * A write is atomic if the whole amount written in one operation is not interleaved + * A write is atomic if the whole amount written in one operation is not interleaved * with data from any other process. * (1) Iterate with i iterations * (2) Write a series of integers (0 to n-1) to the file with this pattern: @@ -196,7 +196,7 @@ main(int argc, char *argv[]) printf("WRITER: error from lseek\n"); goto error; } /* end if */ - + /* Write the data */ if((bytes_wrote = write(fd, buf, ((num-n) * sizeof(unsigned int)))) < 0) { printf("WRITER: error from write\n"); diff --git a/test/cache_image.c b/test/cache_image.c index d043dcd..d5d3d95 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -14,8 +14,8 @@ /* Programmer: John Mainzer * 7/13/15 * - * This file contains tests specific to the cache image - * feature implemented in H5C.c + * This file contains tests specific to the cache image + * feature implemented in H5C.c */ #include "cache_common.h" #include "genall5.h" @@ -33,7 +33,7 @@ static void create_datasets(hid_t file_id, int min_dset, int max_dset); static void delete_datasets(hid_t file_id, int min_dset, int max_dset); static void open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, hbool_t read_only, hbool_t set_mdci_fapl, hbool_t config_fsm, - hbool_t set_eoc, const char *hdf_file_name, unsigned cache_image_flags, + hbool_t set_eoc, const char *hdf_file_name, unsigned cache_image_flags, hid_t *file_id_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr); static void attempt_swmr_open_hdf5_file(hbool_t create_file, hbool_t set_mdci_fapl, const char *hdf_file_name); @@ -62,7 +62,6 @@ static unsigned cache_image_api_error_check_4(void); static unsigned get_free_sections_test(void); static unsigned evict_on_close_test(void); - /****************************************************************************/ /***************************** Utility Functions ****************************/ /****************************************************************************/ @@ -71,10 +70,10 @@ static unsigned evict_on_close_test(void); * Function: create_datasets() * * Purpose: If pass is TRUE on entry, create the specified datasets - * in the indicated file. + * in the indicated file. * - * Datasets and their contents must be well known, as we - * will verify that they contain the expected data later. + * Datasets and their contents must be well known, as we + * will verify that they contain the expected data later. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -93,7 +92,7 @@ static unsigned evict_on_close_test(void); #define DSET_SIZE (40 * CHUNK_SIZE) #define MAX_NUM_DSETS 256 -static void +static void create_datasets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "create_datasets()"; @@ -315,8 +314,8 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) /* read the chunk from file */ if ( pass ) { - status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, - memspace_id, filespace_ids[m], + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, + memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); if ( status < 0 ) { @@ -341,7 +340,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) valid_chunk = FALSE; - if ( verbose ) { + if ( verbose ) { HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", @@ -351,7 +350,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) HDfprintf(stdout, "m = %d, i = %d, j = %d, k = %d, l = %d\n", m, i, j, k, l); - } + } } } } @@ -361,12 +360,12 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) pass = FALSE; failure_mssg = "slab validation failed."; - if ( verbose ) { + if ( verbose ) { HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); - } + } } } m++; @@ -417,16 +416,16 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) } /* create_datasets() */ - + /*------------------------------------------------------------------------- * Function: delete_datasets() * - * Purpose: If pass is TRUE on entry, verify and then delete the - * dataset(s) indicated by min_dset and max_dset in the - * indicated file. + * Purpose: If pass is TRUE on entry, verify and then delete the + * dataset(s) indicated by min_dset and max_dset in the + * indicated file. * - * Datasets and their contents must be well know, as we - * will verify that they contain the expected data later. + * Datasets and their contents must be well know, as we + * will verify that they contain the expected data later. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -441,7 +440,7 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) *------------------------------------------------------------------------- */ -static void +static void delete_datasets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "delete_datasets()"; @@ -472,11 +471,11 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset) { HDsprintf(dset_name, "/dset%03d", i); - if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) { + if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) { pass = FALSE; failure_mssg = "H5Ldelete() failed."; - } + } i++; } @@ -488,32 +487,32 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset) } /* delete_datasets() */ - + /*------------------------------------------------------------------------- * Function: open_hdf5_file() * - * Purpose: If pass is true on entry, create or open the specified HDF5 - * and test to see if it has a metadata cache image superblock - * extension message. + * Purpose: If pass is true on entry, create or open the specified HDF5 + * and test to see if it has a metadata cache image superblock + * extension message. * - * Set pass to FALSE and issue a suitable failure - * message if either the file contains a metadata cache image - * superblock extension and mdci_sbem_expected is TRUE, or - * vise versa. + * Set pass to FALSE and issue a suitable failure + * message if either the file contains a metadata cache image + * superblock extension and mdci_sbem_expected is TRUE, or + * vise versa. * - * If mdci_sbem_expected is TRUE, also verify that the metadata - * cache has been advised of this. + * If mdci_sbem_expected is TRUE, also verify that the metadata + * cache has been advised of this. * - * If read_only is TRUE, open the file read only. Otherwise - * open the file read/write. + * If read_only is TRUE, open the file read only. Otherwise + * open the file read/write. * - * If set_mdci_fapl is TRUE, set the metadata cache image - * FAPL entry when opening the file, and verify that the - * metadata cache is notified. + * If set_mdci_fapl is TRUE, set the metadata cache image + * FAPL entry when opening the file, and verify that the + * metadata cache is notified. * - * If config_fsm is TRUE, setup the persistent free space - * manager. Note that this flag may only be set if - * create_file is also TRUE. + * If config_fsm is TRUE, setup the persistent free space + * manager. Note that this flag may only be set if + * create_file is also TRUE. * * Return pointers to the cache data structure and file data * structures. @@ -556,8 +555,8 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, if ( pass ) { - /* opening the file both read only and with a cache image - * requested is a contradiction. We resolve it by ignoring + /* opening the file both read only and with a cache image + * requested is a contradiction. We resolve it by ignoring * the cache image request silently. */ if ( ( create_file && mdci_sbem_expected ) || @@ -600,7 +599,7 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, /* call H5Pset_libver_bounds() on the fapl_id */ if ( pass ) { - if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, + if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) { pass = FALSE; @@ -625,7 +624,7 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( cache_image_config.generate_image != FALSE ) || ( cache_image_config.save_resize_status != FALSE ) || - ( cache_image_config.entry_ageout != + ( cache_image_config.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) ) { pass = FALSE; @@ -657,17 +656,17 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, /* setup the persistent free space manager if indicated */ if ( ( pass ) && ( config_fsm ) ) { - fcpl_id = H5Pcreate(H5P_FILE_CREATE); + fcpl_id = H5Pcreate(H5P_FILE_CREATE); - if ( fcpl_id <= 0 ) { + if ( fcpl_id <= 0 ) { - pass = FALSE; - failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed."; - } + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed."; + } } if ( ( pass ) && ( config_fsm ) ) { - if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, + if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) { pass = FALSE; failure_mssg = "H5Pset_file_space_strategy() failed."; @@ -693,13 +692,13 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, if ( create_file ) { - if ( fcpl_id != -1 ) + if ( fcpl_id != -1 ) - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, fcpl_id, fapl_id); - else + else - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); } else { @@ -779,26 +778,26 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, if ( set_mdci_fapl ) { - if ( read_only ) { + if ( read_only ) { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != FALSE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { pass = FALSE; failure_mssg = "Unexpected image_ctl values(1).\n"; } - } else { + } else { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != TRUE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { @@ -808,11 +807,11 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, } } else { - if ( ( image_ctl.version != + if ( ( image_ctl.version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION ) || ( image_ctl.generate_image != FALSE ) || ( image_ctl.save_resize_status != FALSE ) || - ( image_ctl.entry_ageout != + ( image_ctl.entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE ) || ( image_ctl.flags != H5C_CI__ALL_FLAGS ) ) { @@ -863,15 +862,15 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, pass = FALSE; failure_mssg = "mdci sb extension message not present?\n"; } - } + } } else { - if ( ( cache_ptr->load_image == TRUE ) || + if ( ( cache_ptr->load_image == TRUE ) || ( cache_ptr->delete_image == TRUE ) ) { pass = FALSE; failure_mssg = "mdci sb extension message present?\n"; - } + } } } @@ -891,12 +890,12 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, } /* open_hdf5_file() */ - + /*------------------------------------------------------------------------- * Function: attempt_swmr_open_hdf5_file() * - * Purpose: If pass is true on entry, attempt to create or open the - * specified HDF5 file with SWMR, and also with cache image + * Purpose: If pass is true on entry, attempt to create or open the + * specified HDF5 file with SWMR, and also with cache image * creation if requested. * * In all cases, the attempted open or create should fail. @@ -913,8 +912,8 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, static void attempt_swmr_open_hdf5_file(const hbool_t create_file, - const hbool_t set_mdci_fapl, - const char * hdf_file_name) + const hbool_t set_mdci_fapl, + const char * hdf_file_name) { const char * fcn_name = "attempt_swmr_open_hdf5_file()"; hbool_t show_progress = FALSE; @@ -945,7 +944,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, /* call H5Pset_libver_bounds() on the fapl_id */ if ( pass ) { - if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) + if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) { pass = FALSE; @@ -980,8 +979,8 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, if ( create_file ) { H5E_BEGIN_TRY { - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE, - H5P_DEFAULT, fapl_id); + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE, + H5P_DEFAULT, fapl_id); } H5E_END_TRY; } else { @@ -995,7 +994,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, pass = FALSE; failure_mssg = "SWMR H5Fcreate() or H5Fopen() succeeded.\n"; - } + } } if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); @@ -1004,17 +1003,17 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, } /* attempt_swmr_open_hdf5_file() */ - + /*------------------------------------------------------------------------- * Function: verify_datasets() * - * Purpose: If pass is TRUE on entry, verify that the datasets in the - * file exist and contain the expected data. + * Purpose: If pass is TRUE on entry, verify that the datasets in the + * file exist and contain the expected data. * - * Note that these datasets were created by - * create_datasets() above. Thus any changes in that - * function must be reflected in this function, and - * vise-versa. + * Note that these datasets were created by + * create_datasets() above. Thus any changes in that + * function must be reflected in this function, and + * vise-versa. * * On failure, set pass to FALSE, and set failure_mssg * to point to an appropriate failure message. @@ -1029,7 +1028,7 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, *------------------------------------------------------------------------- */ -static void +static void verify_datasets(hid_t file_id, int min_dset, int max_dset) { const char * fcn_name = "verify_datasets()"; @@ -1157,8 +1156,8 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) /* read the chunk from file */ if ( pass ) { - status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, - memspace_id, filespace_ids[m], + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, + memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); if ( status < 0 ) { @@ -1183,8 +1182,8 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) valid_chunk = FALSE; - if ( verbose ) { - + if ( verbose ) { + HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", k, l, data_chunk[k][l], @@ -1193,7 +1192,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) HDfprintf(stdout, "m = %d, i = %d, j = %d, k = %d, l = %d\n", m, i, j, k, l); - } + } } } } @@ -1203,12 +1202,12 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) pass = FALSE; failure_mssg = "slab validation failed."; - if ( verbose ) { + if ( verbose ) { HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); - } + } } } m++; @@ -1259,7 +1258,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) } /* verify_datasets() */ - + /****************************************************************************/ /******************************* Test Functions *****************************/ /****************************************************************************/ @@ -1268,60 +1267,60 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) * Function: check_cache_image_ctl_flow_1() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with cache image FAPL entry set - * and insertion of metadata cache image superblock - * message on file close. + * i) Creation of file with cache image FAPL entry set + * and insertion of metadata cache image superblock + * message on file close. * - * ii) Open of file with metadata cache image superblock - * message, transmission of message to metadata cache, - * and deletion of superblock message prior to close. + * ii) Open of file with metadata cache image superblock + * message, transmission of message to metadata cache, + * and deletion of superblock message prior to close. * - * Note that in all cases we are performing operations on the - * file. While this is the typical case, we must repeat this - * test without operations on the file. + * Note that in all cases we are performing operations on the + * file. While this is the typical case, we must repeat this + * test without operations on the file. * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file. + * 4) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 5) Open a dataset. + * 5) Open a dataset. * - * Verify that the metadata cache image superblock - * extension message has been deleted. + * Verify that the metadata cache image superblock + * extension message has been deleted. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 8) Close the file. + * 8) Close the file. * - * 9) Delete the file. + * 9) Delete the file. * * Return: void * @@ -1346,7 +1345,7 @@ check_cache_image_ctl_flow_1(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -1361,16 +1360,16 @@ check_cache_image_ctl_flow_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image super block - * extension message only. + * Set flags forcing creation of metadata cache image super block + * extension message only. */ if ( pass ) { @@ -1379,8 +1378,8 @@ check_cache_image_ctl_flow_1(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -1388,10 +1387,10 @@ check_cache_image_ctl_flow_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -1399,10 +1398,10 @@ check_cache_image_ctl_flow_1(void) create_datasets(file_id, 0, 5); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -1415,26 +1414,26 @@ check_cache_image_ctl_flow_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 4) Open the file. + + + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the - * metadata cache image, and that the supplied address and length - * are HADDR_UNDEF and zero respectively. Note that these values + * Verify that the metadata cache is instructed to load the + * metadata cache image, and that the supplied address and length + * are HADDR_UNDEF and zero respectively. Note that these values * indicate that the metadata image block doesn't exist. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1442,13 +1441,13 @@ check_cache_image_ctl_flow_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -1464,9 +1463,9 @@ check_cache_image_ctl_flow_1(void) */ } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -1479,24 +1478,24 @@ check_cache_image_ctl_flow_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 7) Open the file. + + + /* 7) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1504,9 +1503,9 @@ check_cache_image_ctl_flow_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 8) Close the file. */ @@ -1519,9 +1518,9 @@ check_cache_image_ctl_flow_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 9) Delete the file */ @@ -1544,63 +1543,63 @@ check_cache_image_ctl_flow_1(void) } /* check_cache_image_ctl_flow_1() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_2() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with cache image FAPL entry set - * and insertion of metadata cache image superblock - * message on file close. + * i) Creation of file with cache image FAPL entry set + * and insertion of metadata cache image superblock + * message on file close. * - * ii) Open of file with metadata cache image superblock - * message, transmission of message to metadata cache, - * and deletion of superblock message prior to close. + * ii) Open of file with metadata cache image superblock + * message, transmission of message to metadata cache, + * and deletion of superblock message prior to close. * - * Note that unlike the previous test, no operations are performed - * on the file. As a result of this, the metadata cache image - * message is not processed until the metadata cache receives - * the file close warning. (Under normal circumstances, it is - * processed as part of the first protect operation after the - * superblock is loaded.) + * Note that unlike the previous test, no operations are performed + * on the file. As a result of this, the metadata cache image + * message is not processed until the metadata cache receives + * the file close warning. (Under normal circumstances, it is + * processed as part of the first protect operation after the + * superblock is loaded.) * - * In this particular test, we preform the following operations: + * In this particular test, we preform the following operations: * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 2) Close the file. + * 2) Close the file. * - * 3) Open the file. + * 3) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 8) Close the file. + * 8) Close the file. * - * 9) Delete the file. + * 9) Delete the file. * * Return: void * @@ -1625,7 +1624,7 @@ check_cache_image_ctl_flow_2(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* setup the file name */ @@ -1639,16 +1638,16 @@ check_cache_image_ctl_flow_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image super block - * extension message only. + * Set flags forcing creation of metadata cache image super block + * extension message only. */ if ( pass ) { @@ -1657,8 +1656,8 @@ check_cache_image_ctl_flow_2(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -1666,10 +1665,10 @@ check_cache_image_ctl_flow_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Close the file. */ if ( pass ) { @@ -1682,26 +1681,26 @@ check_cache_image_ctl_flow_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 3) Open the file. + + + /* 3) Open the file. * - * Verify that the metadata cache is instructed to load the - * metadata cache image, and that the supplied address and length - * are HADDR_UNDEF and zero respectively. Note that these values + * Verify that the metadata cache is instructed to load the + * metadata cache image, and that the supplied address and length + * are HADDR_UNDEF and zero respectively. Note that these values * indicate that the metadata image block doesn't exist. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1709,10 +1708,10 @@ check_cache_image_ctl_flow_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Close the file. */ if ( pass ) { @@ -1724,24 +1723,24 @@ check_cache_image_ctl_flow_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 5) Open the file. + + + /* 5) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1749,9 +1748,9 @@ check_cache_image_ctl_flow_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -1764,9 +1763,9 @@ check_cache_image_ctl_flow_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Delete the file */ @@ -1789,81 +1788,81 @@ check_cache_image_ctl_flow_2(void) } /* check_cache_image_ctl_flow_2() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_3() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * The objectives of this test are to: + * The objectives of this test are to: * - * i) Test operation of the metadata cache image FAPL - * entry set on open of an existing file. This - * should result in the insertion of a metadata - * cache image superblock message on file close. + * i) Test operation of the metadata cache image FAPL + * entry set on open of an existing file. This + * should result in the insertion of a metadata + * cache image superblock message on file close. * - * ii) Test operation of the metadata cache image super - * block extension message when it appears in a file - * that is opened READ ONLY. + * ii) Test operation of the metadata cache image super + * block extension message when it appears in a file + * that is opened READ ONLY. * - * Note that in all cases we are performing operations on the - * file between file open and close. While this is the - * typical case, we must repeat this test without operations - * on the file. + * Note that in all cases we are performing operations on the + * file between file open and close. While this is the + * typical case, we must repeat this test without operations + * on the file. * - * 1) Create a HDF5 file WITHOUT the cache image FAPL entry. + * 1) Create a HDF5 file WITHOUT the cache image FAPL entry. * - * Verify that the cache is NOT informed of the cache image - * FAPL entry. + * Verify that the cache is NOT informed of the cache image + * FAPL entry. * - * 2) Close the file. + * 2) Close the file. * - * 3) Open the file WITH the cache image FAPL entry. + * 3) Open the file WITH the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 4) Create some datasets. + * 4) Create some datasets. * - * 5) Close the file. + * 5) Close the file. * - * 6) Open the file READ ONLY. + * 6) Open the file READ ONLY. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 7) Verify the contents of the datasets. + * 7) Verify the contents of the datasets. * - * 8) Close the file. + * 8) Close the file. * - * 9) Open the file READ/WRITE. + * 9) Open the file READ/WRITE. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 10) Verify the contents of the datasets. + * 10) Verify the contents of the datasets. * - * 11) Close the file. + * 11) Close the file. * - * 12) Open the file + * 12) Open the file * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 13) Close the file. + * 13) Close the file. * - * 14) Delete the file. + * 14) Delete the file. * * Return: void * @@ -1904,10 +1903,10 @@ check_cache_image_ctl_flow_3(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry. + + /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry. * - * Verify that the cache is NOT informed of the cache image + * Verify that the cache is NOT informed of the cache image * FAPL entry. */ @@ -1917,8 +1916,8 @@ check_cache_image_ctl_flow_3(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1929,7 +1928,7 @@ check_cache_image_ctl_flow_3(void) if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Close the file. */ if ( pass ) { @@ -1943,13 +1942,13 @@ check_cache_image_ctl_flow_3(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 3) Open the file WITH the cache image FAPL entry. + + + /* 3) Open the file WITH the cache image FAPL entry. * * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image super block + * Set flags forcing creation of metadata cache image super block * extension message only. */ @@ -1959,8 +1958,8 @@ check_cache_image_ctl_flow_3(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -1996,13 +1995,13 @@ check_cache_image_ctl_flow_3(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Open the file READ ONLY. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2010,11 +2009,11 @@ check_cache_image_ctl_flow_3(void) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2024,7 +2023,7 @@ check_cache_image_ctl_flow_3(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Verify the contents of the datasets. */ @@ -2050,13 +2049,13 @@ check_cache_image_ctl_flow_3(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 9) Open the file READ/WRITE. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2064,11 +2063,11 @@ check_cache_image_ctl_flow_3(void) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2090,7 +2089,7 @@ check_cache_image_ctl_flow_3(void) if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Close the file. */ if ( pass ) { @@ -2105,21 +2104,21 @@ check_cache_image_ctl_flow_3(void) if ( show_progress ) /* 12 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Open the file * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2145,7 +2144,7 @@ check_cache_image_ctl_flow_3(void) if ( show_progress ) /* 14 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Delete the file. */ if ( pass ) { @@ -2168,73 +2167,73 @@ check_cache_image_ctl_flow_3(void) } /* check_cache_image_ctl_flow_3() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_4() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * The objectives of this test are to: + * The objectives of this test are to: * - * i) Test operation of the metadata cache image FAPL - * entry set on open of an existing file. This - * should result in the insertion of a metadata - * cache image superblock message on file close. + * i) Test operation of the metadata cache image FAPL + * entry set on open of an existing file. This + * should result in the insertion of a metadata + * cache image superblock message on file close. * - * ii) Test operation of the metadata cache image super - * block extension message when it appears in a file - * that is opened READ ONLY. + * ii) Test operation of the metadata cache image super + * block extension message when it appears in a file + * that is opened READ ONLY. * - * In this test we avoid all file access beyond file open - * and close. + * In this test we avoid all file access beyond file open + * and close. * - * 1) Create a HDF5 file WITHOUT the cache image FAPL entry. + * 1) Create a HDF5 file WITHOUT the cache image FAPL entry. * - * Verify that the cache is NOT informed of the cache image - * FAPL entry. + * Verify that the cache is NOT informed of the cache image + * FAPL entry. * - * 2) Close the file. + * 2) Close the file. * - * 3) Open the file WITH the cache image FAPL entry. + * 3) Open the file WITH the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 4) Close the file. + * 4) Close the file. * - * 5) Open the file READ ONLY. + * 5) Open the file READ ONLY. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file READ/WRITE. + * 7) Open the file READ/WRITE. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 8) Close the file. + * 8) Close the file. * - * 9) Open the file + * 9) Open the file * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 10) Close the file. + * 10) Close the file. * - * 11) Delete the file. + * 11) Delete the file. * * Return: void * @@ -2275,10 +2274,10 @@ check_cache_image_ctl_flow_4(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry. + + /* 1) Create a HDF5 file WITHOUT the cache image FAPL entry. * - * Verify that the cache is NOT informed of the cache image + * Verify that the cache is NOT informed of the cache image * FAPL entry. */ @@ -2288,8 +2287,8 @@ check_cache_image_ctl_flow_4(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2300,7 +2299,7 @@ check_cache_image_ctl_flow_4(void) if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Close the file. */ if ( pass ) { @@ -2314,13 +2313,13 @@ check_cache_image_ctl_flow_4(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 3) Open the file WITH the cache image FAPL entry. + + + /* 3) Open the file WITH the cache image FAPL entry. * * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image super block + * Set flags forcing creation of metadata cache image super block * extension message only. */ @@ -2330,8 +2329,8 @@ check_cache_image_ctl_flow_4(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2356,13 +2355,13 @@ check_cache_image_ctl_flow_4(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 5) Open the file READ ONLY. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2370,11 +2369,11 @@ check_cache_image_ctl_flow_4(void) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2384,7 +2383,7 @@ check_cache_image_ctl_flow_4(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -2399,13 +2398,13 @@ check_cache_image_ctl_flow_4(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Open the file READ/WRITE. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2413,11 +2412,11 @@ check_cache_image_ctl_flow_4(void) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2443,21 +2442,21 @@ check_cache_image_ctl_flow_4(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 9) Open the file * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2483,7 +2482,7 @@ check_cache_image_ctl_flow_4(void) if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Delete the file. */ if ( pass ) { @@ -2506,66 +2505,66 @@ check_cache_image_ctl_flow_4(void) } /* check_cache_image_ctl_flow_4() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_5() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * The objective of this test is verify correct control flow - * when a file with a metadata cache image superblock extension - * message is opened with the metadata cache image FAPL entry. + * The objective of this test is verify correct control flow + * when a file with a metadata cache image superblock extension + * message is opened with the metadata cache image FAPL entry. * - * Note that in all cases we are performing operations on the - * file between file open and close. While this is the - * typical case, we must repeat this test without operations - * on the file. + * Note that in all cases we are performing operations on the + * file between file open and close. While this is the + * typical case, we must repeat this test without operations + * on the file. * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 2) Create some datasets. + * 2) Create some datasets. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file WITH the cache image FAPL entry. + * 4) Open the file WITH the cache image FAPL entry. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 5) Verify the contents of the datasets. + * 5) Verify the contents of the datasets. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 8) Verify the contents of the datasets. + * 8) Verify the contents of the datasets. * - * 9) Close the file. + * 9) Close the file. * - * 10) Delete the file. + * 10) Delete the file. * * Return: void * @@ -2607,12 +2606,12 @@ check_cache_image_ctl_flow_5(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 1) Create a HDF5 file with the cache image FAPL entry. + + /* 1) Create a HDF5 file with the cache image FAPL entry. * * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image + * Set flags forcing creation of metadata cache image * super block extension message only. */ @@ -2622,8 +2621,8 @@ check_cache_image_ctl_flow_5(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2633,7 +2632,7 @@ check_cache_image_ctl_flow_5(void) if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets. */ @@ -2645,7 +2644,7 @@ check_cache_image_ctl_flow_5(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Close the file. */ if ( pass ) { @@ -2660,30 +2659,30 @@ check_cache_image_ctl_flow_5(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 4) Open the file WITH the cache image FAPL entry. + + /* 4) Open the file WITH the cache image FAPL entry. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. * - * Verify that the cache is informed of the cache image + * Verify that the cache is informed of the cache image * FAPL entry. * - * Set flags forcing creation of metadata cache image + * Set flags forcing creation of metadata cache image * super block extension message only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2704,7 +2703,7 @@ check_cache_image_ctl_flow_5(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ if ( pass ) { @@ -2719,12 +2718,12 @@ check_cache_image_ctl_flow_5(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 7) Open the file. + + /* 7) Open the file. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2732,11 +2731,11 @@ check_cache_image_ctl_flow_5(void) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2756,8 +2755,8 @@ check_cache_image_ctl_flow_5(void) if ( show_progress ) /* 9 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 9) Close the file. */ if ( pass ) { @@ -2772,7 +2771,7 @@ check_cache_image_ctl_flow_5(void) if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Delete the file. */ if ( pass ) { @@ -2795,58 +2794,58 @@ check_cache_image_ctl_flow_5(void) } /* check_cache_image_ctl_flow_5() */ - + /*------------------------------------------------------------------------- * Function: check_cache_image_ctl_flow_6() * * Purpose: This test is one of a sequence of control flow tests intended - * to verify that control flow for the cache image feature works - * as expected. + * to verify that control flow for the cache image feature works + * as expected. * - * The objective of this test is verify correct control flow - * when a file with a metadata cache image superblock extension - * message is opened with the metadata cache image FAPL entry. + * The objective of this test is verify correct control flow + * when a file with a metadata cache image superblock extension + * message is opened with the metadata cache image FAPL entry. * - * In this test we avoid all file activity other than open - * and close. + * In this test we avoid all file activity other than open + * and close. * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 2) Close the file. + * 2) Close the file. * - * 3) Open the file WITH the cache image FAPL entry. + * 3) Open the file WITH the cache image FAPL entry. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set flags forcing creation of metadata cache image - * super block extension message only. + * Set flags forcing creation of metadata cache image + * super block extension message only. * - * 4) Close the file. + * 4) Close the file. * - * 5) Open the file. + * 5) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and - * zero respectively. Note that these values indicate - * that the metadata image block doesn't exist. + * Verify that the metadata cache is instructed + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and + * zero respectively. Note that these values indicate + * that the metadata image block doesn't exist. * - * 6) Close the file. + * 6) Close the file. * - * 7) Delete the file. + * 7) Delete the file. * * Return: void * @@ -2888,12 +2887,12 @@ check_cache_image_ctl_flow_6(void) if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 1) Create a HDF5 file with the cache image FAPL entry. + + /* 1) Create a HDF5 file with the cache image FAPL entry. * * Verify that the cache is informed of the cache image FAPL entry. * - * Set flags forcing creation of metadata cache image + * Set flags forcing creation of metadata cache image * super block extension message only. */ @@ -2903,8 +2902,8 @@ check_cache_image_ctl_flow_6(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2914,7 +2913,7 @@ check_cache_image_ctl_flow_6(void) if ( show_progress ) /* 2 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Close the file. */ @@ -2930,30 +2929,30 @@ check_cache_image_ctl_flow_6(void) if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 4) Open the file WITH the cache image FAPL entry. + + /* 4) Open the file WITH the cache image FAPL entry. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. * - * Verify that the cache is informed of the cache image + * Verify that the cache is informed of the cache image * FAPL entry. * - * Set flags forcing creation of metadata cache image + * Set flags forcing creation of metadata cache image * super block extension message only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2964,7 +2963,7 @@ check_cache_image_ctl_flow_6(void) if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 5) Close the file. */ if ( pass ) { @@ -2979,12 +2978,12 @@ check_cache_image_ctl_flow_6(void) if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 5) Open the file. + + /* 5) Open the file. * * Verify that the metadata cache is instructed - * to load the metadata cache image, and that the - * supplied address and length are HADDR_UNDEF and + * to load the metadata cache image, and that the + * supplied address and length are HADDR_UNDEF and * zero respectively. Note that these values indicate * that the metadata image block doesn't exist. */ @@ -2992,11 +2991,11 @@ check_cache_image_ctl_flow_6(void) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3007,7 +3006,7 @@ check_cache_image_ctl_flow_6(void) if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ if ( pass ) { @@ -3022,7 +3021,7 @@ check_cache_image_ctl_flow_6(void) if ( show_progress ) /* 7 */ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Delete the file. */ if ( pass ) { @@ -3045,93 +3044,93 @@ check_cache_image_ctl_flow_6(void) } /* check_cache_image_ctl_flow_6() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_1() * * Purpose: This test is one of a sequence of tests intended - * to exercise the cache image feature verifying that it - * works more or less correctly in common cases. + * to exercise the cache image feature verifying that it + * works more or less correctly in common cases. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with metadata cache image - * superblock extension message and cache image - * block. + * i) Creation of file with metadata cache image + * superblock extension message and cache image + * block. * - * ii) Open of file with metadata cache image superblock - * extension message and cache image block. - * Deserialization and removal of both, insertion - * of prefetched cache entries, and deserialization - * of prefetched cache entries as they are protected. + * ii) Open of file with metadata cache image superblock + * extension message and cache image block. + * Deserialization and removal of both, insertion + * of prefetched cache entries, and deserialization + * of prefetched cache entries as they are protected. * - * iii) Subsequent write of file without metadata cache - * image. + * iii) Subsequent write of file without metadata cache + * image. * - * iv) Open and close of file with metadata cache image - * image requested, but with no operations on the - * file. + * iv) Open and close of file with metadata cache image + * image requested, but with no operations on the + * file. * - * To do this: + * To do this: * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file. + * 4) Open the file. * - * Verify that the metadata cache is instructed - * to load the metadata cache image. + * Verify that the metadata cache is instructed + * to load the metadata cache image. * - * 5) Open a dataset. + * 5) Open a dataset. * - * Verify that it contains the expected data + * Verify that it contains the expected data * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 8) Open a dataset. + * 8) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file with the cache image FAPL entry. + * 10) Open the file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 11) Close the file. Since there has been no access to - * any entries that would be included in the cache image, - * there should be no cache image. + * 11) Close the file. Since there has been no access to + * any entries that would be included in the cache image, + * there should be no cache image. * - * 12) Open the file. + * 12) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 13) Open a dataset. + * 13) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 14) Close the file. + * 14) Close the file. * - * 15) Delete the file. + * 15) Delete the file. * * Return: void * @@ -3156,7 +3155,7 @@ cache_image_smoke_check_1(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3171,13 +3170,13 @@ cache_image_smoke_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -3188,8 +3187,8 @@ cache_image_smoke_check_1(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3197,10 +3196,10 @@ cache_image_smoke_check_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -3221,10 +3220,10 @@ cache_image_smoke_check_1(void) - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -3237,26 +3236,26 @@ cache_image_smoke_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 4) Open the file. + + + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the - * metadata cache image, and that the supplied address and length - * are HADDR_UNDEF and zero respectively. Note that these values + * Verify that the metadata cache is instructed to load the + * metadata cache image, and that the supplied address and length + * are HADDR_UNDEF and zero respectively. Note that these values * indicate that the metadata image block doesn't exist. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3264,13 +3263,13 @@ cache_image_smoke_check_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -3290,9 +3289,9 @@ cache_image_smoke_check_1(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -3305,24 +3304,24 @@ cache_image_smoke_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 7) Open the file. + + + /* 7) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3330,13 +3329,13 @@ cache_image_smoke_check_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -3357,7 +3356,7 @@ cache_image_smoke_check_1(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3372,24 +3371,24 @@ cache_image_smoke_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Open the file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3397,13 +3396,13 @@ cache_image_smoke_check_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 11) Close the file. Since there has been no access to - * any entries that would be included in the cache image, - * there should be no cache image. + + /* 11) Close the file. Since there has been no access to + * any entries that would be included in the cache image, + * there should be no cache image. */ if ( pass ) { @@ -3415,24 +3414,24 @@ cache_image_smoke_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3440,13 +3439,13 @@ cache_image_smoke_check_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. */ if ( pass ) { @@ -3466,10 +3465,10 @@ cache_image_smoke_check_1(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Close the file. */ if ( pass ) { @@ -3481,9 +3480,9 @@ cache_image_smoke_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 15) Delete the file */ @@ -3506,55 +3505,55 @@ cache_image_smoke_check_1(void) } /* cache_image_smoke_check_1() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_2() * * Purpose: This test is one of a sequence of tests intended - * to exercise the cache image feature verifying that it - * works more or less correctly in common cases. + * to exercise the cache image feature verifying that it + * works more or less correctly in common cases. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with metadata cache image - * superblock extension message and cache image - * block. + * i) Creation of file with metadata cache image + * superblock extension message and cache image + * block. * - * ii) Open of file with metadata cache image superblock - * extension message and cache image block. Write - * of prefetched entries to file on file close. + * ii) Open of file with metadata cache image superblock + * extension message and cache image block. Write + * of prefetched entries to file on file close. * - * To do this: + * To do this: * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file. + * 4) Open the file. * - * 5) Close the file. + * 5) Close the file. * - * 6) Open the file. + * 6) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 7) Open a dataset. + * 7) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 8) Close the file. + * 8) Close the file. * - * 9) Delete the file. + * 9) Delete the file. * * Return: void * @@ -3579,7 +3578,7 @@ cache_image_smoke_check_2(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3594,13 +3593,13 @@ cache_image_smoke_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -3611,8 +3610,8 @@ cache_image_smoke_check_2(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3620,10 +3619,10 @@ cache_image_smoke_check_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -3643,10 +3642,10 @@ cache_image_smoke_check_2(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -3659,23 +3658,23 @@ cache_image_smoke_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 4) Open the file. + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3684,15 +3683,15 @@ cache_image_smoke_check_2(void) } /* can't verify that metadata cache image has been loaded directly, - * as in this cache, the load will not happen until close, and thus - * the images_created stat will not be readily available as it is + * as in this cache, the load will not happen until close, and thus + * the images_created stat will not be readily available as it is * incremented just before the cache is shut down. */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Close the file. */ if ( pass ) { @@ -3704,24 +3703,24 @@ cache_image_smoke_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 6) Open the file. + + + /* 6) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3729,13 +3728,13 @@ cache_image_smoke_check_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 7) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -3744,7 +3743,7 @@ cache_image_smoke_check_2(void) verify_datasets(file_id, 0, 5); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3759,9 +3758,9 @@ cache_image_smoke_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 9) Delete the file */ @@ -3784,77 +3783,77 @@ cache_image_smoke_check_2(void) } /* cache_image_smoke_check_2() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_3() * * Purpose: This test is one of a sequence of tests intended - * to exercise the cache image feature verifying that it - * works more or less correctly in common cases. + * to exercise the cache image feature verifying that it + * works more or less correctly in common cases. * - * This test is an initial smoke check, so the sequence of - * operations is relatively simple. In particular, we are - * testing: + * This test is an initial smoke check, so the sequence of + * operations is relatively simple. In particular, we are + * testing: * - * i) Creation of file with metadata cache image - * superblock extension message and cache image - * block. + * i) Creation of file with metadata cache image + * superblock extension message and cache image + * block. * - * ii) Read only open and close of file with metadata - * cache image superblock extension message and - * cache image block. + * ii) Read only open and close of file with metadata + * cache image superblock extension message and + * cache image block. * - * iii) Subsequent R/W open and close of file with metadata - * cache image superblock extension message and + * iii) Subsequent R/W open and close of file with metadata + * cache image superblock extension message and * cache image block. * - * To do this: + * To do this: * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file read only. + * 4) Open the file read only. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 5 Open a dataset. + * 5 Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 8 Open a dataset. + * 8 Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file. + * 10) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 11) Open a dataset. + * 11) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 12) Close the file. + * 12) Close the file. * - * 13) Delete the file. + * 13) Delete the file. * * Return: void * @@ -3879,7 +3878,7 @@ cache_image_smoke_check_3(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -3894,13 +3893,13 @@ cache_image_smoke_check_3(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -3911,8 +3910,8 @@ cache_image_smoke_check_3(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3920,10 +3919,10 @@ cache_image_smoke_check_3(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -3942,10 +3941,10 @@ cache_image_smoke_check_3(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -3958,24 +3957,24 @@ cache_image_smoke_check_3(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 4) Open the file read only. + + + /* 4) Open the file read only. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3983,13 +3982,13 @@ cache_image_smoke_check_3(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4009,10 +4008,10 @@ cache_image_smoke_check_3(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ if ( pass ) { @@ -4024,24 +4023,24 @@ cache_image_smoke_check_3(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 7) Open the file. + + + /* 7) Open the file. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4049,13 +4048,13 @@ cache_image_smoke_check_3(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4076,7 +4075,7 @@ cache_image_smoke_check_3(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4090,22 +4089,22 @@ cache_image_smoke_check_3(void) failure_mssg = "H5Fclose() failed.\n"; } } - - - /* 10) Open the file. + + + /* 10) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4113,13 +4112,13 @@ cache_image_smoke_check_3(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 11) Open and close a dataset. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4140,7 +4139,7 @@ cache_image_smoke_check_3(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4155,9 +4154,9 @@ cache_image_smoke_check_3(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Delete the file */ @@ -4180,66 +4179,66 @@ cache_image_smoke_check_3(void) } /* cache_image_smoke_check_3() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_4() * - * Purpose: This test attempts to mimic the typical "poor man's - * parallel use case in which the file is passed between - * processes, each of which open the file, write some data, - * close the file, and then pass control on to the next - * process. + * Purpose: This test attempts to mimic the typical "poor man's + * parallel use case in which the file is passed between + * processes, each of which open the file, write some data, + * close the file, and then pass control on to the next + * process. * - * In this case, we only write one dataset per process. + * In this case, we only write one dataset per process. * - * Cycle of operation + * Cycle of operation * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create and write a dataset in the file. + * 2) Create and write a dataset in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file with the cache image FAPL entry. + * 4) Open the file with the cache image FAPL entry. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 5 Create and write a new dataset + * 5 Create and write a new dataset * - * 6) Close the file. + * 6) Close the file. * - * If sufficient datasets have been created, continue to + * If sufficient datasets have been created, continue to * 7). Otherwise goto 4) * - * 7) Open the file. + * 7) Open the file. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 8) Open all datasets that have been created, and - * verify that they contain the expected data. + * 8) Open all datasets that have been created, and + * verify that they contain the expected data. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file. + * 10) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 11) Open all datasets that have been created, and + * 11) Open all datasets that have been created, and * verify that they contain the expected data. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 12) Close the file. + * 12) Close the file. * - * 13) Delete the file. + * 13) Delete the file. * * Return: void * @@ -4266,7 +4265,7 @@ cache_image_smoke_check_4(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4281,13 +4280,13 @@ cache_image_smoke_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -4298,8 +4297,8 @@ cache_image_smoke_check_4(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4307,10 +4306,10 @@ cache_image_smoke_check_4(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create a dataset in the file. */ if ( pass ) { @@ -4329,10 +4328,10 @@ cache_image_smoke_check_4(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -4345,26 +4344,26 @@ cache_image_smoke_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); while ( ( pass ) && ( max_dset < MAX_NUM_DSETS ) ) { - - /* 4) Open the file. + + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4372,11 +4371,11 @@ cache_image_smoke_check_4(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) - HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp, max_dset, pass); - + /* 5) Create a dataset in the file. */ if ( pass ) { @@ -4395,11 +4394,11 @@ cache_image_smoke_check_4(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) - HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 1, max_dset, pass); - + /* 6) Close the file. */ if ( pass ) { @@ -4412,27 +4411,27 @@ cache_image_smoke_check_4(void) } } - if ( show_progress ) - HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 2, max_dset, pass); } /* end while */ cp += 3; - - - /* 7) Open the file. + + + /* 7) Open the file. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4440,13 +4439,13 @@ cache_image_smoke_check_4(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close all datasets. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4467,7 +4466,7 @@ cache_image_smoke_check_4(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4481,22 +4480,22 @@ cache_image_smoke_check_4(void) failure_mssg = "H5Fclose() failed.\n"; } } - - - /* 10) Open the file. + + + /* 10) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4504,13 +4503,13 @@ cache_image_smoke_check_4(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 11) Open and close all datasets. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ @@ -4531,7 +4530,7 @@ cache_image_smoke_check_4(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4546,7 +4545,7 @@ cache_image_smoke_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 13) Delete the file */ @@ -4569,79 +4568,79 @@ cache_image_smoke_check_4(void) return !pass; } /* cache_image_smoke_check_4() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_5() * - * Purpose: This test attempts to mimic the typical "poor man's - * parallel use case in which the file is passed between - * processes, each of which open the file, write some data, - * close the file, and then pass control on to the next - * process. + * Purpose: This test attempts to mimic the typical "poor man's + * parallel use case in which the file is passed between + * processes, each of which open the file, write some data, + * close the file, and then pass control on to the next + * process. + * + * In this case, we create one group for each process, and + * populate it with a "zoo" of HDF5 objects selected to + * (ideally) exercise all HDF5 on disk data structures. * - * In this case, we create one group for each process, and - * populate it with a "zoo" of HDF5 objects selected to - * (ideally) exercise all HDF5 on disk data structures. + * Cycle of operation * - * Cycle of operation + * 1) Create a HDF5 file with the cache image FAPL entry. * - * 1) Create a HDF5 file with the cache image FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Set all cache image flags, forcing full functionality. * - * Set all cache image flags, forcing full functionality. + * 2) Create a process specific group. * - * 2) Create a process specific group. + * 3) Construct a "zoo" in the above group, and validate it. * - * 3) Construct a "zoo" in the above group, and validate it. + * 4) Close the file. * - * 4) Close the file. + * 5) Open the file with the cache image FAPL entry. * - * 5) Open the file with the cache image FAPL entry. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * 6) Validate the "zoo" created in the previous file open. * - * 6) Validate the "zoo" created in the previous file open. + * 7) Create a process specific group for this file open * - * 7) Create a process specific group for this file open + * 8) Construct a "zoo" in the above group, and validate it. * - * 8) Construct a "zoo" in the above group, and validate it. - * - * 9) Close the file. + * 9) Close the file. * - * If sufficient zoos have been created, continue to + * If sufficient zoos have been created, continue to * 10). Otherwise goto 5) * - * 10) Open the file R/O. + * 10) Open the file R/O. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 11) Validate all the zoos. + * 11) Validate all the zoos. * - * 12) Close the file. + * 12) Close the file. * - * 13) Open the file. + * 13) Open the file. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 14) Validate all the zoos. + * 14) Validate all the zoos. * - * 15) Close the file. + * 15) Close the file. * - * 16) Open the file. + * 16) Open the file. * - * Verify that the file doesn't contain a metadata cache - * image superblock extension message. + * Verify that the file doesn't contain a metadata cache + * image superblock extension message. * - * 17) Validate all the zoos. + * 17) Validate all the zoos. * - * 18) Close the file. + * 18) Close the file. * - * 19) Delete the file. + * 19) Delete the file. * * Return: void * @@ -4673,7 +4672,7 @@ cache_image_smoke_check_5(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4688,13 +4687,13 @@ cache_image_smoke_check_5(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -4705,8 +4704,8 @@ cache_image_smoke_check_5(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4714,7 +4713,7 @@ cache_image_smoke_check_5(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4723,22 +4722,22 @@ cache_image_smoke_check_5(void) HDsprintf(process_group_name, "/process_%d", min_group); - proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, + proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( proc_gid < 0 ) { - pass = FALSE; - failure_mssg = "H5Gcreate2() failed (1).\n"; + pass = FALSE; + failure_mssg = "H5Gcreate2() failed (1).\n"; } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 3) Construct a "zoo" in the above group, and validate it. */ - if ( pass ) + if ( pass ) create_zoo(file_id, process_group_name, min_group); #if H5C_COLLECT_CACHE_STATS @@ -4752,16 +4751,16 @@ cache_image_smoke_check_5(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Close the file. */ if ( pass ) { - if ( H5Gclose(proc_gid) < 0 ) { - + if ( H5Gclose(proc_gid) < 0 ) { + pass = FALSE; failure_mssg = "H5Gclose(proc_gid) failed. (1)"; } @@ -4777,26 +4776,26 @@ cache_image_smoke_check_5(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); while ( ( pass ) && ( max_group < MAX_NUM_GROUPS ) ) { - - /* 5) Open the file. + + /* 5) Open the file. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4804,13 +4803,13 @@ cache_image_smoke_check_5(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) - HDfprintf(stdout, "%s:L1 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L1 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp, max_group, pass); /* 6) Validate the "zoo" created in the previous file open. */ - if ( pass ) + if ( pass ) validate_zoo(file_id, process_group_name, max_group); #if H5C_COLLECT_CACHE_STATS @@ -4824,47 +4823,47 @@ cache_image_smoke_check_5(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) - HDfprintf(stdout, "%s:L2 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L2 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp + 1, max_group, pass); - /* 7) Create a process specific group for this file open */ + /* 7) Create a process specific group for this file open */ if ( pass ) { - max_group++; + max_group++; HDsprintf(process_group_name, "/process_%d", max_group); - proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, + proc_gid = H5Gcreate2(file_id, process_group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( proc_gid < 0 ) { - pass = FALSE; - failure_mssg = "H5Gcreate2() failed (2).\n"; + pass = FALSE; + failure_mssg = "H5Gcreate2() failed (2).\n"; } } - if ( show_progress ) - HDfprintf(stdout, "%s:L3 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L3 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp + 2, max_group, pass); - - /* 8) Construct a "zoo" in the above group, and validate it. */ - if ( pass ) + + /* 8) Construct a "zoo" in the above group, and validate it. */ + if ( pass ) create_zoo(file_id, process_group_name, max_group); - if ( show_progress ) - HDfprintf(stdout, "%s:L4 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L4 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp + 3, max_group, pass); - + /* 9) Close the file. */ if ( pass ) { - if ( H5Gclose(proc_gid) < 0 ) { - + if ( H5Gclose(proc_gid) < 0 ) { + pass = FALSE; failure_mssg = "H5Gclose(process_gid) failed. (2)"; } @@ -4880,24 +4879,24 @@ cache_image_smoke_check_5(void) } } - if ( show_progress ) - HDfprintf(stdout, "%s:L5 cp = %d, max_group = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L5 cp = %d, max_group = %d, pass = %d.\n", fcn_name, cp + 4, max_group, pass); } /* end while */ cp += 5; - - /* 10) Open the file read only. + + /* 10) Open the file read only. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if(pass) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4915,7 +4914,7 @@ cache_image_smoke_check_5(void) HDsprintf(process_group_name, "/process_%d", i); validate_zoo(file_id, process_group_name, i++); } - + #if H5C_COLLECT_CACHE_STATS if( pass) { if(cache_ptr->images_loaded == 0) { @@ -4936,20 +4935,20 @@ cache_image_smoke_check_5(void) } } - /* 13) Open the file R/W. + /* 13) Open the file R/W. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4957,7 +4956,7 @@ cache_image_smoke_check_5(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4968,7 +4967,7 @@ cache_image_smoke_check_5(void) HDsprintf(process_group_name, "/process_%d", i); validate_zoo(file_id, process_group_name, i++); } - + #if H5C_COLLECT_CACHE_STATS if ( pass ) { @@ -4981,7 +4980,7 @@ cache_image_smoke_check_5(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -4995,22 +4994,22 @@ cache_image_smoke_check_5(void) failure_mssg = "H5Fclose() failed.\n"; } } - - - /* 16) Open the file. + + + /* 16) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5018,13 +5017,13 @@ cache_image_smoke_check_5(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 17) Validate all the zoos. * - * Verify that the metadata cache image superblock + * Verify that the metadata cache image superblock * extension message has been deleted. */ i = min_group; @@ -5032,7 +5031,7 @@ cache_image_smoke_check_5(void) HDsprintf(process_group_name, "/process_%d", i); validate_zoo(file_id, process_group_name, i++); } - + #if H5C_COLLECT_CACHE_STATS if ( pass ) { @@ -5045,7 +5044,7 @@ cache_image_smoke_check_5(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5060,9 +5059,9 @@ cache_image_smoke_check_5(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 19) Delete the file */ @@ -5086,78 +5085,78 @@ cache_image_smoke_check_5(void) } /* cache_image_smoke_check_5() */ - + /*------------------------------------------------------------------------- * Function: cache_image_smoke_check_6() * * Purpose: As the free space manager metadata is now included in the - * cache image, a smoke check to verify generally correct - * behaviour of the persistent free space managers seems - * prudent. + * cache image, a smoke check to verify generally correct + * behaviour of the persistent free space managers seems + * prudent. * - * The basic idea of this test is to construct a long - * sequence of dataset creations and deletions, all separated - * by file open/close cycles with cache image enabled. If the - * perisistant free space managers are performing as expected, - * the size of the file should stabilize. + * The basic idea of this test is to construct a long + * sequence of dataset creations and deletions, all separated + * by file open/close cycles with cache image enabled. If the + * perisistant free space managers are performing as expected, + * the size of the file should stabilize. * - * To implement this, proceed as outlined in the cycle of - * operation below: + * To implement this, proceed as outlined in the cycle of + * operation below: * - * Cycle of operation + * Cycle of operation * - * 1) Create a HDF5 file with the cache image FAPL entry. + * 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image - * FAPL entry. + * Verify that the cache is informed of the cache image + * FAPL entry. * - * Set all cache image flags, forcing full functionality. + * Set all cache image flags, forcing full functionality. * - * 2) Create and write a dataset in the file. + * 2) Create and write a dataset in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file with the cache image FAPL entry. + * 4) Open the file with the cache image FAPL entry. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 5) Create and write a new dataset. + * 5) Create and write a new dataset. * - * 6) Verify and delete the old dataset. + * 6) Verify and delete the old dataset. * - * 7) Close the file. + * 7) Close the file. * - * If sufficient datasets have been created, and then - * deleteded continue to 8). Otherwise goto 4) + * If sufficient datasets have been created, and then + * deleteded continue to 8). Otherwise goto 4) * - * 8) Open the file. + * 8) Open the file. * - * Verify that the file contains a metadata cache - * image superblock extension message. + * Verify that the file contains a metadata cache + * image superblock extension message. * - * 9) Verify the last dataset created. + * 9) Verify the last dataset created. * - * 10) Close the file. + * 10) Close the file. * - * 11) Open the file. + * 11) Open the file. * - * 12) Verify and delete the last dataset. + * 12) Verify and delete the last dataset. * - * Verify that a metadata cache image is not loaded. + * Verify that a metadata cache image is not loaded. * - * 13) Close the file. + * 13) Close the file. * - * 14) Get the size of the file. Verify that it is less - * than 20 KB. Without deletions and persistent free - * space managers, size size is about 167 MB, so this - * is sufficient to verify that the persistent free - * space managers are more or less doing their job. + * 14) Get the size of the file. Verify that it is less + * than 20 KB. Without deletions and persistent free + * space managers, size size is about 167 MB, so this + * is sufficient to verify that the persistent free + * space managers are more or less doing their job. * * Note that in the absence of paged allocation, file * size gets below 1 KB. * - * 15) Delete the file. + * 15) Delete the file. * * Return: void * @@ -5185,7 +5184,7 @@ cache_image_smoke_check_6(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5200,13 +5199,13 @@ cache_image_smoke_check_6(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a HDF5 file with the cache image FAPL entry. + /* 1) Create a HDF5 file with the cache image FAPL entry. * - * Verify that the cache is informed of the cache image FAPL entry. + * Verify that the cache is informed of the cache image FAPL entry. * * Set flags forcing full function of the cache image feature. */ @@ -5217,8 +5216,8 @@ cache_image_smoke_check_6(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5226,10 +5225,10 @@ cache_image_smoke_check_6(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create a dataset in the file. */ if ( pass ) { @@ -5248,10 +5247,10 @@ cache_image_smoke_check_6(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -5264,26 +5263,26 @@ cache_image_smoke_check_6(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); while ( ( pass ) && ( max_dset < MAX_NUM_DSETS ) ) { - - /* 4) Open the file. + + /* 4) Open the file. * - * Verify that the metadata cache is instructed to load the + * Verify that the metadata cache is instructed to load the * metadata cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5291,11 +5290,11 @@ cache_image_smoke_check_6(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) - HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L1 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp, max_dset, pass); - + /* 5) Create a dataset in the file. */ if ( pass ) { @@ -5314,22 +5313,22 @@ cache_image_smoke_check_6(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) - HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L2 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 1, max_dset, pass); - /* 6) Verify and delete the old dataset. */ - if ( pass ) { + /* 6) Verify and delete the old dataset. */ + if ( pass ) { - delete_datasets(file_id, min_dset - 2, max_dset - 2); - } + delete_datasets(file_id, min_dset - 2, max_dset - 2); + } - if ( show_progress ) - HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L3 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 2, max_dset, pass); - + /* 7) Close the file. */ if ( pass ) { @@ -5342,27 +5341,27 @@ cache_image_smoke_check_6(void) } } - if ( show_progress ) - HDfprintf(stdout, "%s:L4 cp = %d, max_dset = %d, pass = %d.\n", + if ( show_progress ) + HDfprintf(stdout, "%s:L4 cp = %d, max_dset = %d, pass = %d.\n", fcn_name, cp + 3, max_dset, pass); } /* end while */ cp += 4; - - - /* 8) Open the file. + + + /* 8) Open the file. * - * Verify that the file contains a metadata cache image + * Verify that the file contains a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5370,10 +5369,10 @@ cache_image_smoke_check_6(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 9) Verify the last dataset created. */ if ( pass ) { @@ -5393,7 +5392,7 @@ cache_image_smoke_check_6(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5407,22 +5406,22 @@ cache_image_smoke_check_6(void) failure_mssg = "H5Fclose() failed.\n"; } } - - - /* 11) Open the file. + + + /* 11) Open the file. * - * Verify that the file doesn't contain a metadata cache image + * Verify that the file doesn't contain a metadata cache image * superblock extension message. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5430,13 +5429,13 @@ cache_image_smoke_check_6(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 12) Verify and delete the last dataset. * - * Verify that a metadata cache image is not loaded. + * Verify that a metadata cache image is not loaded. */ if ( pass ) { @@ -5455,7 +5454,7 @@ cache_image_smoke_check_6(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - + /* 13) Close the file. */ @@ -5468,7 +5467,7 @@ cache_image_smoke_check_6(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5479,7 +5478,7 @@ cache_image_smoke_check_6(void) * space managers are more or less doing their job. * * Note that in the absence of paged allocation, file - * size gets below 1 KB, but since this test is run both + * size gets below 1 KB, but since this test is run both * with and without paged allocation, we must leave some * extra space for the paged allocation case. */ @@ -5493,9 +5492,9 @@ cache_image_smoke_check_6(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 15) Delete the file */ if ( pass ) { @@ -5518,56 +5517,56 @@ cache_image_smoke_check_6(void) } /* cache_image_smoke_check_6() */ - + /*------------------------------------------------------------------------- * Function: cache_image_api_error_check_1() * * Purpose: This test is one of a sequence of tests intended - * to verify correct management of API errors. + * to verify correct management of API errors. * - * The object of this test is to verify that a file without - * a pre-existing cache image that is opened both read only - * and with a cache image requested is handle correctly - * (the cache image request should be ignored silently). + * The object of this test is to verify that a file without + * a pre-existing cache image that is opened both read only + * and with a cache image requested is handle correctly + * (the cache image request should be ignored silently). * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file. + * 1) Create a HDF5 file. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file read only with a cache image FAPL entry - * requested. + * 4) Open the file read only with a cache image FAPL entry + * requested. * - * 5) Open a dataset. + * 5) Open a dataset. * - * Verify that it contains the expected data + * Verify that it contains the expected data * - * Verify that the cache image was not loaded. + * Verify that the cache image was not loaded. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file read only. + * 7) Open the file read only. * - * 8) Open a dataset. + * 8) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * Verify that the cache image was not loaded. + * Verify that the cache image was not loaded. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file read write. + * 10) Open the file read write. * - * 11) Open a dataset. + * 11) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * 12) Close the file. + * 12) Close the file. * - * 13) Delete the file. + * 13) Delete the file. * * Return: void * @@ -5592,7 +5591,7 @@ cache_image_api_error_check_1(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5607,7 +5606,7 @@ cache_image_api_error_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5619,8 +5618,8 @@ cache_image_api_error_check_1(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5628,10 +5627,10 @@ cache_image_api_error_check_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -5652,10 +5651,10 @@ cache_image_api_error_check_1(void) - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -5668,20 +5667,20 @@ cache_image_api_error_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Open the file read only with a cache image FAPL entry requested. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ TRUE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5689,10 +5688,10 @@ cache_image_api_error_check_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * * Verify that it contains the expected data. @@ -5716,9 +5715,9 @@ cache_image_api_error_check_1(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -5731,20 +5730,20 @@ cache_image_api_error_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 7) Open the file read only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5752,10 +5751,10 @@ cache_image_api_error_check_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close a dataset. * * Verify that it contains the expected data. @@ -5780,7 +5779,7 @@ cache_image_api_error_check_1(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5795,20 +5794,20 @@ cache_image_api_error_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Open the file read / write. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5816,9 +5815,9 @@ cache_image_api_error_check_1(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Open and close a dataset. * * Verify that it contains the expected data. @@ -5842,9 +5841,9 @@ cache_image_api_error_check_1(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Close the file. */ @@ -5857,9 +5856,9 @@ cache_image_api_error_check_1(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Delete the file */ @@ -5882,68 +5881,68 @@ cache_image_api_error_check_1(void) } /* cache_image_api_error_check_1() */ - + /*------------------------------------------------------------------------- * Function: cache_image_api_error_check_2() * * Purpose: This test is one of a sequence of tests intended - * to verify correct management of API errors. + * to verify correct management of API errors. * - * The object of this test is to verify that a file with - * a pre-existing cache image that is opened both read only - * and with a cache image requested is handled correctly - * (the cache image request should be ignored silently). + * The object of this test is to verify that a file with + * a pre-existing cache image that is opened both read only + * and with a cache image requested is handled correctly + * (the cache image request should be ignored silently). * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file with a cache image requested.. + * 1) Create a HDF5 file with a cache image requested.. * - * 2) Create some datasets in the file. + * 2) Create some datasets in the file. * - * 3) Close the file. + * 3) Close the file. * - * 4) Open the file read only with a cache image FAPL entry - * requested. + * 4) Open the file read only with a cache image FAPL entry + * requested. * - * 5) Open a dataset. + * 5) Open a dataset. * - * Verify that it contains the expected data + * Verify that it contains the expected data * - * Verify that the cache image was loaded. + * Verify that the cache image was loaded. * - * 6) Close the file. + * 6) Close the file. * - * 7) Open the file read only. + * 7) Open the file read only. * - * 8) Open a dataset. + * 8) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * Verify that the cache image was loaded. + * Verify that the cache image was loaded. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file read write. + * 10) Open the file read write. * - * 11) Open a dataset. + * 11) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * Verify that the cache image was loaded. + * Verify that the cache image was loaded. * - * 12) Close the file. + * 12) Close the file. * - * 13) Open the file read write. + * 13) Open the file read write. * - * 14) Open a dataset. + * 14) Open a dataset. * - * Verify that it contains the expected data. + * Verify that it contains the expected data. * - * Verify that the cache image was NOT loaded. + * Verify that the cache image was NOT loaded. * - * 15) Close the file. + * 15) Close the file. * - * 16) Delete the file. + * 16) Delete the file. * * Return: void * @@ -5968,7 +5967,7 @@ cache_image_api_error_check_2(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5983,7 +5982,7 @@ cache_image_api_error_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -5995,8 +5994,8 @@ cache_image_api_error_check_2(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6004,10 +6003,10 @@ cache_image_api_error_check_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Create some datasets in the file. */ if ( pass ) { @@ -6028,10 +6027,10 @@ cache_image_api_error_check_2(void) - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 3) Close the file. */ if ( pass ) { @@ -6044,20 +6043,20 @@ cache_image_api_error_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Open the file read only with a cache image FAPL entry requested. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6065,10 +6064,10 @@ cache_image_api_error_check_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open and close a dataset. * * Verify that it contains the expected data. @@ -6092,9 +6091,9 @@ cache_image_api_error_check_2(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Close the file. */ @@ -6107,20 +6106,20 @@ cache_image_api_error_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 7) Open the file read only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -6128,10 +6127,10 @@ cache_image_api_error_check_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 8) Open and close a dataset. * * Verify that it contains the expected data. @@ -6156,7 +6155,7 @@ cache_image_api_error_check_2(void) #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6171,20 +6170,20 @@ cache_image_api_error_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Open the file read / write. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ TRUE, + /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6192,9 +6191,9 @@ cache_image_api_error_check_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Open and close a dataset. * * Verify that it contains the expected data. @@ -6218,9 +6217,9 @@ cache_image_api_error_check_2(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Close the file. */ @@ -6233,7 +6232,7 @@ cache_image_api_error_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6242,11 +6241,11 @@ cache_image_api_error_check_2(void) if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6254,9 +6253,9 @@ cache_image_api_error_check_2(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Open and close a dataset. * * Verify that it contains the expected data. @@ -6280,9 +6279,9 @@ cache_image_api_error_check_2(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 15) Close the file. */ @@ -6295,9 +6294,9 @@ cache_image_api_error_check_2(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Delete the file */ @@ -6320,36 +6319,36 @@ cache_image_api_error_check_2(void) } /* cache_image_api_error_check_2() */ - + /*------------------------------------------------------------------------- * Function: cache_image_api_error_check_3() * * Purpose: This test is one of a sequence of tests intended - * to verify correct management of API errors. + * to verify correct management of API errors. * - * At present, SWMR and cache image may not be active - * at the same time. The purpose of this test is to - * verify that attempts to run SWMR and cache image - * at the same time will fail. + * At present, SWMR and cache image may not be active + * at the same time. The purpose of this test is to + * verify that attempts to run SWMR and cache image + * at the same time will fail. * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file with a cache image requested.. + * 1) Create a HDF5 file with a cache image requested.. * - * 2) Try to start SWMR write -- should fail. + * 2) Try to start SWMR write -- should fail. * * 3) Discard the file if necessary * - * 4) Attempt to create a HDF5 file with SWMR write - * access and cache image requested -- should fail. + * 4) Attempt to create a HDF5 file with SWMR write + * access and cache image requested -- should fail. * * 5) Discard the file if necessary * * 6) Create a HDF5 file with a cache image requested. * - * 7) Create some datasets in the file. + * 7) Create some datasets in the file. * - * 8) Close the file. + * 8) Close the file. * * 9) Attempt to open the file with SWMR write access -- * should fail. @@ -6379,7 +6378,7 @@ cache_image_api_error_check_3(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6394,7 +6393,7 @@ cache_image_api_error_check_3(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6406,8 +6405,8 @@ cache_image_api_error_check_3(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6415,9 +6414,9 @@ cache_image_api_error_check_3(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 2) Try to start SWMR write -- should fail. */ @@ -6432,9 +6431,9 @@ cache_image_api_error_check_3(void) } H5E_END_TRY; } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Discard the file if necessary */ @@ -6454,19 +6453,19 @@ cache_image_api_error_check_3(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 4) Attempt to create a HDF5 file with SWMR write + + /* 4) Attempt to create a HDF5 file with SWMR write * access and cache image requested -- should fail. */ - + attempt_swmr_open_hdf5_file(/* create_file */ TRUE, - /* set_mdci_fapl */ TRUE, + /* set_mdci_fapl */ TRUE, /* hdf_file_name */ filename); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6474,16 +6473,16 @@ cache_image_api_error_check_3(void) if ( pass ) { - /* file probably doesn't exist, so don't + /* file probably doesn't exist, so don't * error check the remove call. */ HDremove(filename); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Create a HDF5 file with a cache image requested. */ if ( pass ) { @@ -6492,8 +6491,8 @@ cache_image_api_error_check_3(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6501,10 +6500,10 @@ cache_image_api_error_check_3(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Create some datasets in the file. */ if ( pass ) { @@ -6523,9 +6522,9 @@ cache_image_api_error_check_3(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 8) Close the file. */ @@ -6539,20 +6538,20 @@ cache_image_api_error_check_3(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 9) Attempt to open the file with SWMR write access -- should fail. */ - + attempt_swmr_open_hdf5_file(/* create_file */ FALSE, - /* set_mdci_fapl */ TRUE, + /* set_mdci_fapl */ TRUE, /* hdf_file_name */ filename); - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Discard the file if necessary. */ if ( pass ) { @@ -6564,7 +6563,7 @@ cache_image_api_error_check_3(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6578,67 +6577,67 @@ cache_image_api_error_check_3(void) } /* cache_image_api_error_check_3() */ - + /*------------------------------------------------------------------------- * Function: cache_image_api_error_check_4() * * Purpose: This test is one of a sequence of tests intended - * to verify correct management of API errors. + * to verify correct management of API errors. * - * The object of this test is to verify that a request for - * a cache image when a version 2 superblock is not available/ - * not requested is handled correctly. - * (the cache image request should be ignored silently). + * The object of this test is to verify that a request for + * a cache image when a version 2 superblock is not available/ + * not requested is handled correctly. + * (the cache image request should be ignored silently). * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a FAPL requesting a cache image, but WITHOUT - * specifying the latest file format. + * 1) Create a FAPL requesting a cache image, but WITHOUT + * specifying the latest file format. * - * 2) Create a HDF5 file using the above FAPL. + * 2) Create a HDF5 file using the above FAPL. * - * 3) Create some datasets in the file. + * 3) Create some datasets in the file. * - * 4) Close the file. + * 4) Close the file. * - * 5) Open the file read only. Verify that the file doesn't - * contain a cache image. + * 5) Open the file read only. Verify that the file doesn't + * contain a cache image. * - * 6) Verify that the datasets exist and contain the - * expected data + * 6) Verify that the datasets exist and contain the + * expected data * - * Verify that the cache image was not loaded. + * Verify that the cache image was not loaded. * - * 7) Close the file. + * 7) Close the file. * - * 8) Open the file R/W using the FAPL defined in 1) above. - * Verify that the file does not contain a cache image. + * 8) Open the file R/W using the FAPL defined in 1) above. + * Verify that the file does not contain a cache image. * - * 9) Close the file. + * 9) Close the file. * - * 10) Open the file R/W using the FAPL defined in 1) above. - * Verify that the file does not contain a cache image. + * 10) Open the file R/W using the FAPL defined in 1) above. + * Verify that the file does not contain a cache image. * - * 11) Verify that the data sets contain the expected data + * 11) Verify that the data sets contain the expected data * - * Verify that a cache image was not loaded. + * Verify that a cache image was not loaded. * - * 12) Create several more data sets. + * 12) Create several more data sets. * - * 13) Close the file. + * 13) Close the file. * - * 14) Open the file read write. - * - * Verify that the file does not contain a cache image. + * 14) Open the file read write. * - * 15) Verify the data sets exist and contain the expected - * data. + * Verify that the file does not contain a cache image. * - * Verify that a cache image was not loaded. + * 15) Verify the data sets exist and contain the expected + * data. * - * 16) Close the file. + * Verify that a cache image was not loaded. * - * 17) Delete the file. + * 16) Close the file. + * + * 17) Delete the file. * * Return: void * @@ -6665,7 +6664,7 @@ cache_image_api_error_check_4(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6680,11 +6679,11 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 1) Create a FAPL requesting a cache image, but WITHOUT - * specifying the latest file format. + /* 1) Create a FAPL requesting a cache image, but WITHOUT + * specifying the latest file format. */ if ( pass ) { @@ -6697,7 +6696,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -6715,7 +6714,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6743,7 +6742,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get a pointer to the files internal data structure and then @@ -6762,10 +6761,10 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Create some datasets in the file. */ if ( pass ) { @@ -6786,10 +6785,10 @@ cache_image_api_error_check_4(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 4) Close the file. */ if ( pass ) { @@ -6802,20 +6801,20 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 5) Open the file read only. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6823,11 +6822,11 @@ cache_image_api_error_check_4(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 6) Verify that the datasets exist and contain the + + + /* 6) Verify that the datasets exist and contain the * expected data */ @@ -6847,9 +6846,9 @@ cache_image_api_error_check_4(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Close the file. */ @@ -6862,11 +6861,11 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - - /* 8) Open the file R/W using the FAPL defined in 1) above. + + + /* 8) Open the file R/W using the FAPL defined in 1) above. * * Verify that the file does not contain a cache image. */ @@ -6893,7 +6892,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get a pointer to the files internal data structure and then @@ -6912,7 +6911,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -6925,7 +6924,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -6940,9 +6939,9 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Open the file R/W using the FAPL defined in 1) above. @@ -6971,7 +6970,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* get a pointer to the files internal data structure and then @@ -6990,7 +6989,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7003,7 +7002,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7028,7 +7027,7 @@ cache_image_api_error_check_4(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7039,7 +7038,7 @@ cache_image_api_error_check_4(void) create_datasets(file_id, 6, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7054,23 +7053,23 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Open the file read write. - * + * * Verify that the file does not contain a cache image. */ if ( pass ) { open_hdf5_file(/* create_file */ FALSE, - /* mdci_sbem_expected */ FALSE, + /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7078,10 +7077,10 @@ cache_image_api_error_check_4(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - + + /* 15) Verify the data sets exist and contain the expected data. * * Verify that a cache image was not loaded. @@ -7103,7 +7102,7 @@ cache_image_api_error_check_4(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7118,9 +7117,9 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 17) Delete the file */ @@ -7133,7 +7132,7 @@ cache_image_api_error_check_4(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7152,36 +7151,36 @@ cache_image_api_error_check_4(void) } /* cache_image_api_error_check_4() */ - + /*------------------------------------------------------------------------- * Function: get_free_sections_test() * * Purpose: It is possible that H5Fget_free_sections() to be - * called before any activity on the metadata cache. - * This is a potential problem, as satisfying the - * H5Fget_free_sections() call requires access to all - * free space managers. When persistent free space + * called before any activity on the metadata cache. + * This is a potential problem, as satisfying the + * H5Fget_free_sections() call requires access to all + * free space managers. When persistent free space * managers are enabled, this will require calling - * H5MF_tidy_self_referential_fsm_hack(). This is a + * H5MF_tidy_self_referential_fsm_hack(). This is a * non issue in the absence of a cache image. However, - * this is a problem if a cache image exists, as - * the call to H5MF_tidy_self_referential_fsm_hack() - * will free the file space allocated to the cache - * image. - * - * The objective of this test is to create a test file - * with both non-empty self referential presistant - * free space managers, and a cache image, and then - * verify that this situation is handled correctly if + * this is a problem if a cache image exists, as + * the call to H5MF_tidy_self_referential_fsm_hack() + * will free the file space allocated to the cache + * image. + * + * The objective of this test is to create a test file + * with both non-empty self referential presistant + * free space managers, and a cache image, and then + * verify that this situation is handled correctly if * H5Fget_free_sections() is called before the metadata * cache image is loaded. * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file with a cache image requested - * and persistent free space managers enabled. + * 1) Create a HDF5 file with a cache image requested + * and persistent free space managers enabled. * - * 2) Create some data sets, and then delete some of + * 2) Create some data sets, and then delete some of * of those near the beginning of the file. * * 3) Close the file. @@ -7192,12 +7191,12 @@ cache_image_api_error_check_4(void) * been loaded. * * 6) Verify that one or more self referential FSMs - * have been stored at the end of the file just + * have been stored at the end of the file just * before the cache image. * * 7) Call H5Fget_free_sections(). * - * 8) Verify that the cache image has been loaded and + * 8) Verify that the cache image has been loaded and * that the self referential FSMs have been floated. * * 9) Verify that the remaining data sets contain the @@ -7211,12 +7210,12 @@ cache_image_api_error_check_4(void) * been loaded. * * 13) Verify that one or more self referential FSMs - * have been stored at the end of the file just + * have been stored at the end of the file just * before the cache image. * * 14) Call H5Fget_free_sections(). * - * 15) Verify that the cache image has been loaded and + * 15) Verify that the cache image has been loaded and * that the self referential FSMs have been floated. * * 16) Verify that the remaining data sets contain the @@ -7224,7 +7223,7 @@ cache_image_api_error_check_4(void) * * 17) Delete the remaining data sets. * - * 18) Close the file. + * 18) Close the file. * * 19) Verify that file space has been reclaimed. * @@ -7253,7 +7252,7 @@ get_free_sections_test(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7268,12 +7267,12 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 1) Create a HDF5 file with a cache image requested - * and persistent free space managers enabled. + * and persistent free space managers enabled. */ if ( pass ) { @@ -7282,8 +7281,8 @@ get_free_sections_test(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7291,11 +7290,11 @@ get_free_sections_test(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 2) Create some data sets, and then delete some of + /* 2) Create some data sets, and then delete some of * of those near the beginning of the file. */ @@ -7304,7 +7303,7 @@ get_free_sections_test(void) create_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7312,7 +7311,7 @@ get_free_sections_test(void) verify_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7320,10 +7319,10 @@ get_free_sections_test(void) delete_datasets(file_id, 1, 5); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Close the file. */ if ( pass ) { @@ -7336,10 +7335,10 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 4) Open the file read only. */ if ( pass ) { @@ -7348,8 +7347,8 @@ get_free_sections_test(void) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7357,10 +7356,10 @@ get_free_sections_test(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 5) Verify that a cache image exists, and has not been loaded. */ if ( pass ) { @@ -7373,18 +7372,18 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Verify that one or more self referential FSMs - * have been stored at the end of the file just + * have been stored at the end of the file just * before the cache image. */ if ( pass ) { - /* file_ptr->shared->first_alloc_dealloc is set to FALSE if the + /* file_ptr->shared->first_alloc_dealloc is set to FALSE if the * file is opened R/O. */ if ( ( file_ptr->shared->first_alloc_dealloc ) || @@ -7398,15 +7397,15 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Call H5Fget_free_sections(). */ if ( pass ) { - if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL) + if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL) < 0 ){ pass = FALSE; @@ -7414,11 +7413,11 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 8) Verify that the cache image has been loaded and + + /* 8) Verify that the cache image has been loaded and * that the self referential FSMs have been floated. */ if ( pass ) { @@ -7435,7 +7434,7 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7446,10 +7445,10 @@ get_free_sections_test(void) verify_datasets(file_id, 6, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 10) Close the file. */ if ( pass ) { @@ -7461,10 +7460,10 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Open the file R/W. */ if ( pass ) { @@ -7473,8 +7472,8 @@ get_free_sections_test(void) /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7482,10 +7481,10 @@ get_free_sections_test(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 12) Verify that a cache image exists, and has not been loaded. */ if ( pass ) { @@ -7498,12 +7497,12 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 13) Verify that one or more self referential FSMs - * have been stored at the end of the file just + * have been stored at the end of the file just * before the cache image. */ if ( pass ) { @@ -7519,15 +7518,15 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 14) Call H5Fget_free_sections(). */ if ( pass ) { - if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL) + if ( H5Fget_free_sections(file_id, H5FD_MEM_DEFAULT, (size_t)0, NULL) < 0 ){ pass = FALSE; @@ -7535,11 +7534,11 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* 15) Verify that the cache image has been loaded and + + /* 15) Verify that the cache image has been loaded and * that the self referential FSMs have been floated. */ if ( pass ) { @@ -7556,7 +7555,7 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7567,10 +7566,10 @@ get_free_sections_test(void) verify_datasets(file_id, 6, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 17) Delete the remaining data sets. */ if ( pass ) { @@ -7578,10 +7577,10 @@ get_free_sections_test(void) delete_datasets(file_id, 6, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 18) Close the file. */ if ( pass ) { @@ -7593,7 +7592,7 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7613,10 +7612,10 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 20) Discard the file. */ if ( pass ) { @@ -7628,7 +7627,7 @@ get_free_sections_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { PASSED(); } else { H5_FAILED(); } @@ -7641,40 +7640,40 @@ get_free_sections_test(void) } /* get_free_sections_test() */ - + /*------------------------------------------------------------------------- * Function: evict_on_close_test() * - * Purpose: If a file containing a cache image which in turn - * contains dirty entries is opened R/O, the metadata - * cache must refuse to evict the dirty entries, as + * Purpose: If a file containing a cache image which in turn + * contains dirty entries is opened R/O, the metadata + * cache must refuse to evict the dirty entries, as * it will not be able to reload them from file. This * is a bit tricky, as the dirty entries must marked as - * clean in the metadata cache so that the MDC will not + * clean in the metadata cache so that the MDC will not * attempt to flush then on file close. * - * The objective of this test is to verify that the + * The objective of this test is to verify that the * metadata will not evict dirty entries in the above * context when the file is opened with the evict on close * FAPL entry. * - * Do this by creating a HDF5 file with a cache image - * containing dirty metadata. + * Do this by creating a HDF5 file with a cache image + * containing dirty metadata. * - * Then close the file, re-open it R/O, and scan its + * Then close the file, re-open it R/O, and scan its * contents twice. If evict on close succeeds in evicting - * the dirty metadata, the second scan will fail, as valid + * the dirty metadata, the second scan will fail, as valid * versions of the dirty metadata will not be available. * - * To make the test more useful, enable persistent free + * To make the test more useful, enable persistent free * space managers. * - * The test is set up as follows: + * The test is set up as follows: * - * 1) Create a HDF5 file without a cache image requested - * and persistent free space managers enabled. + * 1) Create a HDF5 file without a cache image requested + * and persistent free space managers enabled. * - * 2) Create some data sets and verify them. + * 2) Create some data sets and verify them. * * 3) Close the file. * @@ -7733,7 +7732,7 @@ evict_on_close_test(void) pass = TRUE; - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7748,12 +7747,12 @@ evict_on_close_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); /* 1) Create a HDF5 file without a cache image requested - * and persistent free space managers enabled. + * and persistent free space managers enabled. */ if ( pass ) { @@ -7761,8 +7760,8 @@ evict_on_close_test(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ TRUE, - /* set_eoc */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7770,7 +7769,7 @@ evict_on_close_test(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7781,7 +7780,7 @@ evict_on_close_test(void) create_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7789,10 +7788,10 @@ evict_on_close_test(void) verify_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 3) Close the file. */ if ( pass ) { @@ -7805,10 +7804,10 @@ evict_on_close_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 4) Open the file R/W, and with cache image requested. */ if ( pass ) { @@ -7817,8 +7816,8 @@ evict_on_close_test(void) /* mdci_sbem_expected */ FALSE, /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, - /* config_fsm */ FALSE, - /* set_eoc */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7826,7 +7825,7 @@ evict_on_close_test(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7840,10 +7839,10 @@ evict_on_close_test(void) verify_datasets(file_id, 1, 10); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 6) Create some more datasets and verify them */ if ( pass ) { @@ -7851,7 +7850,7 @@ evict_on_close_test(void) create_datasets(file_id, 11, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7864,15 +7863,15 @@ evict_on_close_test(void) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDfprintf(stdout, "index size / index dirty size = %lld / %lld\n", + HDfprintf(stdout, "index size / index dirty size = %lld / %lld\n", (long long)(cache_ptr->index_size), (long long)(cache_ptr->dirty_index_size)); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 7) Close the file. */ if ( pass ) { @@ -7884,10 +7883,10 @@ evict_on_close_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 8) Open the file R/O and with evict on close enabled. */ if ( pass ) { @@ -7896,8 +7895,8 @@ evict_on_close_test(void) /* mdci_sbem_expected */ TRUE, /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ TRUE, + /* config_fsm */ FALSE, + /* set_eoc */ TRUE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7905,7 +7904,7 @@ evict_on_close_test(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7916,7 +7915,7 @@ evict_on_close_test(void) verify_datasets(file_id, 1, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7924,7 +7923,7 @@ evict_on_close_test(void) verify_datasets(file_id, 1, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7939,10 +7938,10 @@ evict_on_close_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + /* 11) Open the file R/w and with evict on close enabled. */ if ( pass ) { @@ -7951,8 +7950,8 @@ evict_on_close_test(void) /* mdci_sbem_expected */ TRUE, /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, - /* config_fsm */ FALSE, - /* set_eoc */ TRUE, + /* config_fsm */ FALSE, + /* set_eoc */ TRUE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7960,7 +7959,7 @@ evict_on_close_test(void) /* cache_ptr_ptr */ &cache_ptr); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7971,7 +7970,7 @@ evict_on_close_test(void) verify_datasets(file_id, 1, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { @@ -7979,7 +7978,7 @@ evict_on_close_test(void) verify_datasets(file_id, 1, 20); } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -7994,7 +7993,7 @@ evict_on_close_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -8009,7 +8008,7 @@ evict_on_close_test(void) } } - if ( show_progress ) + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); if ( pass ) { PASSED(); } else { H5_FAILED(); } @@ -8023,7 +8022,7 @@ evict_on_close_test(void) } /* evict_on_close_test() */ - + /*------------------------------------------------------------------------- * Function: main * diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 6c65280..77554fd 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -15,7 +15,7 @@ * * This file contains tests for metadata tagging. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" @@ -29,16 +29,16 @@ /* Test Defines */ /* ============ */ -#define FILENAME "tagging_test.h5" -#define FILENAME2 "tagging_ext_test.h5" -#define GROUPNAME "Group" +#define FILENAME "tagging_test.h5" +#define FILENAME2 "tagging_ext_test.h5" +#define GROUPNAME "Group" #define GROUPNAMEPATH "/Group" #define GROUPNAMECOPY "GroupCopy" -#define ATTRNAME "Attribute 1" -#define ATTRNAME3 "Attribute 3" -#define DATASETNAME "Dataset" -#define DATASETNAME2 "Dataset2" -#define LINKNAME "Link" +#define ATTRNAME "Attribute 1" +#define ATTRNAME3 "Attribute 3" +#define DATASETNAME "Dataset" +#define DATASETNAME2 "Dataset2" +#define LINKNAME "Link" #define RANK 2 #define DIMS 32 @@ -47,7 +47,7 @@ #define TEST_DEFAULT 0 #define TEST_SHMESG 1 #define NUM_TEST_TYPES 2 - + /* ===================== */ /* Function Declarations */ /* ===================== */ @@ -98,7 +98,7 @@ static unsigned check_invalid_tag_application(void); #ifndef NDEBUG - + /*------------------------------------------------------------------------- * Function: dump_cache() * @@ -127,19 +127,19 @@ static int dump_cache(hid_t fid) TEST_ERROR; return 0; - + error: return -1; } /* dump_cache */ #endif /* NDEBUG */ /* end debugging functions */ - + /*------------------------------------------------------------------------- * Function: verify_no_unknown_tags() * * Purpose: Verifies that all tags in the provided cache have the - * 'dirtied' flag set. Other verification functions in this - * test file set this flag after checking them, so + * 'dirtied' flag set. Other verification functions in this + * test file set this flag after checking them, so * this is handy to verify that tests have checked all entries * in the cache. * @@ -181,7 +181,7 @@ error: return -1; } /* verify_no_unknown_tags */ - + /*------------------------------------------------------------------------- * Function: mark_all_entries_investigated() * @@ -229,7 +229,7 @@ error: return -1; } /* mark_all_entries_investigated */ - + /*------------------------------------------------------------------------- * Function: reset_all_entries_investigated() * @@ -275,15 +275,15 @@ error: return -1; } /* reset_all_entries_investigated */ - + /*------------------------------------------------------------------------- * Function: verify_tag() * * Purpose: Asserts that there is an entry in the specified cache with * the provided entry id and provided tag. The function will - * fail if this is not the case. If found, this function will - * set the entry's flush_marker flag, so future verification - * attempts can skip over this entry, knowing it has already been + * fail if this is not the case. If found, this function will + * set the entry's flush_marker flag, so future verification + * attempts can skip over this entry, knowing it has already been * checked. * * Return: 0 on Success, -1 on Failure @@ -327,7 +327,7 @@ verify_tag(hid_t fid, int id, haddr_t tag) /* Didn't find the tagged entry, throw an error */ TEST_ERROR; - + done: return 0; @@ -358,7 +358,7 @@ error: return -1; } /* evict entries */ - + /*------------------------------------------------------------------------- * Function: get_object_header_tag() * @@ -389,7 +389,7 @@ error: return -1; } /* get_object_header_tag */ - + /*------------------------------------------------------------------------- * Function: get_sbe_tag() * @@ -420,7 +420,7 @@ error: /* Test Functions */ /* ============== */ - + /*------------------------------------------------------------------------- * Function: check_file_creation_tags * @@ -434,7 +434,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_file_creation_tags(hid_t fcpl_id, int type) { /* Variable Declarations */ @@ -501,7 +501,7 @@ error: return 1; } /* check_file_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_file_open_tags * @@ -515,7 +515,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_file_open_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -539,12 +539,12 @@ check_file_open_tags(hid_t fcpl, int type) /* Retrieve various tags */ if ( type == TEST_SHMESG ) { - + /* determine tag value of superblock extension object header */ if ( get_sbe_tag(fid, &sbe_tag) < 0 ) TEST_ERROR; } /* end if */ - + /* Close the file */ if ( H5Fclose(fid) < 0 ) TEST_ERROR; @@ -607,7 +607,7 @@ error: return 1; } /* check_file_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_group_creation_tags * @@ -621,7 +621,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_group_creation_tags(void) { /* Variable Declarations */ @@ -633,7 +633,7 @@ check_group_creation_tags(void) /* Testing Macro */ TESTING("tag application during group creation"); - + /* ===== */ /* Setup */ /* ===== */ @@ -665,7 +665,7 @@ check_group_creation_tags(void) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify root group's tagged metadata */ if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR; if ( verify_tag(fid, H5AC_SNODE_ID, root_tag) < 0 ) TEST_ERROR; @@ -702,7 +702,7 @@ error: return 1; } /* check_group_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_multi_group_creation_tags * @@ -716,7 +716,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_multi_group_creation_tags(void) { /* Variable Declarations */ @@ -829,7 +829,7 @@ error: return 1; } /* check_multi_group_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_link_iteration_tags * @@ -843,7 +843,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_link_iteration_tags(void) { /* Variable Declarations */ @@ -941,7 +941,7 @@ error: return 1; } /* check_link_iteration_tags */ - + /*------------------------------------------------------------------------- * Function: check_dense_attribute_tags * @@ -955,7 +955,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dense_attribute_tags(void) { /* Variable Declarations */ @@ -969,7 +969,7 @@ check_dense_attribute_tags(void) hid_t fapl = -1; /* File access property list */ haddr_t d_tag = 0; /* Dataset tag value */ haddr_t root_tag = 0; /* Root group tag value */ - char attrname[500]; /* Name of attribute */ + char attrname[500]; /* Name of attribute */ /* Testing Macro */ TESTING("tag application during dense attribute manipulation"); @@ -995,10 +995,10 @@ check_dense_attribute_tags(void) /* Create dataset */ if ( (did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; - + /* get dataset object header */ if ( get_object_header_tag(did, &d_tag) < 0 ) TEST_ERROR; - + /* Clear Metadata Tags (don't care about them for this test */ mark_all_entries_investigated(fid); @@ -1124,7 +1124,7 @@ error: return 1; } /* check_dense_attribute_tags */ - + /*------------------------------------------------------------------------- * Function: check_group_open_tags * @@ -1138,7 +1138,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_group_open_tags(void) { /* Variable Declarations */ @@ -1150,7 +1150,7 @@ check_group_open_tags(void) /* Testing Macro */ TESTING("tag application during group open"); - + /* ===== */ /* Setup */ /* ===== */ @@ -1225,7 +1225,7 @@ error: return 1; } /* check_group_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_creation_tags * @@ -1239,7 +1239,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_creation_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -1312,7 +1312,7 @@ check_attribute_creation_tags(hid_t fcpl, int type) /* verify shared message index tagged with sohm */ if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - + /* verify fractal heap header belonging to group */ if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; @@ -1331,7 +1331,7 @@ check_attribute_creation_tags(hid_t fcpl, int type) /* verify no other entries present */ if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR; - + /* Reset the changes we've made to the cache's data structures */ if(reset_all_entries_investigated(fid) < 0) TEST_ERROR; @@ -1354,7 +1354,7 @@ error: return 1; } /* check_attribute_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_open_tags * @@ -1368,7 +1368,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_open_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -1439,7 +1439,7 @@ check_attribute_open_tags(hid_t fcpl, int type) /* verify object header chunk belonging to group */ if ( verify_tag(fid, H5AC_OHDR_CHK_ID, g_tag) < 0 ) TEST_ERROR; - + if ( type == TEST_SHMESG ) { /* verify (another) object header chunk belonging to group */ @@ -1485,7 +1485,7 @@ error: return 1; } /* check_attribute_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_rename_tags * @@ -1499,7 +1499,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_rename_tags(hid_t fcpl, int type) { /* Variable declarations */ @@ -1547,7 +1547,7 @@ check_attribute_rename_tags(hid_t fcpl, int type) /* Create attribute */ if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; - + /* fill out data buffer */ for(i = 0; i < DIMS; i++) for(j = 0; j < DIMS; j++) @@ -1613,11 +1613,11 @@ check_attribute_rename_tags(hid_t fcpl, int type) /* verify shared header message stored as a list */ if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - /* - * 3 calls to verify_tag() for verifying free space: - * one freespace header tag for H5FD_MEM_DRAW manager, - * one freespace header tag for H5FD_MEM_SUPER manager - * one freespace section info tag for H5FD_MEM_SUPER manager + /* + * 3 calls to verify_tag() for verifying free space: + * one freespace header tag for H5FD_MEM_DRAW manager, + * one freespace header tag for H5FD_MEM_SUPER manager + * one freespace section info tag for H5FD_MEM_SUPER manager */ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR; @@ -1664,7 +1664,7 @@ error: return 1; } /* check_attribute_rename_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_delete_tags * @@ -1678,7 +1678,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_delete_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -1726,7 +1726,7 @@ check_attribute_delete_tags(hid_t fcpl, int type) /* Create attribute */ if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; - + /* fill out data buffer */ for(i = 0;i < DIMS; i++) for(j = 0;j < DIMS; j++) @@ -1764,30 +1764,30 @@ check_attribute_delete_tags(hid_t fcpl, int type) /* verify object header belonging to group */ if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR; - + if ( type == TEST_SHMESG ) { /* verify shared header message master table */ if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - /* - * 2 calls to verify_tag() for verifying free space: + /* + * 2 calls to verify_tag() for verifying free space: * one freespace header tag for free-space header, * one freespace header tag for free-space section info */ - if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) + if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR; - if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 ) + if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR; #if 0 - /* If the free space managers are persistent, the + /* If the free space managers are persistent, the * H5MF_tidy_self_referential_fsm_hack() must have been run. - * Since this function floats all self referential free space - * managers, the H5FD_MEM_SUPER FSM will not be in the metadata + * Since this function floats all self referential free space + * managers, the H5FD_MEM_SUPER FSM will not be in the metadata * cache. */ - if ( ( ! persistent_fsms ) && + if ( ( ! persistent_fsms ) && ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) ) TEST_ERROR; #endif @@ -1822,7 +1822,7 @@ error: return 1; } /* check_attribute_delete_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_creation_tags * @@ -1836,7 +1836,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_creation_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -1874,10 +1874,10 @@ check_dataset_creation_tags(hid_t fcpl, int type) /* ============================ */ /* Create Dataset in Root Group */ /* ============================ */ - + /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -1919,7 +1919,7 @@ check_dataset_creation_tags(hid_t fcpl, int type) /* Verify dataset's tagged metadata */ if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - + /* Verify shared object header message tags */ if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; @@ -1949,7 +1949,7 @@ error: return 1; } /* check_dataset_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_creation_earlyalloc_tags * @@ -1963,7 +1963,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -2046,7 +2046,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) /* Verify dataset's tagged metadata */ if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; - + /* Verify shared object header message tags */ if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; @@ -2080,7 +2080,7 @@ error: return 1; } /* check_dataset_creation_earlyalloc_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_open_tags * @@ -2094,7 +2094,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_open_tags(void) { /* Variable Declarations */ @@ -2125,7 +2125,7 @@ check_dataset_open_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2155,7 +2155,7 @@ check_dataset_open_tags(void) /* ========================== */ /* Open Dataset in Root Group */ /* ========================== */ - + if (( did = H5Dopen2(fid, DATASETNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR; /* =================================== */ @@ -2200,7 +2200,7 @@ error: return 1; } /* check_dataset_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_write_tags * @@ -2214,7 +2214,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_write_tags(void) { /* Variable Declarations */ @@ -2250,7 +2250,7 @@ check_dataset_write_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2299,7 +2299,7 @@ check_dataset_write_tags(void) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify 10 b-tree nodes belonging to dataset */ for (i=0; i<10; i++) if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR; @@ -2335,7 +2335,7 @@ error: return 1; } /* check_dataset_write_tags */ - + /*------------------------------------------------------------------------- * Function: check_attribute_write_tags * @@ -2349,7 +2349,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_attribute_write_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -2424,7 +2424,7 @@ check_attribute_write_tags(hid_t fcpl, int type) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify object header of group */ if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR; @@ -2483,7 +2483,7 @@ error: return 1; } /* check_attribute_write_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_read_tags * @@ -2497,7 +2497,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_read_tags(void) { /* Variable Declarations */ @@ -2533,7 +2533,7 @@ check_dataset_read_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2581,7 +2581,7 @@ check_dataset_read_tags(void) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify 19 b-tree nodes belonging to dataset */ for (i=0; i<19; i++) if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR; @@ -2614,7 +2614,7 @@ error: return 1; } /* check_dataset_read_tags */ - + /*------------------------------------------------------------------------- * Function: check_dataset_size_retrieval * @@ -2628,7 +2628,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_size_retrieval(void) { /* Variable Declarations */ @@ -2665,7 +2665,7 @@ check_dataset_size_retrieval(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2746,7 +2746,7 @@ error: return 1; } /* check_dataset_size_retrieval */ - + /*------------------------------------------------------------------------- * Function: check_dataset_extend_tags * @@ -2760,7 +2760,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_dataset_extend_tags(void) { @@ -2798,7 +2798,7 @@ check_dataset_extend_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -2879,7 +2879,7 @@ error: return 1; } /* check_dataset_extend_tags */ - + /*------------------------------------------------------------------------- * Function: check_object_info_tags * @@ -2893,7 +2893,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_object_info_tags(void) { /* Variable Declarations */ @@ -2902,7 +2902,7 @@ check_object_info_tags(void) int verbose = FALSE; /* verbose file output */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; - H5O_info_t oinfo; /* Object info struct */ + H5O_info_t oinfo; /* Object info struct */ /* Testing Macro */ TESTING("tag application during object info retrieval"); @@ -2982,7 +2982,7 @@ error: return 1; } /* check_object_info_tags */ - + /*------------------------------------------------------------------------- * Function: check_object_copy_tags * @@ -2996,7 +2996,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_object_copy_tags(void) { /* Variable Declarations */ @@ -3046,7 +3046,7 @@ check_object_copy_tags(void) if ( (gid = H5Gopen2(fid, GROUPNAMECOPY, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( get_object_header_tag(gid, ©_tag) < 0 ) TEST_ERROR; if (H5Gclose(gid) < 0) TEST_ERROR; - + /* =================================== */ /* Verification of Metadata Tag Values */ /* =================================== */ @@ -3095,7 +3095,7 @@ error: return 1; } /* check_object_copy_tags */ - + /*------------------------------------------------------------------------- * Function: check_link_removal_tags * @@ -3109,7 +3109,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_link_removal_tags(hid_t fcpl, int type) { /* Variable Declarations */ @@ -3156,7 +3156,7 @@ check_link_removal_tags(hid_t fcpl, int type) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -3219,7 +3219,7 @@ check_link_removal_tags(hid_t fcpl, int type) if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR; } /* end if */ - + /* verify no other entries present */ if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR; @@ -3247,7 +3247,7 @@ error: return 1; } /* check_link_removal_tags */ - + /*------------------------------------------------------------------------- * Function: check_link_getname_tags * @@ -3261,7 +3261,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_link_getname_tags(void) { /* Variable Declarations */ @@ -3309,7 +3309,7 @@ check_link_getname_tags(void) /* Set up creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - + /* Enable chunking */ if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR; @@ -3392,7 +3392,7 @@ error: return 1; } /* check_link_getname_tags */ - + /*------------------------------------------------------------------------- * Function: check_external_link_creation_tags * @@ -3406,7 +3406,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_external_link_creation_tags(void) { /* Variable Declarations */ @@ -3449,7 +3449,7 @@ check_external_link_creation_tags(void) /* ==================== */ /* Create External Link */ /* ==================== */ - + if (H5Lcreate_external(FILENAME2, GROUPNAMEPATH, fid, LINKNAME, H5P_DEFAULT, H5P_DEFAULT) < 0 ) TEST_ERROR; /* =================================== */ @@ -3460,7 +3460,7 @@ check_external_link_creation_tags(void) /* if verbose, print cache index to screen for visual verification */ if ( verbose ) dump_cache(fid); #endif /* NDEBUG */ /* end debugging functions */ - + /* Verify root group metadata */ if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR; if ( verify_tag(fid, H5AC_OHDR_CHK_ID, root_tag) < 0 ) TEST_ERROR; @@ -3490,7 +3490,7 @@ error: return 1; } /* check_external_link_creation_tags */ - + /*------------------------------------------------------------------------- * Function: check_external_link_open_tags * @@ -3504,7 +3504,7 @@ error: * *------------------------------------------------------------------------- */ -static unsigned +static unsigned check_external_link_open_tags(void) { /* Variable Declarations */ @@ -3556,11 +3556,11 @@ check_external_link_open_tags(void) /* ================== */ /* Open External Link */ /* ================== */ - + if ( (xid = H5Gopen2(fid, LINKNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( (fid2 = H5Iget_file_id(xid)) < 0) TEST_ERROR; if ( get_object_header_tag(xid, &link_tag) < 0 ) TEST_ERROR; - + /* =================================== */ /* Verification of Metadata Tag Values */ /* =================================== */ @@ -3614,12 +3614,12 @@ error: return 1; } /* check_external_link_open_tags */ - + /*------------------------------------------------------------------------- * Function: check_invalid_tag_application * * Purpose: This function verifies that an error occurs if a tag - * has not been set up during a protect or set of + * has not been set up during a protect or set of * a new piece of metadata. * * Return: 0 on Success, 1 on Failure @@ -3643,7 +3643,7 @@ check_invalid_tag_application(void) /* Testing Macro */ TESTING("failure on invalid tag application"); - + #if H5C_DO_TAGGING_SANITY_CHECKS /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; @@ -3705,7 +3705,7 @@ error: return 1; } /* check_invalid_tag_application */ - + /*------------------------------------------------------------------------- * Function: main * @@ -3718,8 +3718,8 @@ error: * *------------------------------------------------------------------------- */ -int -main(void) +int +main(void) { /* Variable Declarations */ hid_t fcpl_default = -1; /* file creation prop list */ @@ -3727,13 +3727,13 @@ main(void) hid_t fcpl = -1; /* file creation prop list */ unsigned nerrs = 0; /* Error Encountered */ int test_type = 0; /* test type iterator */ - + /* Open the HDF5 Library */ H5open(); - - /* ========== */ + + /* ========== */ /* Test Setup */ - /* ========== */ + /* ========== */ /* Create a standard file creation property list */ fcpl_default = H5Pcreate(H5P_FILE_CREATE); @@ -3749,13 +3749,13 @@ main(void) /* ========= */ for (test_type=0; test_type<NUM_TEST_TYPES; test_type++) { - + /* Run tests on each fcpl set up above. */ if (test_type == TEST_DEFAULT) { if (!nerrs) HDprintf("Testing standard tag application cases w/ default fcpl:\n"); fcpl = fcpl_default; - + } else if (test_type == TEST_SHMESG) { if (!nerrs) HDprintf("Testing standard tag application cases w/ shared messages:\n"); @@ -3792,7 +3792,7 @@ main(void) if (!nerrs) nerrs += check_link_getname_tags(); if (!nerrs) nerrs += check_external_link_creation_tags(); if (!nerrs) nerrs += check_external_link_open_tags(); - + if (!nerrs) nerrs += check_dense_attribute_tags(); if (!nerrs) nerrs += check_link_iteration_tags(); if (!nerrs) nerrs += check_invalid_tag_application(); diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index eef2070..ff3767c 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -2217,7 +2217,7 @@ main (int argc, char *argv[]) if (argc>1) { if (argc>2 || strcmp("--noopt", argv[1])) { HDfprintf(stderr, "usage: %s [--noopt]\n", argv[0]); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1, (H5T_conv_t)((void (*) (void))H5T__conv_struct_opt)); } diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 998c81c..f46a76d 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -15,7 +15,7 @@ * Serial tests for encoding/decoding plists */ -#include "h5test.h" +#include "testhdf5.h" #include "H5ACprivate.h" #include "H5Pprivate.h" diff --git a/test/external.c b/test/external.c index 3e8b7de..c9f0a9e 100644 --- a/test/external.c +++ b/test/external.c @@ -17,7 +17,6 @@ * * Purpose: Tests datasets stored in external raw files. */ -#include "h5test.h" #include "external_common.h" diff --git a/test/istore.c b/test/istore.c index 7489b7e..8759be3 100644 --- a/test/istore.c +++ b/test/istore.c @@ -338,7 +338,7 @@ test_extend(hid_t f, const char *prefix, HDfprintf(stderr,",%lu", (unsigned long)size[1]); if (ndims > 2) HDfprintf(stderr,",%lu", (unsigned long)size[2]); - HD fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); + HDfprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); if (0 == nelmts) HDfprintf(stderr," *SKIPPED*"); HDfprintf(stderr,"\n"); @@ -2574,16 +2574,16 @@ error: * The third block of 50 is allocated from there * There is space of 1998 left in the sdata_aggr * - * Allocate second block (2058) from meta_aggr: - * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * unused spaced in sdata_aggr is freed to free-space and is shrunk - * sdata_aggr is reset to 0 - * A block of request-size is obtained via file allocation - * The new block's address is returned - * The block does not adjoin meta_aggr - * meta_aggr's info is unchanged + * Allocate second block (2058) from meta_aggr: + * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * unused spaced in sdata_aggr is freed to free-space and is shrunk + * sdata_aggr is reset to 0 + * A block of request-size is obtained via file allocation + * The new block's address is returned + * The block does not adjoin meta_aggr + * meta_aggr's info is unchanged *------------------------------------------------------------------------- */ static unsigned @@ -5479,10 +5479,10 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) H5FD_mem_t type, stype; haddr_t addr1, addr2, saddr1; H5FS_stat_t state[H5FD_MEM_NTYPES]; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0, new_sdata_size=0; - hsize_t alignment=0, mis_align=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0, new_sdata_size=0; + hsize_t alignment=0, mis_align=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -6385,22 +6385,22 @@ error: memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW; \ memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP; \ memb_map[H5FD_MEM_LHEAP] = H5FD_MEM_LHEAP; \ - sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's'); \ + HDsprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's'); \ memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER]; \ memb_addr[H5FD_MEM_SUPER] = 0; \ - sprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b'); \ + HDsprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b'); \ memb_name[H5FD_MEM_BTREE] = sv[H5FD_MEM_BTREE]; \ memb_addr[H5FD_MEM_BTREE] = HADDR_MAX/6; \ - sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r'); \ + HDsprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r'); \ memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW]; \ memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/3; \ - sprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g'); \ + HDsprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g'); \ memb_name[H5FD_MEM_GHEAP] = sv[H5FD_MEM_GHEAP]; \ memb_addr[H5FD_MEM_GHEAP] = HADDR_MAX/2; \ - sprintf(sv[H5FD_MEM_LHEAP], "%%s-%c.h5", 'l'); \ + HDsprintf(sv[H5FD_MEM_LHEAP], "%%s-%c.h5", 'l'); \ memb_name[H5FD_MEM_LHEAP] = sv[H5FD_MEM_LHEAP]; \ memb_addr[H5FD_MEM_LHEAP] = HADDR_MAX*2/3; \ - sprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o'); \ + HDsprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o'); \ memb_name[H5FD_MEM_OHDR] = sv[H5FD_MEM_OHDR]; \ memb_addr[H5FD_MEM_OHDR] = HADDR_MAX*5/6; \ } @@ -6747,7 +6747,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TESTING("File's free-space is persistent with new library format") else TESTING("File's free-space is persistent with old library format") - + if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")) { /* File creation property list template */ @@ -6891,14 +6891,14 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) } else { SKIPPED(); - puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); + HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); } return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); H5Pclose(fcpl); H5Pclose(fapl2); } H5E_END_TRY; @@ -6907,7 +6907,7 @@ error: /* *------------------------------------------------------------------------- - * Verify free-space are merged/shrunk away + * Verify free-space are merged/shrunk away *------------------------------------------------------------------------- */ static unsigned @@ -6922,7 +6922,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) H5FS_stat_t fs_stat; /* Information for free-space manager */ haddr_t addr1, addr2, addr3, addr4; /* File address for H5FD_MEM_SUPER */ haddr_t addrx; - H5FD_mem_t fs_type; + H5FD_mem_t fs_type; hbool_t contig_addr_vfd; hbool_t ran_H5MF_tidy_self_referential_fsm_hack = FALSE; @@ -6972,7 +6972,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - + /* Put block #1, #3 to H5FD_MEM_SUPER free-space manager */ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR @@ -7089,14 +7089,14 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) } else { SKIPPED(); - puts(" Current VFD doesn't support persistent free-space manager"); + HDputs(" Current VFD doesn't support persistent free-space manager"); } return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); H5Pclose(fcpl); H5Pclose(fapl2); } H5E_END_TRY; @@ -7159,11 +7159,11 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for /* Create file-creation template */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) FAIL_STACK_ERROR - + /* Set default file space information */ if(H5Pset_file_space_strategy(fcpl, fs_type, (hbool_t)fs_persist, fs_threshold) < 0) FAIL_STACK_ERROR - + /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl2)) < 0) FAIL_STACK_ERROR @@ -7186,7 +7186,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for FAIL_STACK_ERROR if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR - + /* Put block #1, #3, #5 to H5FD_MEM_SUPER free-space manager */ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR @@ -7218,7 +7218,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for hssize_t nsects; /* # of free-space sections */ int i; /* local index variable */ H5F_sect_info_t *sect_info; /* array to hold the free-space information */ - + /* Get the # of free-space sections in the file */ if((nsects = H5Fget_free_sections(file, H5FD_MEM_DEFAULT, (size_t)0, NULL)) < 0) FAIL_STACK_ERROR @@ -7233,7 +7233,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)); H5Fget_free_sections(file, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); - + /* Verify the size of free-space sections */ for(i = 0; i < nsects; i++) if(sect_info[i].size < fs_threshold) @@ -7266,7 +7266,7 @@ error: H5E_BEGIN_TRY { H5Pclose(fcpl); H5Pclose(fapl2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_strat_thres_persist() */ @@ -7309,7 +7309,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format HDmemset(&fs_state_zero, 0, sizeof(H5FS_stat_t)); /* Copy the file access property list */ - if((fapl2 = H5Pcopy(fapl)) < 0) + if((fapl2 = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR if(new_format) @@ -7365,7 +7365,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format if(fs_type == H5F_FSPACE_STRATEGY_PAGE) { if(H5FS_stat_info(f, f->shared->fs_man[tt], &fs_state) < 0) FAIL_STACK_ERROR - } + } /* Put block #3, #5 to H5FD_MEM_SUPER free-space manager */ if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) @@ -7398,7 +7398,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format if(fs_type == H5F_FSPACE_STRATEGY_PAGE) { fs_state.tot_sect_count = fs_state.serial_sect_count = 1; fs_state.tot_space += (TBLOCK_SIZE4 + TBLOCK_SIZE6); - } + } /* For old format: the sections at EOF are shrunk away */ if(check_stats(f, f->shared->fs_man[tt], (fs_type == H5F_FSPACE_STRATEGY_PAGE) ? &fs_state:&fs_state_zero)) @@ -7422,7 +7422,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format /* Re-open the file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0) FAIL_STACK_ERROR - + /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR @@ -7452,7 +7452,7 @@ error: H5E_BEGIN_TRY { H5Pclose(fcpl); H5Pclose(fapl2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_strat_thres_gone() */ @@ -7482,11 +7482,11 @@ error: static unsigned test_dichotomy(hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5FD_mem_t type, stype; - haddr_t addr1, addr3, saddr1, saddr2; + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5FD_mem_t type, stype; + haddr_t addr1, addr3, saddr1, saddr2; TESTING("Allocation from raw or metadata free-space manager"); @@ -7539,7 +7539,7 @@ test_dichotomy(hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_dichotomy() */ @@ -7660,7 +7660,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(fid))) TEST_ERROR - + /* Allocate 3 small metadata blocks: addr1, addr2, addr3 */ H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30); addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034); @@ -7725,7 +7725,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Re-open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0) TEST_ERROR - + /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(fid))) TEST_ERROR @@ -7765,7 +7765,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Verify that the small raw data manager is there */ if(!H5F_addr_defined(f->shared->fs_addr[H5F_MEM_PAGE_DRAW])) TEST_ERROR - + /* Set up to use the small raw data manager */ if(!(f->shared->fs_man[H5F_MEM_PAGE_DRAW])) if(H5MF__open_fstype(f, H5F_MEM_PAGE_DRAW) < 0) @@ -7789,7 +7789,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) TEST_ERROR if(found_addr != gaddr1) TEST_ERROR - + /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR @@ -7803,7 +7803,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); + HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); } return(0); @@ -7927,7 +7927,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation"); + HDputs(" Current VFD doesn't support paged aggregation"); } return(0); @@ -8024,13 +8024,13 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR - + /* Free the block with addr1 */ H5MF_xfree(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE3248); /* Allocate a new metadata block with addr1 */ /* There is a page end threshold of size H5F_FILE_SPACE_PGEND_META_THRES at the end of the block */ - /* The block is right next to the threshold */ + /* The block is right next to the threshold */ addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3286); /* Try extending the block into the threshold with size > H5F_FILE_SPACE_PGEND_META_THRES */ @@ -8082,7 +8082,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation"); + HDputs(" Current VFD doesn't support paged aggregation"); } return(0); @@ -8192,7 +8192,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) if(was_extended == FALSE) TEST_ERROR /* Try extending the block with gaddr2 */ - /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */ + /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR @@ -8223,7 +8223,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation strategy"); + HDputs(" Current VFD doesn't support paged aggregation strategy"); } return(0); @@ -8280,7 +8280,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Set the strategy to paged aggregation */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0) FAIL_STACK_ERROR - + /* Create the file to work on */ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR @@ -8355,7 +8355,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) TEST_ERROR if(fs_stat.tot_space != (16384+288)) TEST_ERROR - + /* Close file */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR @@ -8376,7 +8376,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation strategy"); + HDputs(" Current VFD doesn't support paged aggregation strategy"); } return(0); @@ -8423,7 +8423,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) multi = TRUE; else if(!HDstrcmp(env_h5_drvr, "family")) family = TRUE; - + if(!multi && !split) { /* Set the filename to use for this test (dependent on fapl) */ @@ -8539,7 +8539,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation strategy"); + HDputs(" Current VFD doesn't support paged aggregation strategy"); } return(0); @@ -8557,7 +8557,7 @@ error: * Function: test_page_alignment * * Purpose: To verify the proper alignment is used when H5Pset_alignment() - * is set and paged aggregation is enabled. + * is set and paged aggregation is enabled. * * Return: Success: 0 * Failure: number of errors @@ -8588,7 +8588,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) split = TRUE; else if(!HDstrcmp(env_h5_drvr, "multi")) multi = TRUE; - + if(!multi && !split) { /* Set the filename to use for this test (dependent on fapl) */ @@ -8680,7 +8680,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* The alignment to use will be the library's default file space page size */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) TEST_ERROR - + /* Create the file to work on */ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl_new)) < 0) TEST_ERROR @@ -8721,7 +8721,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR - /* + /* * Case 2: Verify that the alignment in use is the alignment set * via H5Pset_alignment when paged aggregation not enabled. */ @@ -8778,7 +8778,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR - /* + /* * Case 3: Verify that the alignment in use is the alignment set * via H5Pset_alignment when paged aggregation not enabled. */ @@ -8801,7 +8801,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(fid))) TEST_ERROR - + /* Allocate 2 small raw data blocks */ saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); @@ -8845,7 +8845,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) } else { SKIPPED(); - puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); + HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); } return(0); @@ -8863,10 +8863,10 @@ error: int main(void) { - hid_t fapl = -1; /* File access property list for data files */ - hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */ + hid_t fapl = -1; /* File access property list for data files */ + hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */ unsigned nerrors = 0; /* Cumulative error count */ - test_type_t curr_test; /* Current test being worked on */ + test_type_t curr_test; /* Current test being worked on */ const char *env_h5_drvr; /* File Driver value from environment */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ @@ -8968,7 +8968,7 @@ main(void) nerrors += test_mf_strat_thres_persist(env_h5_drvr, fapl, FALSE); nerrors += test_mf_strat_thres_persist(env_h5_drvr, fapl, TRUE); - /* Temporary skipped for multi/split drivers: + /* Temporary skipped for multi/split drivers: fail file create when persisting free-space or using paged aggregation strategy */ #ifdef PB_OUT /* Tests specific for multi and split files--persisting free-space */ @@ -8976,7 +8976,7 @@ main(void) nerrors += test_mf_fs_persist_multi(); #endif - /* + /* * Tests specific for file space paging */ /* Temporary: The following 7 tests are modified to skip testing for multi/split driver: diff --git a/test/objcopy.c b/test/objcopy.c index b0904d0..b11352b 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -1199,8 +1199,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) hssize_t nelmts; /* # of elements in dataspace */ void *rbuf = NULL; /* Buffer for reading raw data */ void *rbuf2 = NULL; /* Buffer for reading raw data */ - H5D_space_status_t space_status; /* Dataset's raw data space status */ - H5D_space_status_t space_status2; /* Dataset's raw data space status */ + H5D_space_status_t space_status; /* Dataset's raw dataspace status */ + H5D_space_status_t space_status2; /* Dataset's raw dataspace status */ /* Check the datatypes are equal */ @@ -8279,7 +8279,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* make a copy of the datatype for later use */ if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR - /* named data type */ + /* named datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create and set chunk plist */ @@ -10980,7 +10980,7 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type */ + /* committed datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ @@ -12770,7 +12770,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* named data type */ + /* named datatype */ if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create dataset at SRC file */ @@ -13159,7 +13159,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type "a" */ + /* committed datatype "a" */ if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ @@ -13168,7 +13168,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR - /* committed data type "b" */ + /* committed datatype "b" */ if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ @@ -13768,8 +13768,6 @@ error: * Programmer: Vailin Choi * Feb 7, 2012 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -14184,7 +14182,7 @@ main(void) /* Set the FAPL for the destination file's type of format */ if(configuration & CONFIG_DST_NEW_FORMAT) { - puts("Testing with latest format for destination file:"); + HDputs("Testing with latest format for destination file:"); dst_fapl = fapl2; same_file = FALSE; } /* end if */ @@ -14360,7 +14358,7 @@ main(void) /* Results */ if(nerrors) { - printf("***** %d OBJECT COPY TEST%s FAILED! *****\n", + HDprintf("***** %d OBJECT COPY TEST%s FAILED! *****\n", nerrors, (1 == nerrors ? "" : "S")); exit(EXIT_FAILURE); } /* end if */ diff --git a/test/tattr.c b/test/tattr.c index 53e0e43..5d35e41 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -11147,6 +11147,6 @@ test_attr(void) void cleanup_attr(void) { - remove(FILENAME); + HDremove(FILENAME); } diff --git a/test/testframe.c b/test/testframe.c index a096f36..68c66ec 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -42,10 +42,10 @@ typedef struct TestStruct { * Variables used by testing framework. */ static int enable_error_stack = 0; /* enable error stack; disable=0 enable=1 */ -static int num_errs = 0; /* Total number of errors during testing */ +static int num_errs = 0; /* Total number of errors during testing */ int TestVerbosity = VERBO_DEF; /* Default Verbosity is Low */ -static int Summary = 0; /* Show test summary. Default is no. */ -static int CleanUp = 1; /* Do cleanup or not. Default is yes. */ +static int Summary = 0; /* Show test summary. Default is no. */ +static int CleanUp = 1; /* Do cleanup or not. Default is yes. */ static int TestExpress = -1; /* Do TestExpress or not. -1 means not set yet. */ static TestStruct *Test = NULL; /* Array of tests */ static unsigned TestAlloc = 0; /* Size of the Test array */ @@ -74,14 +74,12 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con { /* Sanity checking */ if (HDstrlen(TheDescr) >= MAXTESTDESC) { - HDprintf("Test description ('%s') too long, increase MAXTESTDESC(%d).\n", - TheDescr, MAXTESTDESC); - exit(EXIT_FAILURE); + HDprintf("Test description ('%s') too long, increase MAXTESTDESC(%d).\n", TheDescr, MAXTESTDESC); + HDexit(EXIT_FAILURE); } /* end if */ if (HDstrlen(TheName) >= MAXTESTNAME) { - HDprintf("Test name too long, increase MAXTESTNAME(%d).\n", - MAXTESTNAME); - exit(EXIT_FAILURE); + HDprintf("Test name too long, increase MAXTESTNAME(%d).\n", MAXTESTNAME); + HDexit(EXIT_FAILURE); } /* end if */ /* Check for increasing the Test array size */ @@ -167,7 +165,7 @@ void TestUsage(void) unsigned i; print_func("Usage: %s [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] %s\n", - TestProgName, (TestPrivateUsage ? "<extra options>" : "")); + TestProgName, (TestPrivateUsage ? "<extra options>" : "")); print_func(" [-[e]x[clude] name]+ \n"); print_func(" [-o[nly] name]+ \n"); print_func(" [-b[egin] name] \n"); @@ -228,78 +226,80 @@ void TestParseCmdLine(int argc, char *argv[]) int ret_code; while (argv++, --argc > 0){ - if ((HDstrcmp(*argv, "-verbose") == 0) || - (HDstrcmp(*argv, "-v") == 0)) { - if (argc > 0){ - --argc; ++argv; - ParseTestVerbosity(*argv); - }else{ - TestUsage(); - exit(EXIT_FAILURE); + if ((HDstrcmp(*argv, "-verbose") == 0) || (HDstrcmp(*argv, "-v") == 0)) { + if (argc > 0){ + --argc; ++argv; + ParseTestVerbosity(*argv); + } + else{ + TestUsage(); + HDexit(EXIT_FAILURE); + } } - } - else if (((HDstrcmp(*argv, "-exclude") == 0) || - (HDstrcmp(*argv, "-x") == 0))) { - if (argc > 0){ - --argc; ++argv; - SetTest(*argv, SKIPTEST); - }else{ - TestUsage(); - exit(EXIT_FAILURE); + else if (((HDstrcmp(*argv, "-exclude") == 0) || + (HDstrcmp(*argv, "-x") == 0))) { + if (argc > 0){ + --argc; ++argv; + SetTest(*argv, SKIPTEST); + } + else{ + TestUsage(); + HDexit(EXIT_FAILURE); + } } - } - else if (((HDstrcmp(*argv, "-begin") == 0) || - (HDstrcmp(*argv, "-b") == 0))) { - if (argc > 0){ - --argc; ++argv; - SetTest(*argv, BEGINTEST); - }else{ - TestUsage(); - exit(EXIT_FAILURE); + else if (((HDstrcmp(*argv, "-begin") == 0) || + (HDstrcmp(*argv, "-b") == 0))) { + if (argc > 0){ + --argc; ++argv; + SetTest(*argv, BEGINTEST); + } + else{ + TestUsage(); + HDexit(EXIT_FAILURE); + } } - } - else if (((HDstrcmp(*argv, "-only") == 0) || - (HDstrcmp(*argv, "-o") == 0))) { - if(argc > 0) { - unsigned Loop; + else if (((HDstrcmp(*argv, "-only") == 0) || + (HDstrcmp(*argv, "-o") == 0))) { + if(argc > 0) { + unsigned Loop; - --argc; ++argv; + --argc; ++argv; - /* Skip all tests, then activate only one. */ + /* Skip all tests, then activate only one. */ if(!skipped_all) { for(Loop = 0; Loop < Index; Loop++) Test[Loop].SkipFlag = 1; skipped_all = TRUE; } /* end if */ - SetTest(*argv, ONLYTEST); - } /* end if */ - else { - TestUsage(); - exit(EXIT_FAILURE); + SetTest(*argv, ONLYTEST); + } + else{ + TestUsage(); + HDexit(EXIT_FAILURE); + } + } + else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0)) + Summary = 1; + else if (HDstrcmp(*argv, "-enable-error-stack") == 0) + enable_error_stack = 1; + else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) { + TestUsage(); + HDexit(EXIT_SUCCESS); + } + else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0)) + SetTestNoCleanup(); + else { + /* non-standard option. Break out. */ + break; } - } - else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0)) - Summary = 1; - else if (HDstrcmp(*argv, "-enable-error-stack") == 0) - enable_error_stack = 1; - else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) { - TestUsage(); - exit(EXIT_SUCCESS); - } - else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0)) - SetTestNoCleanup(); - else { - /* non-standard option. Break out. */ - break; - } } /* Call extra parsing function if provided. */ if (NULL != TestPrivateParser){ - ret_code=TestPrivateParser(argc+1, argv-1); - if (ret_code != 0) - exit(EXIT_FAILURE); + ret_code=TestPrivateParser(argc+1, argv-1); + if (ret_code != 0) + HDexit(EXIT_FAILURE); } } @@ -318,10 +318,10 @@ void PerformTests(void) MESSAGE(2, ("Testing -- %s (%s) \n", Test[Loop].Description, Test[Loop].Name)); MESSAGE(5, ("===============================================\n")); Test[Loop].NumErrors = num_errs; - Test_parameters = Test[Loop].Parameters; - ALARM_ON; + Test_parameters = Test[Loop].Parameters; + ALARM_ON; Test[Loop].Call(); - ALARM_OFF; + ALARM_OFF; Test[Loop].NumErrors = num_errs - Test[Loop].NumErrors; MESSAGE(5, ("===============================================\n")); MESSAGE(5, ("There were %d errors detected.\n\n", (int)Test[Loop].NumErrors)); @@ -440,18 +440,18 @@ int GetTestExpress(void) /* set it here for now. Should be done in something like h5test_init(). */ if(TestExpress==-1) { - env_val = getenv("HDF5TestExpress"); - - if(env_val == NULL) - SetTestExpress(1); - else if(strcmp(env_val, "0") == 0) - SetTestExpress(0); - else if(strcmp(env_val, "1") == 0) - SetTestExpress(1); - else if(strcmp(env_val, "2") == 0) - SetTestExpress(2); - else - SetTestExpress(3); + env_val = getenv("HDF5TestExpress"); + + if(env_val == NULL) + SetTestExpress(1); + else if(strcmp(env_val, "0") == 0) + SetTestExpress(0); + else if(strcmp(env_val, "1") == 0) + SetTestExpress(1); + else if(strcmp(env_val, "2") == 0) + SetTestExpress(2); + else + SetTestExpress(3); } return(TestExpress); @@ -508,13 +508,13 @@ int SetTestNoCleanup(void) void ParseTestVerbosity(char *argv) { if (*argv == 'l') - SetTestVerbosity(VERBO_LO); + SetTestVerbosity(VERBO_LO); else if (*argv == 'm') - SetTestVerbosity(VERBO_MED); + SetTestVerbosity(VERBO_MED); else if (*argv == 'h') - SetTestVerbosity(VERBO_HI); + SetTestVerbosity(VERBO_HI); else - SetTestVerbosity(atoi(argv)); + SetTestVerbosity(atoi(argv)); } @@ -582,29 +582,29 @@ void SetTest(const char *testname, int action) switch (action){ case SKIPTEST: for (Loop = 0; Loop < Index; Loop++) - if (HDstrcmp(testname, Test[Loop].Name) == 0){ - Test[Loop].SkipFlag = 1; - break; - } + if (HDstrcmp(testname, Test[Loop].Name) == 0){ + Test[Loop].SkipFlag = 1; + break; + } break; case BEGINTEST: for (Loop = 0; Loop < Index; Loop++) { - if (HDstrcmp(testname, Test[Loop].Name) != 0) - Test[Loop].SkipFlag = 1; - else{ - /* Found it. Set it to run. Done. */ - Test[Loop].SkipFlag = 0; - break; - } + if (HDstrcmp(testname, Test[Loop].Name) != 0) + Test[Loop].SkipFlag = 1; + else{ + /* Found it. Set it to run. Done. */ + Test[Loop].SkipFlag = 0; + break; + } } break; case ONLYTEST: for (Loop = 0; Loop < Index; Loop++) { - if (HDstrcmp(testname, Test[Loop].Name) == 0) { - /* Found it. Set it to run. Break to skip the rest. */ - Test[Loop].SkipFlag = 0; - break; - } + if (HDstrcmp(testname, Test[Loop].Name) == 0) { + /* Found it. Set it to run. Break to skip the rest. */ + Test[Loop].SkipFlag = 0; + break; + } } break; default: diff --git a/test/testhdf5.h b/test/testhdf5.h index 1f3f6a0..ef3b784 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -177,53 +177,53 @@ extern "C" { #endif /* Prototypes for the test routines */ -void test_metadata(void); -void test_checksum(void); -void test_tst(void); -void test_heap(void); -void test_refstr(void); -void test_file(void); -void test_h5o(void); -void test_h5t(void); -void test_h5s(void); -void test_coords(void); -void test_h5d(void); -void test_attr(void); -void test_select(void); -void test_time(void); -void test_reference(void); -void test_vltypes(void); -void test_vlstrings(void); -void test_iterate(void); -void test_array(void); -void test_genprop(void); -void test_configure(void); -void test_misc(void); -void test_ids(void); -void test_skiplist(void); -void test_sohm(void); -void test_unicode(void); +void test_metadata(void); +void test_checksum(void); +void test_tst(void); +void test_heap(void); +void test_refstr(void); +void test_file(void); +void test_h5o(void); +void test_h5t(void); +void test_h5s(void); +void test_coords(void); +void test_h5d(void); +void test_attr(void); +void test_select(void); +void test_time(void); +void test_reference(void); +void test_vltypes(void); +void test_vlstrings(void); +void test_iterate(void); +void test_array(void); +void test_genprop(void); +void test_configure(void); +void test_misc(void); +void test_ids(void); +void test_skiplist(void); +void test_sohm(void); +void test_unicode(void); /* Prototypes for the cleanup routines */ -void cleanup_metadata(void); -void cleanup_checksum(void); -void cleanup_file(void); -void cleanup_h5o(void); -void cleanup_h5s(void); -void cleanup_coords(void); -void cleanup_attr(void); -void cleanup_select(void); -void cleanup_time(void); -void cleanup_reference(void); -void cleanup_vltypes(void); -void cleanup_vlstrings(void); -void cleanup_iterate(void); -void cleanup_array(void); -void cleanup_genprop(void); -void cleanup_configure(void); -void cleanup_sohm(void); -void cleanup_misc(void); -void cleanup_unicode(void); +void cleanup_metadata(void); +void cleanup_checksum(void); +void cleanup_file(void); +void cleanup_h5o(void); +void cleanup_h5s(void); +void cleanup_coords(void); +void cleanup_attr(void); +void cleanup_select(void); +void cleanup_time(void); +void cleanup_reference(void); +void cleanup_vltypes(void); +void cleanup_vlstrings(void); +void cleanup_iterate(void); +void cleanup_array(void); +void cleanup_genprop(void); +void cleanup_configure(void); +void cleanup_sohm(void); +void cleanup_misc(void); +void cleanup_unicode(void); #ifdef __cplusplus } diff --git a/test/testmeta.c b/test/testmeta.c index b97eb68..9a40e6f 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -23,34 +23,34 @@ */ -#include "hdf5.h" +#include "h5test.h" -#define FILEN "testmeta.h5" +#define FILEN "testmeta.h5" -#define CHUNK_SIZE 512 +#define CHUNK_SIZE 512 -#define NDATAARRAYS 3 -/*#define NPOINTS 2048*/ -#define NPOINTS 20 -#define NEXTARRAYS 10 -#define NDATAOBJECTS 100000 +#define NDATAARRAYS 3 +/*#define NPOINTS 2048*/ +#define NPOINTS 20 +#define NEXTARRAYS 10 +#define NDATAOBJECTS 100000 int main(void) { - hid_t file_id, prop_id, memspace_id, type_id; - hid_t group_id; - hid_t dataset_id, dataspace_id; - herr_t status; - hsize_t dims[1]; - hsize_t maxdims[1]; - float data[NPOINTS]; - float floatval; - unsigned numdataobj = 0; - unsigned i, j; - char name[80]; - hsize_t start[1] = {0}; - hsize_t stride[1] = {1}; - hsize_t count[1] = {1}; + hid_t file_id, prop_id, memspace_id, type_id; + hid_t group_id; + hid_t dataset_id, dataspace_id; + herr_t status; + hsize_t dims[1]; + hsize_t maxdims[1]; + float data[NPOINTS]; + float floatval; + unsigned numdataobj = 0; + unsigned i, j; + char name[80]; + hsize_t start[1] = {0}; + hsize_t stride[1] = {1}; + hsize_t count[1] = {1}; /* Create a file */ file_id = H5Fcreate(FILEN, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -64,8 +64,7 @@ int main(void) H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write value to NumDataObj dataset */ - status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, - H5S_ALL, H5P_DEFAULT, &numdataobj); + status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &numdataobj); /* Close the identifiers */ status = H5Dclose(dataset_id); @@ -78,16 +77,14 @@ int main(void) status = H5Pset_chunk(prop_id, 1, dims); /* Create dataspace */ - dims[0]=1; - maxdims[0]=H5S_UNLIMITED; + dims[0] = 1; + maxdims[0] = H5S_UNLIMITED; dataspace_id = H5Screate_simple(1, dims, maxdims); - for(i=0; i<NEXTARRAYS; i++) - { + for(i = 0; i < NEXTARRAYS; i++) { /* Create dataset */ sprintf(name, "/ExtArray%06d", i); - dataset_id = H5Dcreate2(file_id, name, - H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT); + dataset_id = H5Dcreate2(file_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT); /* Close the identifier */ status = H5Dclose(dataset_id); @@ -101,47 +98,43 @@ int main(void) group_id = H5Gcreate2(file_id, "/DataArray", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group_id); - for(j=0; j<NDATAOBJECTS; j++) - { + for(j = 0; j < NDATAOBJECTS; j++) { /* Removed print statement as it would lock system resources on Windows */ /* - * printf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS); + * HDprintf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS); * fflush(stdout); */ floatval = (float)j; /* Create group to hold data arrays for this object */ - sprintf(name, "/DataArray/%06d", j); + HDsprintf(name, "/DataArray/%06d", j); group_id = H5Gcreate2(file_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(group_id < 0) { - fprintf(stderr, "Failed to create DataArray group.\n"); + HDfprintf(stderr, "Failed to create DataArray group.\n"); status = H5Fclose(file_id); return -1; } /* Loop over data arrays */ - for(i=0; i<NDATAARRAYS; i++) - { + for(i = 0; i < NDATAARRAYS; i++) { /* Create dataspace */ dims[0]=NPOINTS; maxdims[0]=NPOINTS; dataspace_id = H5Screate_simple(1 ,dims, maxdims); /* Create dataset */ - sprintf(name, "DataArray%06d", i); - dataset_id = H5Dcreate2(group_id, name, - H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + HDsprintf(name, "DataArray%06d", i); + dataset_id = H5Dcreate2(group_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dataset_id < 0) { - fprintf(stderr, "Failed to create DataArray dataset.\n"); + HDfprintf(stderr, "Failed to create DataArray dataset.\n"); status = H5Fclose(file_id); return -1; } /* Write the data array data */ - status = H5Dwrite(dataset_id, H5T_NATIVE_FLOAT, H5S_ALL, - H5S_ALL, H5P_DEFAULT, data); + status = H5Dwrite(dataset_id, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if(status < 0) { - fprintf(stderr, "Failed to write DataArray dataset.\n"); + HDfprintf(stderr, "Failed to write DataArray dataset.\n"); status = H5Fclose(file_id); return -1; } @@ -154,17 +147,16 @@ int main(void) /* Open NumDataObj dataset */ dataset_id = H5Dopen2(file_id, "/NumDataObj", H5P_DEFAULT); if(dataset_id < 0) { - fprintf(stderr, "Failed to open NumDataObj dataset.\n"); + HDfprintf(stderr, "Failed to open NumDataObj dataset.\n"); status = H5Fclose(file_id); return -1; } /* Write value to NumDataObj dataset */ numdataobj = j + 1; - status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, - H5S_ALL, H5P_DEFAULT, &numdataobj); + status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &numdataobj); if(status < 0) { - fprintf(stderr, "Failed to write NumDataObj dataset.\n"); + HDfprintf(stderr, "Failed to write NumDataObj dataset.\n"); status = H5Fclose(file_id); return -1; } @@ -176,10 +168,10 @@ int main(void) /* Extend attribute arrays */ for(i = 0; i < NEXTARRAYS; i++) { /* Open extendable dataset */ - sprintf(name, "/ExtArray%06d", i); + HDsprintf(name, "/ExtArray%06d", i); dataset_id = H5Dopen2(file_id, name, H5P_DEFAULT); if(dataset_id < 0) { - fprintf(stderr, "Failed to open ExtArray dataset.\n"); + HDfprintf(stderr, "Failed to open ExtArray dataset.\n"); status = H5Fclose(file_id); return -1; } /* end if */ @@ -188,7 +180,7 @@ int main(void) dims[0] = (hsize_t)j + 1; status = H5Dset_extent(dataset_id, dims); if(status < 0) { - fprintf(stderr, "Failed to extend DataArray dataset.\n"); + HDfprintf(stderr, "Failed to extend DataArray dataset.\n"); status = H5Fclose(file_id); return -1; } /* end if */ @@ -200,16 +192,12 @@ int main(void) type_id = H5Dget_type(dataset_id); start[0] = 0; - status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, - start, stride, count, NULL); + status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, start, stride, count, NULL); start[0] = (hssize_t)j; - status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, - start, stride, count, NULL); - status = H5Dwrite(dataset_id, type_id, memspace_id, - dataspace_id, H5P_DEFAULT, &floatval); - if(status < 0) - { - fprintf(stderr, "Failed to write DataArray dataset.\n"); + status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, start, stride, count, NULL); + status = H5Dwrite(dataset_id, type_id, memspace_id, dataspace_id, H5P_DEFAULT, &floatval); + if(status < 0) { + HDfprintf(stderr, "Failed to write DataArray dataset.\n"); status = H5Fclose(file_id); return -1; } @@ -226,7 +214,7 @@ int main(void) /* Close the file */ status = H5Fclose(file_id); - printf("\n"); + HDprintf("\n"); return 0; } diff --git a/test/th5s.c b/test/th5s.c index 78baf08..4d4eb82 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1214,7 +1214,7 @@ test_h5s_encode(void) ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* Encode simple data space in a buffer */ + /* Encode simple dataspace in a buffer */ ret = H5Sencode(sid1, NULL, &sbuf_size); CHECK(ret, FAIL, "H5Sencode"); @@ -1275,7 +1275,7 @@ test_h5s_encode(void) sid2 = H5Screate(H5S_NULL); CHECK(sid2, FAIL, "H5Screate"); - /* Encode null data space in a buffer */ + /* Encode null dataspace in a buffer */ ret = H5Sencode(sid2, NULL, &null_size); CHECK(ret, FAIL, "H5Sencode"); diff --git a/test/trefer.c b/test/trefer.c index 78139d2..6b67eb4 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -21,7 +21,7 @@ #include "testhdf5.h" -#define FILE1 "trefer1.h5" +#define FILE1 "trefer1.h5" #define FILE2 "trefer2.h5" #define FILE3 "trefer3.h5" @@ -510,9 +510,9 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) hid_t dset1, /* Dataset ID */ dset2, /* Dereferenced dataset ID */ dset3; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid2, /* Dataspace ID #2 */ - sid3; /* Dataspace ID #3 */ + hid_t sid1, /* Dataspace ID #1 */ + sid2, /* Dataspace ID #2 */ + sid3; /* Dataspace ID #3 */ hid_t dapl_id; /* Dataset access property list */ hsize_t dims1[] = {SPACE1_DIM1}, dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; diff --git a/test/tselect.c b/test/tselect.c index 00ddeb1..9885a05 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -13,50 +13,50 @@ /*********************************************************** * -* Test program: tselect +* Test program: tselect * * Test the Dataspace selection functionality * *************************************************************/ -#define H5S_FRIEND /*suppress error about including H5Spkg */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5S_TESTING #include "testhdf5.h" #include "hdf5.h" -#include "H5Spkg.h" /* Dataspaces */ +#include "H5Spkg.h" /* Dataspaces */ #define FILENAME "tselect.h5" /* 3-D dataset with fixed dimensions */ #define SPACE1_NAME "Space1" -#define SPACE1_RANK 3 -#define SPACE1_DIM1 3 -#define SPACE1_DIM2 15 -#define SPACE1_DIM3 13 +#define SPACE1_RANK 3 +#define SPACE1_DIM1 3 +#define SPACE1_DIM2 15 +#define SPACE1_DIM3 13 /* 2-D dataset with fixed dimensions */ #define SPACE2_NAME "Space2" -#define SPACE2_RANK 2 -#define SPACE2_DIM1 30 -#define SPACE2_DIM2 26 -#define SPACE2A_RANK 1 -#define SPACE2A_DIM1 (SPACE2_DIM1*SPACE2_DIM2) +#define SPACE2_RANK 2 +#define SPACE2_DIM1 30 +#define SPACE2_DIM2 26 +#define SPACE2A_RANK 1 +#define SPACE2A_DIM1 (SPACE2_DIM1*SPACE2_DIM2) /* 2-D dataset with fixed dimensions */ #define SPACE3_NAME "Space3" -#define SPACE3_RANK 2 -#define SPACE3_DIM1 15 -#define SPACE3_DIM2 26 +#define SPACE3_RANK 2 +#define SPACE3_DIM1 15 +#define SPACE3_DIM2 26 /* 3-D dataset with fixed dimensions */ #define SPACE4_NAME "Space4" -#define SPACE4_RANK 3 -#define SPACE4_DIM1 11 -#define SPACE4_DIM2 13 -#define SPACE4_DIM3 17 +#define SPACE4_RANK 3 +#define SPACE4_DIM1 11 +#define SPACE4_DIM2 13 +#define SPACE4_DIM3 17 /* Number of random hyperslabs to test */ #define NHYPERSLABS 10 @@ -66,22 +66,22 @@ /* 5-D dataset with fixed dimensions */ #define SPACE5_NAME "Space5" -#define SPACE5_RANK 5 -#define SPACE5_DIM1 10 -#define SPACE5_DIM2 10 -#define SPACE5_DIM3 10 -#define SPACE5_DIM4 10 -#define SPACE5_DIM5 10 +#define SPACE5_RANK 5 +#define SPACE5_DIM1 10 +#define SPACE5_DIM2 10 +#define SPACE5_DIM3 10 +#define SPACE5_DIM4 10 +#define SPACE5_DIM5 10 /* 1-D dataset with same size as 5-D dataset */ -#define SPACE6_RANK 1 -#define SPACE6_DIM1 (SPACE5_DIM1*SPACE5_DIM2*SPACE5_DIM3*SPACE5_DIM4*SPACE5_DIM5) +#define SPACE6_RANK 1 +#define SPACE6_DIM1 (SPACE5_DIM1*SPACE5_DIM2*SPACE5_DIM3*SPACE5_DIM4*SPACE5_DIM5) /* 2-D dataset with easy dimension sizes */ #define SPACE7_NAME "Space7" -#define SPACE7_RANK 2 -#define SPACE7_DIM1 10 -#define SPACE7_DIM2 10 +#define SPACE7_RANK 2 +#define SPACE7_DIM1 10 +#define SPACE7_DIM2 10 #define SPACE7_FILL 254 #define SPACE7_CHUNK_DIM1 5 #define SPACE7_CHUNK_DIM2 5 @@ -89,16 +89,16 @@ /* 4-D dataset with fixed dimensions */ #define SPACE8_NAME "Space8" -#define SPACE8_RANK 4 -#define SPACE8_DIM1 11 -#define SPACE8_DIM2 13 -#define SPACE8_DIM3 17 -#define SPACE8_DIM4 19 +#define SPACE8_RANK 4 +#define SPACE8_DIM1 11 +#define SPACE8_DIM2 13 +#define SPACE8_DIM3 17 +#define SPACE8_DIM4 19 /* Another 2-D dataset with easy dimension sizes */ -#define SPACE9_RANK 2 -#define SPACE9_DIM1 12 -#define SPACE9_DIM2 12 +#define SPACE9_RANK 2 +#define SPACE9_DIM1 12 +#define SPACE9_DIM2 12 /* Element selection information */ #define POINT1_NPOINTS 10 @@ -125,13 +125,13 @@ #define SPACE10_CHUNK_SIZE 12 /* Information for bounds checking test */ -#define SPACE11_RANK 2 +#define SPACE11_RANK 2 #define SPACE11_DIM1 100 #define SPACE11_DIM2 100 #define SPACE11_NPOINTS 4 /* Information for offsets w/chunks test #2 */ -#define SPACE12_RANK 1 +#define SPACE12_RANK 1 #define SPACE12_DIM0 25 #define SPACE12_CHUNK_DIM0 5 @@ -164,10 +164,10 @@ #define SPACEUD3_DIM2 13 /* #defines for shape same / different rank tests */ -#define SS_DR_MAX_RANK 5 +#define SS_DR_MAX_RANK 5 /* Information for regular hyperslab query test */ -#define SPACE13_RANK 3 +#define SPACE13_RANK 3 #define SPACE13_DIM1 50 #define SPACE13_DIM2 50 #define SPACE13_DIM3 50 @@ -215,21 +215,21 @@ test_select_hyper_iter1(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_A static void test_select_hyper(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -380,7 +380,7 @@ test_select_hyper(hid_t xfer_plist) } /* test_select_hyper() */ struct pnt_iter { - hsize_t coord[POINT1_NPOINTS*2][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t coord[POINT1_NPOINTS*2][SPACE2_RANK]; /* Coordinates for point selection */ uint8_t *buf; /* Buffer the points are in */ int offset; /* Which point we are looking at */ }; @@ -417,24 +417,24 @@ test_select_point_iter1(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_A static void test_select_point(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t temp_coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t temp_coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ - hsize_t temp_coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t temp_coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t temp_coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hsize_t temp_coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ struct pnt_iter pi; /* Custom Pointer iterator struct */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Element Selection Functions\n")); @@ -703,15 +703,15 @@ test_select_none_iter1(void H5_ATTR_UNUSED *_elem, hid_t H5_ATTR_UNUSED type_id, static void test_select_all(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j,k; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -784,21 +784,21 @@ test_select_all(hid_t xfer_plist) static void test_select_all_hyper(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -925,23 +925,23 @@ test_select_all_hyper(hid_t xfer_plist) static void test_select_combo(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Combination of Hyperslab & Element Selection Functions\n")); @@ -1069,16 +1069,16 @@ compare_size_t(const void *s1, const void *s2) static void test_select_hyper_stride(hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ @@ -1108,7 +1108,7 @@ test_select_hyper_stride(hid_t xfer_plist) 220,221,222,246,247,248, /* Block #12 */ }; int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); @@ -1224,19 +1224,19 @@ test_select_hyper_stride(hid_t xfer_plist) static void test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE2_DIM2, SPACE2_DIM1}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE2_DIM2, SPACE2_DIM1}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Contiguous Hyperslabs Functionality\n")); @@ -1350,17 +1350,17 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) static void test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1}; - hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */ - hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1}; + hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */ + hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j,k,l; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing More Contiguous Hyperslabs Functionality\n")); @@ -1471,17 +1471,17 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) static void test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1}; - hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */ - hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1}; + hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */ + hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */ uint16_t *wbuf, /* Buffer to write to disk */ *rbuf, /* Buffer read from disk */ *tbuf, *tbuf2; /* Temporary buffer pointers */ unsigned i,j,k,l; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Yet More Contiguous Hyperslabs Functionality\n")); @@ -1597,7 +1597,7 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) HDfree(rbuf); } /* test_select_hyper_contig3() */ - + /**************************************************************** ** ** verify_select_hyper_contig_dr__run_test(): Verify data from @@ -1609,10 +1609,10 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, size_t cube_size, unsigned edge_size, unsigned cube_rank) { const uint16_t *cube_ptr; /* Pointer into the cube buffer */ - uint16_t expected_value; /* Expected value in dataset */ + uint16_t expected_value; /* Expected value in dataset */ unsigned i, j, k, l, m; /* Local index variables */ size_t s; /* Local index variable */ - hbool_t mis_match; /* Flag to indicate mis-match in expected value */ + hbool_t mis_match; /* Flag to indicate mis-match in expected value */ HDassert(cube_buf); HDassert(cube_size > 0); @@ -1656,7 +1656,7 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, TestErrPrintf("Initial cube data don't match! Line = %d\n", __LINE__); } /* verify_select_hyper_contig_dr__run_test() */ - + /**************************************************************** ** ** test_select_hyper_contig_dr__run_test(): Test H5S (dataspace) @@ -1671,37 +1671,37 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, const uint16_t *zero_buf, unsigned edge_size, unsigned chunk_edge_size, unsigned small_rank, unsigned large_rank, hid_t dset_type, hid_t xfer_plist) { - hbool_t mis_match; /* Flag indicating a value read in wasn't what was expected */ + hbool_t mis_match; /* Flag indicating a value read in wasn't what was expected */ hid_t fapl; /* File access property list */ - hid_t fid1; /* File ID */ - hid_t small_cube_sid; /* Dataspace ID for small cube in memory & file */ - hid_t mem_large_cube_sid; /* Dataspace ID for large cube in memory */ - hid_t file_large_cube_sid; /* Dataspace ID for large cube in file */ - hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */ - hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */ - hid_t small_cube_dataset; /* Dataset ID */ - hid_t large_cube_dataset; /* Dataset ID */ + hid_t fid1; /* File ID */ + hid_t small_cube_sid; /* Dataspace ID for small cube in memory & file */ + hid_t mem_large_cube_sid; /* Dataspace ID for large cube in memory */ + hid_t file_large_cube_sid; /* Dataspace ID for large cube in file */ + hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */ + hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */ + hid_t small_cube_dataset; /* Dataset ID */ + hid_t large_cube_dataset; /* Dataset ID */ size_t start_index; /* Offset within buffer to begin inspecting */ size_t stop_index; /* Offset within buffer to end inspecting */ - uint16_t expected_value; /* Expected value in dataset */ - uint16_t * small_cube_buf_1; /* Buffer for small cube data */ - uint16_t * large_cube_buf_1; /* Buffer for large cube data */ - uint16_t * ptr_1; /* Temporary pointer into cube data */ - hsize_t dims[SS_DR_MAX_RANK]; /* Dataspace dimensions */ - hsize_t start[SS_DR_MAX_RANK]; /* Shared hyperslab start offset */ - hsize_t stride[SS_DR_MAX_RANK]; /* Shared hyperslab stride */ - hsize_t count[SS_DR_MAX_RANK]; /* Shared hyperslab count */ - hsize_t block[SS_DR_MAX_RANK]; /* Shared hyperslab block size */ - hsize_t * start_ptr; /* Actual hyperslab start offset */ - hsize_t * stride_ptr; /* Actual hyperslab stride */ - hsize_t * count_ptr; /* Actual hyperslab count */ - hsize_t * block_ptr; /* Actual hyperslab block size */ + uint16_t expected_value; /* Expected value in dataset */ + uint16_t * small_cube_buf_1; /* Buffer for small cube data */ + uint16_t * large_cube_buf_1; /* Buffer for large cube data */ + uint16_t * ptr_1; /* Temporary pointer into cube data */ + hsize_t dims[SS_DR_MAX_RANK]; /* Dataspace dimensions */ + hsize_t start[SS_DR_MAX_RANK]; /* Shared hyperslab start offset */ + hsize_t stride[SS_DR_MAX_RANK]; /* Shared hyperslab stride */ + hsize_t count[SS_DR_MAX_RANK]; /* Shared hyperslab count */ + hsize_t block[SS_DR_MAX_RANK]; /* Shared hyperslab block size */ + hsize_t * start_ptr; /* Actual hyperslab start offset */ + hsize_t * stride_ptr; /* Actual hyperslab stride */ + hsize_t * count_ptr; /* Actual hyperslab count */ + hsize_t * block_ptr; /* Actual hyperslab block size */ size_t small_cube_size; /* Number of elements in small cube */ size_t large_cube_size; /* Number of elements in large cube */ unsigned u, v, w, x; /* Local index variables */ size_t s; /* Local index variable */ - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ MESSAGE(7, ("\tn-cube slice through m-cube I/O test %d.\n", test_num)); MESSAGE(7, ("\tranks = %u/%u, edge_size = %u, chunk_edge_size = %u.\n", small_rank, large_rank, edge_size, chunk_edge_size)); @@ -1770,10 +1770,10 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, * datasets. */ if(chunk_edge_size > 0) { - hsize_t chunk_dims[SS_DR_MAX_RANK]; /* Chunk dimensions */ + hsize_t chunk_dims[SS_DR_MAX_RANK]; /* Chunk dimensions */ chunk_dims[0] = chunk_dims[1] = - chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = (hsize_t)chunk_edge_size; + chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = (hsize_t)chunk_edge_size; small_cube_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); CHECK(small_cube_dcpl_id, FAIL, "H5Pcreate"); @@ -2096,7 +2096,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, VERIFY(check, TRUE, "H5S_select_shape_same_test"); - /* write the slice from the in memory large cube to the on disk small cube */ + /* write the slice from the in memory large cube to the on disk small cube */ ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid, @@ -2207,7 +2207,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, VERIFY(check, TRUE, "H5S_select_shape_same_test"); - /* write the cube from memory to the target slice of the disk cube */ + /* write the cube from memory to the target slice of the disk cube */ ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid, @@ -2303,7 +2303,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, } /* test_select_hyper_contig_dr__run_test() */ - + /**************************************************************** ** ** test_select_hyper_contig_dr(): Test H5S (dataspace) @@ -2371,25 +2371,25 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) } /* test_select_hyper_contig_dr() */ - + /**************************************************************** ** ** test_select_hyper_checker_board_dr__select_checker_board(): -** Given an n-cube data space with each edge of length -** edge_size, and a checker_edge_size either select a checker -** board selection of the entire cube(if sel_rank == n), -** or select a checker board selection of a -** sel_rank dimensional slice through n-cube parallel to the +** Given an n-cube dataspace with each edge of length +** edge_size, and a checker_edge_size either select a checker +** board selection of the entire cube(if sel_rank == n), +** or select a checker board selection of a +** sel_rank dimensional slice through n-cube parallel to the ** sel_rank fastest changing indices, with origin (in the -** higher indices) as indicated by the start array. +** higher indices) as indicated by the start array. ** -** Note that this function, like all its relatives, is -** hard coded to presume a maximum n-cube rank of 5. -** While this maximum is declared as a constant, increasing -** it will require extensive coding in addition to changing +** Note that this function, like all its relatives, is +** hard coded to presume a maximum n-cube rank of 5. +** While this maximum is declared as a constant, increasing +** it will require extensive coding in addition to changing ** the value of the constant. ** -** JRM -- 9/9/09 +** JRM -- 9/9/09 ** ****************************************************************/ static void @@ -2397,18 +2397,18 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, unsigned tgt_n_cube_rank, unsigned edge_size, unsigned checker_edge_size, unsigned sel_rank, hsize_t sel_start[]) { - hbool_t first_selection = TRUE; - unsigned n_cube_offset; - unsigned sel_offset; - hsize_t base_count; + hbool_t first_selection = TRUE; + unsigned n_cube_offset; + unsigned sel_offset; + hsize_t base_count; hsize_t offset_count; - hsize_t start[SS_DR_MAX_RANK]; /* Offset of hyperslab selection */ - hsize_t stride[SS_DR_MAX_RANK]; /* Stride of hyperslab selection */ - hsize_t count[SS_DR_MAX_RANK]; /* Count of hyperslab selection */ - hsize_t block[SS_DR_MAX_RANK]; /* Block size of hyperslab selection */ + hsize_t start[SS_DR_MAX_RANK]; /* Offset of hyperslab selection */ + hsize_t stride[SS_DR_MAX_RANK]; /* Stride of hyperslab selection */ + hsize_t count[SS_DR_MAX_RANK]; /* Count of hyperslab selection */ + hsize_t block[SS_DR_MAX_RANK]; /* Block size of hyperslab selection */ unsigned i, j, k, l, m; /* Local index variable */ unsigned u; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ HDassert(edge_size >= 6); HDassert(0 < checker_edge_size); @@ -2567,8 +2567,8 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, /* Wierdness alert: * * Some how, it seems that selections can extend beyond the - * boundaries of the target data space -- hence the following - * code to manually clip the selection back to the data space + * boundaries of the target dataspace -- hence the following + * code to manually clip the selection back to the dataspace * proper. */ for(u = 0; u < SS_DR_MAX_RANK; u++) { @@ -2582,47 +2582,47 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* test_select_hyper_checker_board_dr__select_checker_board() */ - + /**************************************************************** ** ** test_select_hyper_checker_board_dr__verify_data(): ** -** Examine the supplied buffer to see if it contains the -** expected data. Return TRUE if it does, and FALSE +** Examine the supplied buffer to see if it contains the +** expected data. Return TRUE if it does, and FALSE ** otherwise. ** -** The supplied buffer is presumed to contain the results -** of read or writing a checkerboard selection of an -** n-cube, or a checkerboard selection of an m (1 <= m < n) -** dimensional slice through an n-cube parallel to the +** The supplied buffer is presumed to contain the results +** of read or writing a checkerboard selection of an +** n-cube, or a checkerboard selection of an m (1 <= m < n) +** dimensional slice through an n-cube parallel to the ** fastest changing indices. ** -** It is further presumed that the buffer was zeroed before -** the read, and that the n-cube was initialize with the +** It is further presumed that the buffer was zeroed before +** the read, and that the n-cube was initialize with the ** natural numbers listed in order from the origin along ** the fastest changing axis. ** ** Thus for a 10x10x10 3-cube, the value stored in location -** (x, y, z) (assuming that z is the fastest changing index -** and x the slowest) is assumed to be: +** (x, y, z) (assuming that z is the fastest changing index +** and x the slowest) is assumed to be: ** -** (10 * 10 * x) + (10 * y) + z +** (10 * 10 * x) + (10 * y) + z ** -** Thus, if the buffer contains the result of reading a -** checker board selection of a 10x10x10 3-cube, location -** (x, y, z) will contain zero if it is not in a checker, -** and 100x + 10y + z if (x, y, z) is in a checker. +** Thus, if the buffer contains the result of reading a +** checker board selection of a 10x10x10 3-cube, location +** (x, y, z) will contain zero if it is not in a checker, +** and 100x + 10y + z if (x, y, z) is in a checker. ** -** If the buffer contains the result of reading a 3 -** dimensional slice (parallel to the three fastest changing -** indices) through an n cube (n > 3), then the expected -** values in the buffer will be the same, save that we will -** add a constant determined by the origin of the 3-cube -** in the n-cube. +** If the buffer contains the result of reading a 3 +** dimensional slice (parallel to the three fastest changing +** indices) through an n cube (n > 3), then the expected +** values in the buffer will be the same, save that we will +** add a constant determined by the origin of the 3-cube +** in the n-cube. ** -** Finally, the function presumes that the first element -** of the buffer resides either at the origin of either -** a selected or an unselected checker. +** Finally, the function presumes that the first element +** of the buffer resides either at the origin of either +** a selected or an unselected checker. ** ****************************************************************/ H5_ATTR_PURE static hbool_t @@ -2726,7 +2726,7 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr, return(good_data); } /* test_select_hyper_checker_board_dr__verify_data() */ - + /**************************************************************** ** ** test_select_hyper_checker_board_dr__run_test(): Test H5S @@ -2742,36 +2742,36 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ unsigned chunk_edge_size, unsigned small_rank, unsigned large_rank, hid_t dset_type, hid_t xfer_plist) { - hbool_t data_ok; + hbool_t data_ok; hid_t fapl; /* File access property list */ - hid_t fid; /* HDF5 File IDs */ - hid_t full_small_cube_sid; /* Dataspace for small cube w/all selection */ - hid_t mem_small_cube_sid; - hid_t file_small_cube_sid; - hid_t full_large_cube_sid; /* Dataspace for large cube w/all selection */ - hid_t mem_large_cube_sid; - hid_t file_large_cube_sid; - hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */ - hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */ - hid_t small_cube_dataset; /* Dataset ID */ - hid_t large_cube_dataset; /* Dataset ID */ - unsigned small_rank_offset; /* Rank offset of slice */ - const unsigned test_max_rank = 5; /* must update code if this changes */ + hid_t fid; /* HDF5 File IDs */ + hid_t full_small_cube_sid; /* Dataspace for small cube w/all selection */ + hid_t mem_small_cube_sid; + hid_t file_small_cube_sid; + hid_t full_large_cube_sid; /* Dataspace for large cube w/all selection */ + hid_t mem_large_cube_sid; + hid_t file_large_cube_sid; + hid_t small_cube_dcpl_id = H5P_DEFAULT; /* DCPL for small cube dataset */ + hid_t large_cube_dcpl_id = H5P_DEFAULT; /* DCPL for large cube dataset */ + hid_t small_cube_dataset; /* Dataset ID */ + hid_t large_cube_dataset; /* Dataset ID */ + unsigned small_rank_offset; /* Rank offset of slice */ + const unsigned test_max_rank = 5; /* must update code if this changes */ size_t start_index; /* Offset within buffer to begin inspecting */ size_t stop_index; /* Offset within buffer to end inspecting */ - uint16_t expected_value; - uint16_t * small_cube_buf_1; - uint16_t * large_cube_buf_1; - uint16_t * ptr_1; + uint16_t expected_value; + uint16_t * small_cube_buf_1; + uint16_t * large_cube_buf_1; + uint16_t * ptr_1; size_t small_cube_size; /* Number of elements in small cube */ size_t large_cube_size; /* Number of elements in large cube */ - hsize_t dims[SS_DR_MAX_RANK]; - hsize_t chunk_dims[SS_DR_MAX_RANK]; - hsize_t sel_start[SS_DR_MAX_RANK]; + hsize_t dims[SS_DR_MAX_RANK]; + hsize_t chunk_dims[SS_DR_MAX_RANK]; + hsize_t sel_start[SS_DR_MAX_RANK]; unsigned u, v, w, x; /* Local index variables */ size_t s; /* Local index variable */ - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ MESSAGE(7, ("\tn-cube slice through m-cube I/O test %d.\n", test_num)); MESSAGE(7, ("\tranks = %d/%d, edge_size = %d, checker_edge_size = %d, chunk_edge_size = %d.\n", small_rank, large_rank, edge_size, checker_edge_size, chunk_edge_size)); @@ -2862,7 +2862,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ */ if(chunk_edge_size > 0) { chunk_dims[0] = chunk_dims[1] = - chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = chunk_edge_size; + chunk_dims[2] = chunk_dims[3] = chunk_dims[4] = chunk_edge_size; small_cube_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); CHECK(small_cube_dcpl_id, FAIL, "H5Pcreate"); @@ -3272,7 +3272,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ VERIFY(check, TRUE, "H5S_select_shape_same_test"); - /* write the slice from the in memory large cube to the + /* write the slice from the in memory large cube to the * on disk small cube */ ret = H5Dwrite(small_cube_dataset, @@ -3404,7 +3404,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ VERIFY(check, TRUE, "H5S_select_shape_same_test"); - /* write the checker board selection of the in memory + /* write the checker board selection of the in memory * small cube to a slice through the on disk large * cube. */ @@ -3531,7 +3531,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ } /* test_select_hyper_checker_board_dr__run_test() */ - + /**************************************************************** ** ** test_select_hyper_checker_board_dr(): Test H5S (dataspace) @@ -3540,8 +3540,8 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ ** tested H5S_shape_same in isolation, so now we try to do ** I/O. ** -** This is just an initial smoke check, so we will work -** with a slice through a cube only. +** This is just an initial smoke check, so we will work +** with a slice through a cube only. ** ****************************************************************/ static void @@ -3616,7 +3616,7 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) } /* test_select_hyper_checker_board_dr() */ - + /**************************************************************** ** ** test_select_hyper_copy(): Test H5S (dataspace) selection code. @@ -3626,22 +3626,22 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) static void test_select_hyper_copy(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t data1,data2; /* Dataset IDs */ - hid_t sid1,sid2,sid3; /* Dataspace IDs */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t data1,data2; /* Dataset IDs */ + hid_t sid1,sid2,sid3; /* Dataspace IDs */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* 1st buffer read from disk */ *rbuf2, /* 2nd buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); @@ -3782,21 +3782,21 @@ test_select_hyper_copy(void) static void test_select_point_copy(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t data1,data2; /* Dataset IDs */ - hid_t sid1,sid2,sid3; /* Dataspace IDs */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t data1,data2; /* Dataset IDs */ + hid_t sid1,sid2,sid3; /* Dataspace IDs */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* 1st buffer read from disk */ *rbuf2, /* 2nd buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); @@ -3956,24 +3956,24 @@ test_select_point_copy(void) static void test_select_hyper_offset(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ - hssize_t offset[SPACE1_RANK]; /* Offset of selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hssize_t offset[SPACE1_RANK]; /* Offset of selection */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - htri_t valid; /* Generic boolean return value */ + herr_t ret; /* Generic return value */ + htri_t valid; /* Generic boolean return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -4118,21 +4118,21 @@ test_select_hyper_offset(void) static void test_select_hyper_offset2(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t start[SPACE7_RANK]; /* Starting location of hyperslab */ - hsize_t count[SPACE7_RANK]; /* Element count of hyperslab */ - hssize_t offset[SPACE7_RANK]; /* Offset of selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t start[SPACE7_RANK]; /* Starting location of hyperslab */ + hsize_t count[SPACE7_RANK]; /* Element count of hyperslab */ + hssize_t offset[SPACE7_RANK]; /* Offset of selection */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - htri_t valid; /* Generic boolean return value */ + herr_t ret; /* Generic return value */ + htri_t valid; /* Generic boolean return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing More Hyperslab Selection Functions with Offsets\n")); @@ -4239,23 +4239,23 @@ test_select_hyper_offset2(void) static void test_select_point_offset(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ - hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ - hssize_t offset[SPACE1_RANK]; /* Offset of selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ + hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hssize_t offset[SPACE1_RANK]; /* Offset of selection */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - htri_t valid; /* Generic boolean return value */ + herr_t ret; /* Generic return value */ + htri_t valid; /* Generic boolean return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Element Selection Functions\n")); @@ -4411,17 +4411,17 @@ test_select_point_offset(void) static void test_select_hyper_union(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t xfer; /* Dataset Transfer Property List ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t xfer; /* Dataset Transfer Property List ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ size_t begin[SPACE2_DIM1]= /* Offset within irregular block */ {0,0,0,0,0,0,0,0,0,0, /* First ten rows start at offset 0 */ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5}; /* Next eighteen rows start at offset 5 */ @@ -4434,8 +4434,8 @@ test_select_hyper_union(void) *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with unions of hyperslabs\n")); @@ -5079,18 +5079,18 @@ test_select_hyper_union_stagger(void) static void test_select_hyper_union_3d(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t tmp_space; /* Temporary Dataspace ID */ - hid_t tmp2_space; /* Another temporary Dataspace ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; - hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; - hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t tmp_space; /* Temporary Dataspace ID */ + hid_t tmp2_space; /* Another temporary Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ struct row_list { size_t z; size_t y; @@ -5416,22 +5416,22 @@ test_select_hyper_and_2d(void) static void test_select_hyper_xor_2d(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims2[] = {SPACE2A_DIM1}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims2[] = {SPACE2A_DIM1}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with XOR of 2-D hyperslabs\n")); @@ -5547,22 +5547,22 @@ test_select_hyper_xor_2d(void) static void test_select_hyper_notb_2d(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims2[] = {SPACE2A_DIM1}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims2[] = {SPACE2A_DIM1}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTB of 2-D hyperslabs\n")); @@ -5677,22 +5677,22 @@ test_select_hyper_notb_2d(void) static void test_select_hyper_nota_2d(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t dims2[] = {SPACE2A_DIM1}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims2[] = {SPACE2A_DIM1}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ - hssize_t npoints; /* Number of elements in selection */ + herr_t ret; /* Generic return value */ + hssize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTA of 2-D hyperslabs\n")); @@ -6988,15 +6988,15 @@ test_select_hyper_iter3(void *_elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndim static void test_select_fill_all(void) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; unsigned fill_value; /* Fill value */ fill_iter_info iter_info; /* Iterator information structure */ hsize_t points[SPACE7_DIM1*SPACE7_DIM2][SPACE7_RANK]; /* Coordinates of selection */ unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling 'all' Selections\n")); @@ -7062,8 +7062,8 @@ test_select_fill_all(void) static void test_select_fill_point(hssize_t *offset) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */ hsize_t points[5][SPACE7_RANK] = {{2,4}, {3,8}, {8,4}, {7,5}, {7,7}}; size_t num_points = 5; /* Number of points selected */ @@ -7072,7 +7072,7 @@ test_select_fill_point(hssize_t *offset) unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v, w; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling 'point' Selections\n")); @@ -7157,8 +7157,8 @@ test_select_fill_point(hssize_t *offset) static void test_select_fill_hyper_simple(hssize_t *offset) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t count[SPACE7_RANK]; /* Hyperslab block size */ @@ -7169,7 +7169,7 @@ test_select_fill_hyper_simple(hssize_t *offset) unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling Simple 'hyperslab' Selections\n")); @@ -7257,8 +7257,8 @@ test_select_fill_hyper_simple(hssize_t *offset) static void test_select_fill_hyper_regular(hssize_t *offset) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t stride[SPACE7_RANK]; /* Hyperslab stride size */ @@ -7276,7 +7276,7 @@ test_select_fill_hyper_regular(hssize_t *offset) unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v, w; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling Regular 'hyperslab' Selections\n")); @@ -7365,8 +7365,8 @@ test_select_fill_hyper_regular(hssize_t *offset) static void test_select_fill_hyper_irregular(hssize_t *offset) { - hid_t sid1; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t sid1; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t count[SPACE7_RANK]; /* Hyperslab block count */ @@ -7395,7 +7395,7 @@ test_select_fill_hyper_irregular(hssize_t *offset) unsigned *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ unsigned u, v, w; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling Irregular 'hyperslab' Selections\n")); @@ -7488,16 +7488,16 @@ test_select_fill_hyper_irregular(hssize_t *offset) static void test_select_none(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer to read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing I/O on 0-sized Selections\n")); @@ -7586,11 +7586,11 @@ test_select_none(void) static void test_scalar_select(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t count[SPACE7_RANK]; /* Hyperslab block count */ uint8_t *wbuf_uint8, /* buffer to write to disk */ @@ -7600,7 +7600,7 @@ test_scalar_select(void) rval_ushort, /* value read back in */ *tbuf_ushort; /* temporary buffer pointer */ int i,j; /* Counters */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing I/O on Selections in Scalar Dataspaces\n")); @@ -7732,18 +7732,18 @@ test_scalar_select(void) /**************************************************************** ** ** test_scalar_select2(): Tests selections on scalar dataspace, -** verify H5Sselect_hyperslab and H5Sselect_elements fails for -** scalar dataspace. +** verify H5Sselect_hyperslab and H5Sselect_elements fails for +** scalar dataspace. ** ****************************************************************/ static void test_scalar_select2(void) { - hid_t sid; /* Dataspace ID */ - hsize_t coord1[1]; /* Coordinates for point selection */ + hid_t sid; /* Dataspace ID */ + hsize_t coord1[1]; /* Coordinates for point selection */ hsize_t start[1]; /* Hyperslab start */ hsize_t count[1]; /* Hyperslab block count */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(6, ("Testing Selections in Scalar Dataspaces\n")); @@ -7755,7 +7755,7 @@ test_scalar_select2(void) /* Select one element in memory with a point selection */ coord1[0]=0; H5E_BEGIN_TRY { - ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord1); + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord1); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_elements"); @@ -7763,7 +7763,7 @@ test_scalar_select2(void) start[0]=0; count[0]=0; H5E_BEGIN_TRY { - ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,NULL,count,NULL); + ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,NULL,count,NULL); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_hyperslab"); @@ -7789,18 +7789,18 @@ test_scalar_select2(void) static void test_scalar_select3(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; - hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2}; + hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */ hsize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t count[SPACE7_RANK]; /* Hyperslab block count */ uint8_t wval_uint8, /* Value written out */ rval_uint8; /* Value read in */ unsigned short wval_ushort, /* Another value written out */ rval_ushort; /* Another value read in */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing I/O on Selections in Scalar Dataspaces in Memory\n")); @@ -7923,40 +7923,40 @@ test_scalar_select3(void) /**************************************************************** ** ** test_shape_same(): Tests selections on dataspace, verify that -** "shape same" routine is working correctly. +** "shape same" routine is working correctly. ** ****************************************************************/ static void test_shape_same(void) { - hid_t all_sid; /* Dataspace ID with "all" selection */ - hid_t none_sid; /* Dataspace ID with "none" selection */ - hid_t single_pt_sid; /* Dataspace ID with single point selection */ - hid_t mult_pt_sid; /* Dataspace ID with multiple point selection */ - hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ - hid_t single_hyper_all_sid; /* Dataspace ID with single block hyperslab + hid_t all_sid; /* Dataspace ID with "all" selection */ + hid_t none_sid; /* Dataspace ID with "none" selection */ + hid_t single_pt_sid; /* Dataspace ID with single point selection */ + hid_t mult_pt_sid; /* Dataspace ID with multiple point selection */ + hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ + hid_t single_hyper_all_sid; /* Dataspace ID with single block hyperslab * selection that is the entire dataspace */ - hid_t single_hyper_pt_sid; /* Dataspace ID with single block hyperslab + hid_t single_hyper_pt_sid; /* Dataspace ID with single block hyperslab * selection that is the same as the single * point selection */ - hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ - hid_t irreg_hyper_sid; /* Dataspace ID with irregular hyperslab selection */ - hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */ - hid_t scalar_all_sid; /* ID for scalar dataspace with "all" selection */ - hid_t scalar_none_sid; /* ID for scalar dataspace with "none" selection */ - hid_t tmp_sid; /* Temporary dataspace ID */ - hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2}; - hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ - hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */ + hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ + hid_t irreg_hyper_sid; /* Dataspace ID with irregular hyperslab selection */ + hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */ + hid_t scalar_all_sid; /* ID for scalar dataspace with "all" selection */ + hid_t scalar_none_sid; /* ID for scalar dataspace with "none" selection */ + hid_t tmp_sid; /* Temporary dataspace ID */ + hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2}; + hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ + hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */ hsize_t start[SPACE9_RANK]; /* Hyperslab start */ hsize_t stride[SPACE9_RANK]; /* Hyperslab stride */ hsize_t count[SPACE9_RANK]; /* Hyperslab block count */ hsize_t block[SPACE9_RANK]; /* Hyperslab block size */ unsigned u,v; /* Local index variables */ - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(6, ("Testing Same Shape Comparisons\n")); @@ -8399,12 +8399,13 @@ test_shape_same(void) CHECK(tmp_sid, FAIL, "H5Screate_simple"); /* Select sequence of points for point selection */ - for(u=1; u<(SPACE9_DIM1-1); u++) { - for(v=1; v<(SPACE9_DIM2-1); v++) { + for(u = 1; u < (SPACE9_DIM1 - 1); u++) { + for(v = 1; v < (SPACE9_DIM2 - 1); v++) { coord2[v - 1][0] = u; coord2[v - 1][1] = v; } /* end for */ - ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,(SPACE9_DIM2-2),coord2); + + ret = H5Sselect_elements(tmp_sid, H5S_SELECT_APPEND, (SPACE9_DIM2 - 2), coord2); CHECK(ret, FAIL, "H5Sselect_elements"); } /* end for */ @@ -8426,12 +8427,12 @@ test_shape_same(void) CHECK(ret, FAIL, "H5Sselect_none"); /* Select sequence of rows for hyperslab selection */ - for(u=1; u<(SPACE9_DIM1-1); u++) { - start[0]=u; start[1]=1; - stride[0]=1; stride[1]=1; - count[0]=1; count[1]=1; - block[0]=1; block[1]=(SPACE9_DIM2-2); - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block); + for(u = 1; u < (SPACE9_DIM1 - 1); u++) { + start[0] = u; start[1] = 1; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = 1; block[1] = (SPACE9_DIM2 - 2); + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ @@ -8514,12 +8515,12 @@ test_shape_same(void) CHECK(tmp_sid, FAIL, "H5Screate_simple"); /* Select sequence of points for point selection */ - for(u=0; u<SPACE9_DIM1; u++) { - for(v=0; v<SPACE9_DIM2; v++) { + for(u = 0; u < SPACE9_DIM1; u++) { + for(v = 0; v < SPACE9_DIM2; v++) { coord2[v][0] = u; coord2[v][1] = v; } /* end for */ - ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,SPACE9_DIM2,coord2); + ret = H5Sselect_elements(tmp_sid, H5S_SELECT_APPEND, SPACE9_DIM2, coord2); CHECK(ret, FAIL, "H5Sselect_elements"); } /* end for */ @@ -8541,12 +8542,12 @@ test_shape_same(void) CHECK(ret, FAIL, "H5Sselect_none"); /* Select sequence of rows for hyperslab selection */ - for(u=0; u<SPACE9_DIM2; u++) { - start[0]=u; start[1]=0; - stride[0]=1; stride[1]=1; - count[0]=1; count[1]=1; - block[0]=1; block[1]=SPACE9_DIM2; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block); + for(u = 0; u < SPACE9_DIM2; u++) { + start[0] = u; start[1] = 0; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = 1; block[1] = SPACE9_DIM2; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ @@ -8708,11 +8709,11 @@ test_shape_same(void) /* Select sequence of rows for hyperslab selection */ for(u = 2; u < 11; u += 2) { - start[0] = u; start[1] = 3; + start[0] = u; start[1] = 3; stride[0] = 1; stride[1] = 2; - count[0] = 1; count[1] = 2; - block[0] = 1; block[1] = 1; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block); + count[0] = 1; count[1] = 2; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ @@ -8729,11 +8730,11 @@ test_shape_same(void) CHECK(tmp_sid, FAIL, "H5Screate_simple"); /* Select regular, strided hyperslab selection at an offset */ - start[0] = 1; start[1] = 1; + start[0] = 1; start[1] = 1; stride[0] = 2; stride[1] = 2; - count[0] = 5; count[1] = 2; - block[0] = 1; block[1] = 1; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_SET,start,stride,count,block); + count[0] = 5; count[1] = 2; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Compare against hyperslab selection */ @@ -8807,20 +8808,20 @@ test_shape_same(void) tmp_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); CHECK(tmp_sid, FAIL, "H5Screate_simple"); - start[0]=2; start[1]=2; - stride[0]=1; stride[1]=1; - count[0]=1; count[1]=1; - block[0]=1; block[1]=1; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_SET,start,stride,count,block); + start[0] = 2; start[1] = 2; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Select sequence of columns for hyperslab selection */ - for(u=0; u<3; u++) { - start[0]=4; start[1]=u+4; - stride[0]=1; stride[1]=1; - count[0]=1; count[1]=1; - block[0]=3; block[1]=1; - ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block); + for(u = 0; u < 3; u++) { + start[0] = 4; start[1] = u + 4; + stride[0] = 1; stride[1] = 1; + count[0] = 1; count[1] = 1; + block[0] = 3; block[1] = 1; + ret = H5Sselect_hyperslab(tmp_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ @@ -8994,23 +8995,23 @@ test_shape_same(void) ** test_shape_same_dr__smoke_check_1(): ** ** Create a square, 2-D dataspace (10 X 10), and select -** all of it. +** all of it. ** ** Similarly, create nine, 3-D dataspaces (10 X 10 X 10), -** and select (10 X 10 X 1) hyper slabs in each, three with -** the slab parallel to the xy plane, three parallel to the -** xz plane, and three parallel to the yz plane. +** and select (10 X 10 X 1) hyperslabs in each, three with +** the slab parallel to the xy plane, three parallel to the +** xz plane, and three parallel to the yz plane. ** -** Assuming that z is the fastest changing dimension, +** Assuming that z is the fastest changing dimension, ** H5Sselect_shape_same() should return TRUE when comparing ** the full 2-D space against any hyperslab parallel to the ** yz plane in the 3-D space, and FALSE when comparing the ** full 2-D space against the other two hyperslabs. ** ** Also create two additional 3-D dataspaces (10 X 10 X 10), -** and select a (10 X 10 X 2) hyper slab parallel to the yz -** axis in one of them, and two parallel (10 X 10 X 1) hyper -** slabs parallel to the yz axis in the other. +** and select a (10 X 10 X 2) hyperslab parallel to the yz +** axis in one of them, and two parallel (10 X 10 X 1) hyper +** slabs parallel to the yz axis in the other. ** H5Sselect_shape_same() should return FALSE when comparing ** each to the 2-D selection. ** @@ -9018,27 +9019,27 @@ test_shape_same(void) static void test_shape_same_dr__smoke_check_1(void) { - hid_t small_square_sid; - hid_t small_cube_xy_slice_0_sid; - hid_t small_cube_xy_slice_1_sid; - hid_t small_cube_xy_slice_2_sid; - hid_t small_cube_xz_slice_0_sid; - hid_t small_cube_xz_slice_1_sid; - hid_t small_cube_xz_slice_2_sid; - hid_t small_cube_yz_slice_0_sid; - hid_t small_cube_yz_slice_1_sid; - hid_t small_cube_yz_slice_2_sid; - hid_t small_cube_yz_slice_3_sid; - hid_t small_cube_yz_slice_4_sid; - hsize_t small_cube_dims[] = {10, 10, 10}; - hsize_t start[3]; - hsize_t stride[3]; - hsize_t count[3]; - hsize_t block[3]; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ - - MESSAGE(7, (" Smoke check 1: Slices through a cube.\n")); + hid_t small_square_sid; + hid_t small_cube_xy_slice_0_sid; + hid_t small_cube_xy_slice_1_sid; + hid_t small_cube_xy_slice_2_sid; + hid_t small_cube_xz_slice_0_sid; + hid_t small_cube_xz_slice_1_sid; + hid_t small_cube_xz_slice_2_sid; + hid_t small_cube_yz_slice_0_sid; + hid_t small_cube_yz_slice_1_sid; + hid_t small_cube_yz_slice_2_sid; + hid_t small_cube_yz_slice_3_sid; + hid_t small_cube_yz_slice_4_sid; + hsize_t small_cube_dims[] = {10, 10, 10}; + hsize_t start[3]; + hsize_t stride[3]; + hsize_t count[3]; + hsize_t block[3]; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + MESSAGE(7, (" Smoke check 1: Slices through a cube.\n")); /* Create the 10 x 10 dataspace */ small_square_sid = H5Screate_simple(2, small_cube_dims, NULL); @@ -9054,24 +9055,24 @@ test_shape_same_dr__smoke_check_1(void) small_cube_xy_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_xy_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ /* stride is a bit silly here, since we are only selecting a single */ /* contiguous plane, but include it anyway, with values large enough */ /* to ensure that we will only get the single block selected. */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 10; /* x */ - block[1] = 10; /* y */ - block[2] = 1; /* z */ + block[0] = 10; /* x */ + block[1] = 10; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9097,24 +9098,24 @@ test_shape_same_dr__smoke_check_1(void) small_cube_xz_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_xz_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ /* stride is a bit silly here, since we are only selecting a single */ /* contiguous chunk, but include it anyway, with values large enough */ /* to ensure that we will only get the single chunk. */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 10; /* x */ - block[1] = 1; /* y */ - block[2] = 10; /* z */ + block[0] = 10; /* x */ + block[1] = 1; /* y */ + block[2] = 10; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9146,24 +9147,24 @@ test_shape_same_dr__smoke_check_1(void) small_cube_yz_slice_4_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_yz_slice_4_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ /* stride is a bit silly here, since we are only selecting a single */ /* contiguous chunk, but include it anyway, with values large enough */ /* to ensure that we will only get the single chunk. */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 1; /* x */ - block[1] = 10; /* y */ - block[2] = 10; /* z */ + block[0] = 1; /* x */ + block[1] = 10; /* y */ + block[2] = 10; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); @@ -9285,39 +9286,39 @@ test_shape_same_dr__smoke_check_1(void) ** test_shape_same_dr__smoke_check_2(): ** ** Create a square, 2-D dataspace (10 X 10), and select -** a "checker board" hyper slab as follows: +** a "checker board" hyperslab as follows: ** -** * * - - * * - - * * +** * * - - * * - - * * ** * * - - * * - - * * ** - - * * - - * * - - ** - - * * - - * * - - -** * * - - * * - - * * +** * * - - * * - - * * ** * * - - * * - - * * ** - - * * - - * * - - ** - - * * - - * * - - -** * * - - * * - - * * +** * * - - * * - - * * ** * * - - * * - - * * ** -** where asterisks indicate selected elements, and dashes -** indicate unselected elements. +** where asterisks indicate selected elements, and dashes +** indicate unselected elements. ** ** Similarly, create nine, 3-D dataspaces (10 X 10 X 10), -** and select similar (10 X 10 X 1) checker board hyper -** slabs in each, three with the slab parallel to the xy -** plane, three parallel to the xz plane, and three parallel -** to the yz plane. +** and select similar (10 X 10 X 1) checker board hyper +** slabs in each, three with the slab parallel to the xy +** plane, three parallel to the xz plane, and three parallel +** to the yz plane. ** -** Assuming that z is the fastest changing dimension, +** Assuming that z is the fastest changing dimension, ** H5Sselect_shape_same() should return TRUE when comparing ** the 2-D space checker board selection against a checker ** board hyperslab parallel to the yz plane in the 3-D ** space, and FALSE when comparing the 2-D checkerboard -** selection against two hyper slabs parallel to the xy -** or xz planes. +** selection against two hyperslabs parallel to the xy +** or xz planes. ** ** Also create an additional 3-D dataspaces (10 X 10 X 10), -** and select a checker board parallel with the yz axis, -** save with some squares being on different planes. +** and select a checker board parallel with the yz axis, +** save with some squares being on different planes. ** H5Sselect_shape_same() should return FALSE when ** comparing this selection to the 2-D selection. ** @@ -9325,57 +9326,57 @@ test_shape_same_dr__smoke_check_1(void) static void test_shape_same_dr__smoke_check_2(void) { - hid_t small_square_sid; - hid_t small_cube_xy_slice_0_sid; - hid_t small_cube_xy_slice_1_sid; - hid_t small_cube_xy_slice_2_sid; - hid_t small_cube_xz_slice_0_sid; - hid_t small_cube_xz_slice_1_sid; - hid_t small_cube_xz_slice_2_sid; - hid_t small_cube_yz_slice_0_sid; - hid_t small_cube_yz_slice_1_sid; - hid_t small_cube_yz_slice_2_sid; - hid_t small_cube_yz_slice_3_sid; - hsize_t small_cube_dims[] = {10, 10, 10}; - hsize_t start[3]; - hsize_t stride[3]; - hsize_t count[3]; - hsize_t block[3]; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ - - MESSAGE(7, (" Smoke check 2: Checker board slices through a cube.\n")); + hid_t small_square_sid; + hid_t small_cube_xy_slice_0_sid; + hid_t small_cube_xy_slice_1_sid; + hid_t small_cube_xy_slice_2_sid; + hid_t small_cube_xz_slice_0_sid; + hid_t small_cube_xz_slice_1_sid; + hid_t small_cube_xz_slice_2_sid; + hid_t small_cube_yz_slice_0_sid; + hid_t small_cube_yz_slice_1_sid; + hid_t small_cube_yz_slice_2_sid; + hid_t small_cube_yz_slice_3_sid; + hsize_t small_cube_dims[] = {10, 10, 10}; + hsize_t start[3]; + hsize_t stride[3]; + hsize_t count[3]; + hsize_t block[3]; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + MESSAGE(7, (" Smoke check 2: Checker board slices through a cube.\n")); /* Create the 10 x 10 dataspace */ small_square_sid = H5Screate_simple(2, small_cube_dims, NULL); CHECK(small_square_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ - stride[0] = 4; /* x */ - stride[1] = 4; /* y */ + stride[0] = 4; /* x */ + stride[1] = 4; /* y */ - count[0] = 3; /* x */ - count[1] = 3; /* y */ + count[0] = 3; /* x */ + count[1] = 3; /* y */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 2; /* x */ - start[1] = 2; /* y */ + start[0] = 2; /* x */ + start[1] = 2; /* y */ - stride[0] = 4; /* x */ - stride[1] = 4; /* y */ + stride[0] = 4; /* x */ + stride[1] = 4; /* y */ - count[0] = 2; /* x */ - count[1] = 2; /* y */ + count[0] = 2; /* x */ + count[1] = 2; /* y */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9392,21 +9393,21 @@ test_shape_same_dr__smoke_check_2(void) CHECK(small_cube_xy_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ - stride[0] = 4; /* x */ - stride[1] = 4; /* y */ - stride[2] = 20; /* z -- large enough that there will only be one slice */ + stride[0] = 4; /* x */ + stride[1] = 4; /* y */ + stride[2] = 20; /* z -- large enough that there will only be one slice */ - count[0] = 3; /* x */ - count[1] = 3; /* y */ - count[2] = 1; /* z */ + count[0] = 3; /* x */ + count[1] = 3; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ - block[2] = 1; /* z */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9422,21 +9423,21 @@ test_shape_same_dr__smoke_check_2(void) CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 2; /* x */ - start[1] = 2; /* y */ - start[2] = 0; /* z */ + start[0] = 2; /* x */ + start[1] = 2; /* y */ + start[2] = 0; /* z */ - stride[0] = 4; /* x */ - stride[1] = 4; /* y */ - stride[2] = 20; /* z -- large enough that there will only be one slice */ + stride[0] = 4; /* x */ + stride[1] = 4; /* y */ + stride[2] = 20; /* z -- large enough that there will only be one slice */ - count[0] = 2; /* x */ - count[1] = 2; /* y */ - count[2] = 1; /* z */ + count[0] = 2; /* x */ + count[1] = 2; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ - block[2] = 1; /* z */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9463,21 +9464,21 @@ test_shape_same_dr__smoke_check_2(void) CHECK(small_cube_xz_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ - stride[0] = 4; /* x */ - stride[1] = 20; /* y -- large enough that there will only be one slice */ - stride[2] = 4; /* z */ + stride[0] = 4; /* x */ + stride[1] = 20; /* y -- large enough that there will only be one slice */ + stride[2] = 4; /* z */ - count[0] = 3; /* x */ - count[1] = 1; /* y */ - count[2] = 3; /* z */ + count[0] = 3; /* x */ + count[1] = 1; /* y */ + count[2] = 3; /* z */ - block[0] = 2; /* x */ - block[1] = 1; /* y */ - block[2] = 2; /* z */ + block[0] = 2; /* x */ + block[1] = 1; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9492,21 +9493,21 @@ test_shape_same_dr__smoke_check_2(void) start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 2; /* x */ - start[1] = 0; /* y */ - start[2] = 2; /* z */ + start[0] = 2; /* x */ + start[1] = 0; /* y */ + start[2] = 2; /* z */ - stride[0] = 4; /* x */ - stride[1] = 20; /* y -- large enough that there will only be one slice */ - stride[2] = 4; /* z */ + stride[0] = 4; /* x */ + stride[1] = 20; /* y -- large enough that there will only be one slice */ + stride[2] = 4; /* z */ - count[0] = 2; /* x */ - count[1] = 1; /* y */ - count[2] = 2; /* z */ + count[0] = 2; /* x */ + count[1] = 1; /* y */ + count[2] = 2; /* z */ - block[0] = 2; /* x */ - block[1] = 1; /* y */ - block[2] = 2; /* z */ + block[0] = 2; /* x */ + block[1] = 1; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9535,21 +9536,21 @@ test_shape_same_dr__smoke_check_2(void) small_cube_yz_slice_3_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_yz_slice_3_sid, FAIL, "H5Screate_simple"); - start[0] = 0; /* x */ - start[1] = 0; /* y */ - start[2] = 0; /* z */ + start[0] = 0; /* x */ + start[1] = 0; /* y */ + start[2] = 0; /* z */ stride[0] = 20; /* x -- large enough that there will only be one slice */ stride[1] = 4; /* y */ stride[2] = 4; /* z */ - count[0] = 1; /* x */ - count[1] = 3; /* y */ - count[2] = 3; /* z */ + count[0] = 1; /* x */ + count[1] = 3; /* y */ + count[2] = 3; /* z */ - block[0] = 1; /* x */ - block[1] = 2; /* y */ - block[2] = 2; /* z */ + block[0] = 1; /* x */ + block[1] = 2; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9570,21 +9571,21 @@ test_shape_same_dr__smoke_check_2(void) CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 0; /* x */ - start[1] = 2; /* y */ - start[2] = 2; /* z */ + start[0] = 0; /* x */ + start[1] = 2; /* y */ + start[2] = 2; /* z */ - stride[0] = 20; /* x -- large enough that there will only be one slice */ - stride[1] = 4; /* y */ - stride[2] = 4; /* z */ + stride[0] = 20; /* x -- large enough that there will only be one slice */ + stride[1] = 4; /* y */ + stride[2] = 4; /* z */ - count[0] = 1; /* x */ - count[1] = 2; /* y */ - count[2] = 2; /* z */ + count[0] = 1; /* x */ + count[1] = 2; /* y */ + count[2] = 2; /* z */ - block[0] = 1; /* x */ - block[1] = 2; /* y */ - block[2] = 2; /* z */ + block[0] = 1; /* x */ + block[1] = 2; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9693,108 +9694,108 @@ test_shape_same_dr__smoke_check_2(void) ** test_shape_same_dr__smoke_check_3(): ** ** Create a square, 2-D dataspace (10 X 10), and select an -** irregular hyper slab as follows: -** -** y -** 9 - - - - - - - - - - -** 8 - - - - - - - - - - -** 7 - - - * * * * - - - -** 6 - - * * * * * - - - -** 5 - - * * - - - - - - -** 4 - - * * - * * - - - -** 3 - - * * - * * - - - -** 2 - - - - - - - - - - -** 1 - - - - - - - - - - -** 0 - - - - - - - - - - +** irregular hyperslab as follows: +** +** y +** 9 - - - - - - - - - - +** 8 - - - - - - - - - - +** 7 - - - * * * * - - - +** 6 - - * * * * * - - - +** 5 - - * * - - - - - - +** 4 - - * * - * * - - - +** 3 - - * * - * * - - - +** 2 - - - - - - - - - - +** 1 - - - - - - - - - - +** 0 - - - - - - - - - - ** 0 1 2 3 4 5 6 7 8 9 x ** -** where asterisks indicate selected elements, and dashes -** indicate unselected elements. +** where asterisks indicate selected elements, and dashes +** indicate unselected elements. ** ** Similarly, create nine, 3-D dataspaces (10 X 10 X 10), -** and select similar irregular hyper slabs in each, three -** with the slab parallel to the xy plane, three parallel -** to the xz plane, and three parallel to the yz plane. -** Further, translate the irregular slab in 2/3rds of the -** cases. +** and select similar irregular hyperslabs in each, three +** with the slab parallel to the xy plane, three parallel +** to the xz plane, and three parallel to the yz plane. +** Further, translate the irregular slab in 2/3rds of the +** cases. ** -** Assuming that z is the fastest changing dimension, +** Assuming that z is the fastest changing dimension, ** H5Sselect_shape_same() should return TRUE when ** comparing the 2-D irregular hyperslab selection -** against the irregular hyperslab selections parallel +** against the irregular hyperslab selections parallel ** to the yz plane in the 3-D space, and FALSE when -** comparing it against the irregular hyper slabs -** selections parallel to the xy or xz planes. +** comparing it against the irregular hyperslabs +** selections parallel to the xy or xz planes. ** ****************************************************************/ static void test_shape_same_dr__smoke_check_3(void) { - hid_t small_square_sid; - hid_t small_cube_xy_slice_0_sid; - hid_t small_cube_xy_slice_1_sid; - hid_t small_cube_xy_slice_2_sid; - hid_t small_cube_xz_slice_0_sid; - hid_t small_cube_xz_slice_1_sid; - hid_t small_cube_xz_slice_2_sid; - hid_t small_cube_yz_slice_0_sid; - hid_t small_cube_yz_slice_1_sid; - hid_t small_cube_yz_slice_2_sid; - hsize_t small_cube_dims[] = {10, 10, 10}; - hsize_t start[3]; - hsize_t stride[3]; - hsize_t count[3]; - hsize_t block[3]; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ - - MESSAGE(7, (" Smoke check 3: Offset subsets of slices through a cube.\n")); + hid_t small_square_sid; + hid_t small_cube_xy_slice_0_sid; + hid_t small_cube_xy_slice_1_sid; + hid_t small_cube_xy_slice_2_sid; + hid_t small_cube_xz_slice_0_sid; + hid_t small_cube_xz_slice_1_sid; + hid_t small_cube_xz_slice_2_sid; + hid_t small_cube_yz_slice_0_sid; + hid_t small_cube_yz_slice_1_sid; + hid_t small_cube_yz_slice_2_sid; + hsize_t small_cube_dims[] = {10, 10, 10}; + hsize_t start[3]; + hsize_t stride[3]; + hsize_t count[3]; + hsize_t block[3]; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + MESSAGE(7, (" Smoke check 3: Offset subsets of slices through a cube.\n")); /* Create the 10 x 10 dataspace */ small_square_sid = H5Screate_simple(2, small_cube_dims, NULL); CHECK(small_square_sid, FAIL, "H5Screate_simple"); - start[0] = 2; /* x */ - start[1] = 3; /* y */ + start[0] = 2; /* x */ + start[1] = 3; /* y */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ - block[0] = 2; /* x */ - block[1] = 4; /* y */ + block[0] = 2; /* x */ + block[1] = 4; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 3; /* x */ - start[1] = 6; /* y */ + start[0] = 3; /* x */ + start[1] = 6; /* y */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ - block[0] = 4; /* x */ - block[1] = 2; /* y */ + block[0] = 4; /* x */ + block[1] = 2; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 5; /* x */ - start[1] = 3; /* y */ + start[0] = 5; /* x */ + start[1] = 3; /* y */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ ret = H5Sselect_hyperslab(small_square_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9811,101 +9812,101 @@ test_shape_same_dr__smoke_check_3(void) CHECK(small_cube_xy_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 2; /* x */ - start[1] = 3; /* y */ - start[2] = 5; /* z */ + start[0] = 2; /* x */ + start[1] = 3; /* y */ + start[2] = 5; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 4; /* y */ - block[2] = 1; /* z */ + block[0] = 2; /* x */ + block[1] = 4; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[1] -= 2; /* y */ + start[0] -= 1; /* x */ + start[1] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_1_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[1] += 5; /* y */ + start[0] += 5; /* x */ + start[1] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_2_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 3; /* x */ - start[1] = 6; /* y */ - start[2] = 5; /* z */ + start[0] = 3; /* x */ + start[1] = 6; /* y */ + start[2] = 5; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 4; /* x */ - block[1] = 2; /* y */ - block[2] = 1; /* z */ + block[0] = 4; /* x */ + block[1] = 2; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[1] -= 2; /* y */ + start[0] -= 1; /* x */ + start[1] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[1] += 5; /* y */ + start[0] += 5; /* x */ + start[1] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 5; /* x */ - start[1] = 3; /* y */ - start[2] = 5; /* z */ + start[0] = 5; /* x */ + start[1] = 3; /* y */ + start[2] = 5; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 2; /* y */ - block[2] = 1; /* z */ + block[0] = 2; /* x */ + block[1] = 2; /* y */ + block[2] = 1; /* z */ ret = H5Sselect_hyperslab(small_cube_xy_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[1] -= 2; /* y */ + start[0] -= 1; /* x */ + start[1] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[1] += 5; /* y */ + start[0] += 5; /* x */ + start[1] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xy_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -9921,101 +9922,101 @@ test_shape_same_dr__smoke_check_3(void) small_cube_xz_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_xz_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 2; /* x */ - start[1] = 5; /* y */ - start[2] = 3; /* z */ + start[0] = 2; /* x */ + start[1] = 5; /* y */ + start[2] = 3; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 1; /* y */ - block[2] = 4; /* z */ + block[0] = 2; /* x */ + block[1] = 1; /* y */ + block[2] = 4; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[2] -= 2; /* y */ + start[0] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_1_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_2_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 3; /* x */ - start[1] = 5; /* y */ - start[2] = 6; /* z */ + start[0] = 3; /* x */ + start[1] = 5; /* y */ + start[2] = 6; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 4; /* x */ - block[1] = 1; /* y */ - block[2] = 2; /* z */ + block[0] = 4; /* x */ + block[1] = 1; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[2] -= 2; /* y */ + start[0] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 5; /* x */ - start[1] = 5; /* y */ - start[2] = 3; /* z */ + start[0] = 5; /* x */ + start[1] = 5; /* y */ + start[2] = 3; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 2; /* x */ - block[1] = 1; /* y */ - block[2] = 2; /* z */ + block[0] = 2; /* x */ + block[1] = 1; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_xz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[0] -= 1; /* x */ - start[2] -= 2; /* y */ + start[0] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_xz_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -10033,101 +10034,101 @@ test_shape_same_dr__smoke_check_3(void) small_cube_yz_slice_2_sid = H5Screate_simple(3, small_cube_dims, NULL); CHECK(small_cube_yz_slice_2_sid, FAIL, "H5Screate_simple"); - start[0] = 8; /* x */ - start[1] = 2; /* y */ - start[2] = 3; /* z */ + start[0] = 8; /* x */ + start[1] = 2; /* y */ + start[2] = 3; /* z */ - stride[0] = 20; /* x -- large enough that there will only be one slice */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x -- large enough that there will only be one slice */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 1; /* x */ - block[1] = 2; /* y */ - block[2] = 4; /* z */ + block[0] = 1; /* x */ + block[1] = 2; /* y */ + block[2] = 4; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[1] -= 1; /* x */ - start[2] -= 2; /* y */ + start[1] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_1_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_2_sid, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 8; /* x */ - start[1] = 3; /* y */ - start[2] = 6; /* z */ + start[0] = 8; /* x */ + start[1] = 3; /* y */ + start[2] = 6; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 1; /* x */ - block[1] = 4; /* y */ - block[2] = 2; /* z */ + block[0] = 1; /* x */ + block[1] = 4; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[1] -= 1; /* x */ - start[2] -= 2; /* y */ + start[1] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - start[0] = 8; /* x */ - start[1] = 5; /* y */ - start[2] = 3; /* z */ + start[0] = 8; /* x */ + start[1] = 5; /* y */ + start[2] = 3; /* z */ - stride[0] = 20; /* x */ - stride[1] = 20; /* y */ - stride[2] = 20; /* z */ + stride[0] = 20; /* x */ + stride[1] = 20; /* y */ + stride[2] = 20; /* z */ - count[0] = 1; /* x */ - count[1] = 1; /* y */ - count[2] = 1; /* z */ + count[0] = 1; /* x */ + count[1] = 1; /* y */ + count[2] = 1; /* z */ - block[0] = 1; /* x */ - block[1] = 2; /* y */ - block[2] = 2; /* z */ + block[0] = 1; /* x */ + block[1] = 2; /* y */ + block[2] = 2; /* z */ ret = H5Sselect_hyperslab(small_cube_yz_slice_0_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the starting point to the origin */ - start[1] -= 1; /* x */ - start[2] -= 2; /* y */ + start[1] -= 1; /* x */ + start[2] -= 2; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_1_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* move the irregular selection to the upper right hand corner */ - start[0] += 5; /* x */ - start[2] += 5; /* y */ + start[0] += 5; /* x */ + start[2] += 5; /* y */ ret = H5Sselect_hyperslab(small_cube_yz_slice_2_sid, H5S_SELECT_OR, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -10201,7 +10202,6 @@ test_shape_same_dr__smoke_check_3(void) ret = H5Sclose(small_cube_yz_slice_2_sid); CHECK(ret, FAIL, "H5Sclose"); - } /* test_shape_same_dr__smoke_check_3() */ @@ -10210,78 +10210,78 @@ test_shape_same_dr__smoke_check_3(void) ** test_shape_same_dr__smoke_check_4(): ** ** Create a square, 2-D dataspace (10 X 10), and select -** the entire space. +** the entire space. ** ** Similarly, create 3-D and 4-D dataspaces: ** -** (1 X 10 X 10) -** (10 X 1 X 10) -** (10 X 10 X 1) -** (10 X 10 X 10) +** (1 X 10 X 10) +** (10 X 1 X 10) +** (10 X 10 X 1) +** (10 X 10 X 10) ** -** (1 X 1 X 10 X 10) -** (1 X 10 X 1 X 10) -** (1 X 10 X 10 X 1) -** (10 X 1 X 1 X 10) -** (10 X 1 X 10 X 1) -** (10 X 10 X 1 X 1) -** (10 X 1 X 10 X 10) +** (1 X 1 X 10 X 10) +** (1 X 10 X 1 X 10) +** (1 X 10 X 10 X 1) +** (10 X 1 X 1 X 10) +** (10 X 1 X 10 X 1) +** (10 X 10 X 1 X 1) +** (10 X 1 X 10 X 10) ** -** And select these entire spaces as well. +** And select these entire spaces as well. ** ** Compare the 2-D space against all the other spaces ** with H5Sselect_shape_same(). The (1 X 10 X 10) & -** (1 X 1 X 10 X 10) should return TRUE. All others -** should return FALSE. +** (1 X 1 X 10 X 10) should return TRUE. All others +** should return FALSE. ** ****************************************************************/ static void test_shape_same_dr__smoke_check_4(void) { - hid_t square_sid; - hid_t three_d_space_0_sid; - hid_t three_d_space_1_sid; - hid_t three_d_space_2_sid; - hid_t three_d_space_3_sid; - hid_t four_d_space_0_sid; - hid_t four_d_space_1_sid; - hid_t four_d_space_2_sid; - hid_t four_d_space_3_sid; - hid_t four_d_space_4_sid; - hid_t four_d_space_5_sid; - hid_t four_d_space_6_sid; - hsize_t dims[] = {10, 10, 10, 10}; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ - - MESSAGE(7, (" Smoke check 4: Spaces of different dimension but same size.\n")); + hid_t square_sid; + hid_t three_d_space_0_sid; + hid_t three_d_space_1_sid; + hid_t three_d_space_2_sid; + hid_t three_d_space_3_sid; + hid_t four_d_space_0_sid; + hid_t four_d_space_1_sid; + hid_t four_d_space_2_sid; + hid_t four_d_space_3_sid; + hid_t four_d_space_4_sid; + hid_t four_d_space_5_sid; + hid_t four_d_space_6_sid; + hsize_t dims[] = {10, 10, 10, 10}; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + MESSAGE(7, (" Smoke check 4: Spaces of different dimension but same size.\n")); /* Create the 10 x 10 dataspace */ square_sid = H5Screate_simple(2, dims, NULL); CHECK(square_sid, FAIL, "H5Screate_simple"); - /* create (1 X 10 X 10) data space */ + /* create (1 X 10 X 10) dataspace */ dims[0] = 1; dims[1] = 10; dims[2] = 10; three_d_space_0_sid = H5Screate_simple(3, dims, NULL); CHECK(three_d_space_0_sid, FAIL, "H5Screate_simple"); - /* create (10 X 1 X 10) data space */ + /* create (10 X 1 X 10) dataspace */ dims[0] = 10; dims[1] = 1; dims[2] = 10; three_d_space_1_sid = H5Screate_simple(3, dims, NULL); CHECK(three_d_space_1_sid, FAIL, "H5Screate_simple"); - /* create (10 X 10 X 1) data space */ + /* create (10 X 10 X 1) dataspace */ dims[0] = 10; dims[1] = 10; dims[2] = 1; three_d_space_2_sid = H5Screate_simple(3, dims, NULL); CHECK(three_d_space_2_sid, FAIL, "H5Screate_simple"); - /* create (10 X 10 X 10) data space */ + /* create (10 X 10 X 10) dataspace */ dims[0] = 10; dims[1] = 10; dims[2] = 10; @@ -10289,7 +10289,7 @@ test_shape_same_dr__smoke_check_4(void) CHECK(three_d_space_3_sid, FAIL, "H5Screate_simple"); - /* create (1 X 1 X 10 X 10) data space */ + /* create (1 X 1 X 10 X 10) dataspace */ dims[0] = 1; dims[1] = 1; dims[2] = 10; @@ -10297,7 +10297,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_0_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_0_sid, FAIL, "H5Screate_simple"); - /* create (1 X 10 X 1 X 10) data space */ + /* create (1 X 10 X 1 X 10) dataspace */ dims[0] = 1; dims[1] = 10; dims[2] = 1; @@ -10305,7 +10305,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_1_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_1_sid, FAIL, "H5Screate_simple"); - /* create (1 X 10 X 10 X 1) data space */ + /* create (1 X 10 X 10 X 1) dataspace */ dims[0] = 1; dims[1] = 10; dims[2] = 10; @@ -10313,7 +10313,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_2_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_2_sid, FAIL, "H5Screate_simple"); - /* create (10 X 1 X 1 X 10) data space */ + /* create (10 X 1 X 1 X 10) dataspace */ dims[0] = 10; dims[1] = 1; dims[2] = 1; @@ -10321,7 +10321,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_3_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_3_sid, FAIL, "H5Screate_simple"); - /* create (10 X 1 X 10 X 1) data space */ + /* create (10 X 1 X 10 X 1) dataspace */ dims[0] = 10; dims[1] = 1; dims[2] = 10; @@ -10329,7 +10329,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_4_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_4_sid, FAIL, "H5Screate_simple"); - /* create (10 X 10 X 1 X 1) data space */ + /* create (10 X 10 X 1 X 1) dataspace */ dims[0] = 10; dims[1] = 10; dims[2] = 1; @@ -10337,7 +10337,7 @@ test_shape_same_dr__smoke_check_4(void) four_d_space_5_sid = H5Screate_simple(4, dims, NULL); CHECK(four_d_space_5_sid, FAIL, "H5Screate_simple"); - /* create (10 X 1 X 10 X 10) data space */ + /* create (10 X 1 X 10 X 10) dataspace */ dims[0] = 10; dims[1] = 1; dims[2] = 10; @@ -10427,15 +10427,15 @@ test_shape_same_dr__smoke_check_4(void) /**************************************************************** ** ** test_shape_same_dr__full_space_vs_slice(): Tests selection -** of a full n-cube data space vs an n-dimensional slice of +** of a full n-cube dataspace vs an n-dimensional slice of ** of an m-cube (m > n) in a call to H5Sselect_shape_same(). -** Note that this test does not require the n-cube and the -** n-dimensional slice to have the same rank (although +** Note that this test does not require the n-cube and the +** n-dimensional slice to have the same rank (although ** H5Sselect_shape_same() should always return FALSE if -** they don't). +** they don't). ** -** Per Quincey's suggestion, only test up to 5 dimensional -** spaces. +** Per Quincey's suggestion, only test up to 5 dimensional +** spaces. ** ****************************************************************/ static void @@ -10447,22 +10447,22 @@ test_shape_same_dr__full_space_vs_slice(int test_num, hbool_t dim_selected[], hbool_t expected_result) { - char test_desc_0[128]; - char test_desc_1[256]; + char test_desc_0[128]; + char test_desc_1[256]; int i; - hid_t n_cube_0_sid; /* the fully selected hyper cube */ - hid_t n_cube_1_sid; /* the hyper cube in which a slice is selected */ - hsize_t dims[SS_DR_MAX_RANK]; - hsize_t start[SS_DR_MAX_RANK]; - hsize_t * start_ptr; - hsize_t stride[SS_DR_MAX_RANK]; - hsize_t * stride_ptr; - hsize_t count[SS_DR_MAX_RANK]; - hsize_t * count_ptr; - hsize_t block[SS_DR_MAX_RANK]; - hsize_t * block_ptr; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + hid_t n_cube_0_sid; /* the fully selected hyper cube */ + hid_t n_cube_1_sid; /* the hyper cube in which a slice is selected */ + hsize_t dims[SS_DR_MAX_RANK]; + hsize_t start[SS_DR_MAX_RANK]; + hsize_t * start_ptr; + hsize_t stride[SS_DR_MAX_RANK]; + hsize_t * stride_ptr; + hsize_t count[SS_DR_MAX_RANK]; + hsize_t * count_ptr; + hsize_t block[SS_DR_MAX_RANK]; + hsize_t * block_ptr; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ HDassert( 0 < small_rank ); HDassert( small_rank <= large_rank ); @@ -10536,7 +10536,7 @@ test_shape_same_dr__full_space_vs_slice(int test_num, block_ptr = &(block[i]); - /* select the hyper slab */ + /* select the hyperslab */ ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_SET, start_ptr, stride_ptr, count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -10553,7 +10553,6 @@ test_shape_same_dr__full_space_vs_slice(int test_num, ret = H5Sclose(n_cube_1_sid); CHECK(ret, FAIL, "H5Sclose"); - } /* test_shape_same_dr__full_space_vs_slice() */ @@ -10562,25 +10561,25 @@ test_shape_same_dr__full_space_vs_slice(int test_num, ** test_shape_same_dr__run_full_space_vs_slice_tests(): ** ** Run the test_shape_same_dr__full_space_vs_slice() test -** over a variety of ranks and offsets. +** over a variety of ranks and offsets. ** ** At present, we test H5Sselect_shape_same() with -** fully selected 1, 2, 3, and 4 cubes as one parameter, and -** 1, 2, 3, and 4 dimensional slices through a n-cube of rank -** no more than 5 (and at least the rank of the slice). -** We stop at rank 5, as Quincey suggested that it would be -** sufficient. +** fully selected 1, 2, 3, and 4 cubes as one parameter, and +** 1, 2, 3, and 4 dimensional slices through a n-cube of rank +** no more than 5 (and at least the rank of the slice). +** We stop at rank 5, as Quincey suggested that it would be +** sufficient. ** -** All the n-cubes will have lengths of the same size, so +** All the n-cubes will have lengths of the same size, so ** H5Sselect_shape_same() should return true iff: ** -** 1) the rank for the fully selected n cube equals the +** 1) the rank for the fully selected n cube equals the ** number of dimensions selected in the slice through the ** m-cube (m >= n). ** -** 2) The dimensions selected in the slice through the m-cube -** are the dimesnions with the most quickly changing -** indices. +** 2) The dimensions selected in the slice through the m-cube +** are the dimesnions with the most quickly changing +** indices. ** ****************************************************************/ static void @@ -10702,7 +10701,6 @@ test_shape_same_dr__run_full_space_vs_slice_tests(void) } while((v < 2) && (large_rank >= 5)); } /* end for */ } /* end for */ - } /* test_shape_same_dr__run_full_space_vs_slice_tests() */ @@ -10718,8 +10716,8 @@ test_shape_same_dr__run_full_space_vs_slice_tests(void) ** H5S_select_shape_same() should always return FALSE if ** they don't). ** -** Per Quincey's suggestion, only test up to 5 dimensional -** spaces. +** Per Quincey's suggestion, only test up to 5 dimensional +** spaces. ** ****************************************************************/ static void @@ -10732,31 +10730,31 @@ test_shape_same_dr__checkerboard(int test_num, hbool_t dim_selected[], hbool_t expected_result) { - char test_desc_0[128]; - char test_desc_1[256]; + char test_desc_0[128]; + char test_desc_1[256]; int i; - int dims_selected = 0; - hid_t n_cube_0_sid; /* the checker board selected + int dims_selected = 0; + hid_t n_cube_0_sid; /* the checker board selected * hyper cube */ - hid_t n_cube_1_sid; /* the hyper cube in which a + hid_t n_cube_1_sid; /* the hyper cube in which a * checkerboard slice is selected */ - hsize_t dims[SS_DR_MAX_RANK]; - hsize_t base_start[2]; - hsize_t start[SS_DR_MAX_RANK]; - hsize_t * start_ptr; - hsize_t base_stride[2]; - hsize_t stride[SS_DR_MAX_RANK]; - hsize_t * stride_ptr; - hsize_t base_count[2]; - hsize_t count[SS_DR_MAX_RANK]; - hsize_t * count_ptr; - hsize_t base_block[2]; - hsize_t block[SS_DR_MAX_RANK]; - hsize_t * block_ptr; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + hsize_t dims[SS_DR_MAX_RANK]; + hsize_t base_start[2]; + hsize_t start[SS_DR_MAX_RANK]; + hsize_t * start_ptr; + hsize_t base_stride[2]; + hsize_t stride[SS_DR_MAX_RANK]; + hsize_t * stride_ptr; + hsize_t base_count[2]; + hsize_t count[SS_DR_MAX_RANK]; + hsize_t * count_ptr; + hsize_t base_block[2]; + hsize_t block[SS_DR_MAX_RANK]; + hsize_t * block_ptr; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ HDassert( 0 < small_rank ); HDassert( small_rank <= large_rank ); @@ -10805,19 +10803,19 @@ test_shape_same_dr__checkerboard(int test_num, * * In the 1-D case, the "checkerboard" would look like this: * - * * * - - * * - - * * + * * * - - * * - - * * * * and in the 2-D case, it would look like this: * - * * * - - * * - - * * + * * * - - * * - - * * * * * - - * * - - * * * - - * * - - * * - - * - - * * - - * * - - - * * * - - * * - - * * + * * * - - * * - - * * * * * - - * * - - * * * - - * * - - * * - - * - - * * - - * * - - - * * * - - * * - - * * + * * * - - * * - - * * * * * - - * * - - * * * * In both cases, asterisks indicate selected elements, @@ -10833,9 +10831,9 @@ test_shape_same_dr__checkerboard(int test_num, * are not even divisors of the edge size -- thus * something like the following is also possible: * - * * * * - - - * * * - - * * * * - - - * * * - - * * * * - - - * * * - + * * * * - - - * * * - + * * * * - - - * * * - + * * * * - - - * * * - * - - - * * * - - - * * - - - * * * - - - * * - - - * * * - - - * @@ -10871,7 +10869,7 @@ test_shape_same_dr__checkerboard(int test_num, base_count[0] = edge_size / (checker_size * 2); if((edge_size % (checker_size * 2)) > 0) - base_count[0]++; + base_count[0]++; base_count[1] = (edge_size - checker_size) / (checker_size * 2); if(((edge_size - checker_size) % (checker_size * 2)) > 0) @@ -10918,8 +10916,8 @@ test_shape_same_dr__checkerboard(int test_num, /* Wierdness alert: * * Some how, it seems that selections can extend beyond the - * boundaries of the target data space -- hence the following - * code to manually clip the selection back to the data space + * boundaries of the target dataspace -- hence the following + * code to manually clip the selection back to the dataspace * proper. */ for(i = 0; i < SS_DR_MAX_RANK; i++) { @@ -10980,7 +10978,7 @@ test_shape_same_dr__checkerboard(int test_num, count_ptr = &(count[i]); block_ptr = &(block[i]); - /* select the hyper slab */ + /* select the hyperslab */ ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_SET, start_ptr, stride_ptr, count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -11019,8 +11017,8 @@ test_shape_same_dr__checkerboard(int test_num, /* Wierdness alert: * * Again, it seems that selections can extend beyond the - * boundaries of the target data space -- hence the following - * code to manually clip the selection back to the data space + * boundaries of the target dataspace -- hence the following + * code to manually clip the selection back to the dataspace * proper. */ for(i = 0; i < SS_DR_MAX_RANK; i++) { @@ -11316,7 +11314,6 @@ test_shape_same_dr__run_checkerboard_tests(void) } while((v < 2) && (large_rank >= 5)); } /* end for */ } /* end for */ - } /* test_shape_same_dr__run_checkerboard_tests() */ @@ -11344,71 +11341,71 @@ test_shape_same_dr__irregular(int test_num, hbool_t dim_selected[], hbool_t expected_result) { - char test_desc_0[128]; - char test_desc_1[256]; - int edge_size = 10; + char test_desc_0[128]; + char test_desc_1[256]; + int edge_size = 10; int i; int j; int k; - int dims_selected = 0; - hid_t n_cube_0_sid; /* the hyper cube containing + int dims_selected = 0; + hid_t n_cube_0_sid; /* the hyper cube containing * an irregular selection */ - hid_t n_cube_1_sid; /* the hyper cube in which a + hid_t n_cube_1_sid; /* the hyper cube in which a * slice contains an irregular * selection. */ - hsize_t dims[SS_DR_MAX_RANK]; - hsize_t start_0[SS_DR_MAX_RANK] = { 2, 2, 2, 2, 5}; - hsize_t stride_0[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_0[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t dims[SS_DR_MAX_RANK]; + hsize_t start_0[SS_DR_MAX_RANK] = { 2, 2, 2, 2, 5}; + hsize_t stride_0[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_0[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_0[SS_DR_MAX_RANK] = { 2, 2, 2, 2, 3}; - hsize_t start_1[SS_DR_MAX_RANK] = { 2, 2, 2, 5, 2}; - hsize_t stride_1[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_1[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t start_1[SS_DR_MAX_RANK] = { 2, 2, 2, 5, 2}; + hsize_t stride_1[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_1[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_1[SS_DR_MAX_RANK] = { 2, 2, 2, 3, 2}; - hsize_t start_2[SS_DR_MAX_RANK] = { 2, 2, 5, 2, 2}; - hsize_t stride_2[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_2[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t start_2[SS_DR_MAX_RANK] = { 2, 2, 5, 2, 2}; + hsize_t stride_2[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_2[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_2[SS_DR_MAX_RANK] = { 2, 2, 3, 2, 2}; - hsize_t start_3[SS_DR_MAX_RANK] = { 2, 5, 2, 2, 2}; - hsize_t stride_3[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_3[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t start_3[SS_DR_MAX_RANK] = { 2, 5, 2, 2, 2}; + hsize_t stride_3[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_3[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_3[SS_DR_MAX_RANK] = { 2, 3, 2, 2, 2}; - hsize_t start_4[SS_DR_MAX_RANK] = { 5, 2, 2, 2, 2}; - hsize_t stride_4[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t count_4[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t start_4[SS_DR_MAX_RANK] = { 5, 2, 2, 2, 2}; + hsize_t stride_4[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t count_4[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t block_4[SS_DR_MAX_RANK] = { 3, 2, 2, 2, 2}; - hsize_t clip_start[SS_DR_MAX_RANK] = { 0, 0, 0, 0, 0}; - hsize_t clip_stride[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t clip_count[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; + hsize_t clip_start[SS_DR_MAX_RANK] = { 0, 0, 0, 0, 0}; + hsize_t clip_stride[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; + hsize_t clip_count[SS_DR_MAX_RANK] = { 1, 1, 1, 1, 1}; hsize_t clip_block[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10}; - hsize_t *(starts[SS_DR_MAX_RANK]) = - {start_0, start_1, start_2, start_3, start_4}; + hsize_t *(starts[SS_DR_MAX_RANK]) = + {start_0, start_1, start_2, start_3, start_4}; hsize_t *(strides[SS_DR_MAX_RANK]) = - {stride_0, stride_1, stride_2, stride_3, stride_4}; + {stride_0, stride_1, stride_2, stride_3, stride_4}; hsize_t *(counts[SS_DR_MAX_RANK]) = - {count_0, count_1, count_2, count_3, count_4}; + {count_0, count_1, count_2, count_3, count_4}; hsize_t *(blocks[SS_DR_MAX_RANK]) = - {block_0, block_1, block_2, block_3, block_4}; - - hsize_t start[SS_DR_MAX_RANK]; - hsize_t * start_ptr; - hsize_t stride[SS_DR_MAX_RANK]; - hsize_t * stride_ptr; - hsize_t count[SS_DR_MAX_RANK]; - hsize_t * count_ptr; - hsize_t block[SS_DR_MAX_RANK]; - hsize_t * block_ptr; - htri_t check; /* Shape comparison return value */ - herr_t ret; /* Generic return value */ + {block_0, block_1, block_2, block_3, block_4}; + + hsize_t start[SS_DR_MAX_RANK]; + hsize_t * start_ptr; + hsize_t stride[SS_DR_MAX_RANK]; + hsize_t * stride_ptr; + hsize_t count[SS_DR_MAX_RANK]; + hsize_t * count_ptr; + hsize_t block[SS_DR_MAX_RANK]; + hsize_t * block_ptr; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ HDassert( 0 < small_rank ); HDassert( small_rank <= large_rank ); @@ -11465,23 +11462,23 @@ test_shape_same_dr__irregular(int test_num, * In the 1-D case, the projection of the pattern looks * like this: * - * - - * * - * * * - - + * - - * * - * * * - - * 0 1 2 3 4 5 6 7 8 9 x * * and in the 2-D case, it would look like this: * * - * y - * 9 - - - - - - - - - - - * 8 - - - - - - - - - - - * 7 - - * * - - - - - - - * 6 - - * * - - - - - - - * 5 - - * * - - - - - - - * 4 - - - - - - - - - - - * 3 - - * * - * * * - - - * 2 - - * * - * * * - - - * 1 - - - - - - - - - - - * 0 - - - - - - - - - - + * y + * 9 - - - - - - - - - - + * 8 - - - - - - - - - - + * 7 - - * * - - - - - - + * 6 - - * * - - - - - - + * 5 - - * * - - - - - - + * 4 - - - - - - - - - - + * 3 - - * * - * * * - - + * 2 - - * * - * * * - - + * 1 - - - - - - - - - - + * 0 - - - - - - - - - - * 0 1 2 3 4 5 6 7 8 9 x * * In both cases, asterisks indicate selected elements, @@ -11490,7 +11487,7 @@ test_shape_same_dr__irregular(int test_num, * Note that is this case, since the edge size is fixed, * the pattern does not change. However, we do use the * displacement parameter to allow it to be moved around - * within the n-cube or hyper slab. + * within the n-cube or hyperslab. */ /* first, ensure that the small n-cube has no selection */ @@ -11566,13 +11563,13 @@ test_shape_same_dr__irregular(int test_num, } /* end else */ } /* end for */ - /* select the hyper slab */ + /* select the hyperslab */ ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_OR, start_ptr, stride_ptr, count_ptr, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); } /* end for */ - /* it is possible that the selection extends beyond the data space. + /* it is possible that the selection extends beyond the dataspace. * clip the selection to ensure that it doesn't. */ ret = H5Sselect_hyperslab(n_cube_1_sid, H5S_SELECT_AND, @@ -11591,7 +11588,6 @@ test_shape_same_dr__irregular(int test_num, ret = H5Sclose(n_cube_1_sid); CHECK(ret, FAIL, "H5Sclose"); - } /* test_shape_same_dr__irregular() */ @@ -11599,13 +11595,13 @@ test_shape_same_dr__irregular(int test_num, ** ** test_shape_same_dr__run_irregular_tests(): ** -** In this set of tests, we test H5S_select_shape_same() +** In this set of tests, we test H5Sselect_shape_same() ** with an "irregular" subselection of 1, 2, 3, and 4 cubes as ** one parameter, and irregular subselections of 1, 2, 3, ** and 4 dimensional slices through a n-cube of rank no more ** than 5 (and at least the rank of the slice) as the other. ** Note that the "irregular" selection may be offset between -** the n-cube and the slice. +** the n-cube and the slice. ** ** All the irregular selections will be identical (modulo rank) ** so H5S_select_shape_same() should return true iff: @@ -11806,7 +11802,6 @@ test_shape_same_dr__run_irregular_tests(void) } while((v < 2 ) && (large_rank >= 5)); } /* end for */ } /* end for */ - } /* test_shape_same_dr__run_irregular_tests() */ @@ -11814,7 +11809,7 @@ test_shape_same_dr__run_irregular_tests(void) ** ** test_shape_same_dr(): Tests selections on dataspace with ** different ranks, to verify that "shape same" routine -** is now handling this case correctly. +** is now handling this case correctly. ** ****************************************************************/ static void @@ -11823,19 +11818,16 @@ test_shape_same_dr(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Same Shape/Different Rank Comparisons\n")); - /* first run some smoke checks */ test_shape_same_dr__smoke_check_1(); test_shape_same_dr__smoke_check_2(); test_shape_same_dr__smoke_check_3(); test_shape_same_dr__smoke_check_4(); - /* now run more intensive tests. */ test_shape_same_dr__run_full_space_vs_slice_tests(); test_shape_same_dr__run_checkerboard_tests(); test_shape_same_dr__run_irregular_tests(); - } /* test_shape_same_dr() */ @@ -12499,7 +12491,7 @@ test_space_rebuild(void) CHECK(ret, FAIL, "H5Sclose"); } - + /**************************************************************** ** ** test_select_hyper_chunk_offset(): Tests selections on dataspace, @@ -13625,7 +13617,7 @@ test_select(void) size_t rdcc_nbytes; /* Raw data number of bytes */ double rdcc_w0; /* Raw data write percentage */ hssize_t offset[SPACE7_RANK] = {1, 1}; /* Offset for testing selection offsets */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Selections\n")); @@ -13779,15 +13771,15 @@ test_select(void) } /* test_select() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_select + * Function: cleanup_select * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * *------------------------------------------------------------------------- @@ -1373,7 +1373,7 @@ test_vds_prefix_first(unsigned config, hid_t fapl) TEST_ERROR return 1; -} /* end test_vds_prefix() */ +} /* end test_vds_prefix */ /*------------------------------------------------------------------------- |