From 9ef2f993cfc7173712729fb40b34d1edae8509d9 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Fri, 28 Jul 2023 07:08:44 -0700 Subject: Sync test dir w/ develop (#3303) --- test/API/tattr.c | 2 +- test/API/testhdf5.h | 22 +- test/API/tfile.c | 2 +- test/API/titerate.c | 8 +- test/API/tmisc.c | 28 +- test/API/tselect.c | 4 +- test/accum.c | 8 +- test/accum_swmr_reader.c | 16 +- test/app_ref.c | 10 +- test/big.c | 18 +- test/btree2.c | 156 +++++------ test/cache.c | 76 +++--- test/cache_api.c | 40 ++- test/cache_common.c | 51 +--- test/cache_image.c | 5 +- test/cache_logging.c | 2 +- test/cache_tagging.c | 10 +- test/chunk_info.c | 49 ++-- test/cmpd_dset.c | 4 +- test/cork.c | 36 +-- test/cross_read.c | 8 +- test/dangle.c | 20 +- test/del_many_dense_attrs.c | 2 +- test/direct_chunk.c | 62 ++--- test/dsets.c | 281 ++++++++++---------- test/dt_arith.c | 32 +-- test/dtransform.c | 8 +- test/dtypes.c | 211 ++++++++------- test/earray.c | 42 +-- test/efc.c | 2 +- test/enc_dec_plist.c | 2 +- test/err_compat.c | 12 +- test/error_test.c | 34 +-- test/event_set.c | 8 +- test/evict_on_close.c | 14 +- test/extend.c | 2 +- test/external.c | 46 ++-- test/external_env.c | 4 +- test/farray.c | 28 +- test/fheap.c | 216 +++++++-------- test/file_image.c | 30 +-- test/fillval.c | 40 +-- test/filter_fail.c | 10 +- test/filter_plugin.c | 28 +- test/flush1.c | 12 +- test/flush2.c | 12 +- test/flushrefresh.c | 20 +- test/freespace.c | 20 +- test/gen_bad_compound.c | 2 +- test/gen_bad_offset.c | 2 +- test/gen_bad_ohdr.c | 2 +- test/gen_bogus.c | 4 +- test/gen_bounds.c | 14 +- test/gen_cross.c | 24 +- test/gen_deflate.c | 2 +- test/gen_file_image.c | 2 +- test/gen_filespace.c | 2 +- test/gen_filters.c | 4 +- test/gen_mergemsg.c | 12 +- test/gen_new_fill.c | 2 +- test/gen_new_group.c | 2 +- test/gen_old_group.c | 2 +- test/genall5.c | 4 +- test/getname.c | 10 +- test/gheap.c | 22 +- test/h5test.c | 66 ++--- test/h5test.h | 24 +- test/hdfs.c | 70 +++-- test/hyperslab.c | 2 +- test/istore.c | 2 +- test/lheap.c | 4 +- test/links.c | 580 ++++++++++++++++++++--------------------- test/links_env.c | 12 +- test/mdset.c | 2 +- test/mf.c | 98 +++---- test/mirror_vfd.c | 28 +- test/mount.c | 125 ++++----- test/mtime.c | 2 +- test/ntypes.c | 36 +-- test/objcopy.c | 166 ++++++------ test/objcopy_ref.c | 30 +-- test/ohdr.c | 36 +-- test/onion.c | 83 +++--- test/page_buffer.c | 30 +-- test/reserved.c | 2 +- test/set_extent.c | 28 +- test/stab.c | 22 +- test/swmr.c | 336 ++++++++++++------------ test/swmr_addrem_writer.c | 4 +- test/swmr_reader.c | 2 +- test/swmr_remove_reader.c | 2 +- test/swmr_remove_writer.c | 4 +- test/swmr_sparse_reader.c | 2 +- test/swmr_sparse_writer.c | 4 +- test/swmr_start_write.c | 4 +- test/swmr_writer.c | 4 +- test/unlink.c | 54 ++-- test/unregister.c | 10 +- test/use_append_chunk.c | 4 +- test/use_append_chunk_mirror.c | 4 +- test/use_append_mchunks.c | 4 +- test/use_common.c | 6 +- test/use_disable_mdc_flushes.c | 18 +- test/vds.c | 22 +- test/vds_env.c | 4 +- test/vfd.c | 155 +++++------ test/vfd_plugin.c | 8 +- test/vol.c | 50 ++-- test/vol_plugin.c | 8 +- 109 files changed, 1982 insertions(+), 2040 deletions(-) diff --git a/test/API/tattr.c b/test/API/tattr.c index 2016160..182d62d 100644 --- a/test/API/tattr.c +++ b/test/API/tattr.c @@ -11768,7 +11768,7 @@ test_attr(void) test_attr_delete(my_fapl); /* Test H5A code for deleting attributes */ /* This next test uses its own file information */ - test_attr_dtype_shared(my_fapl); /* Test using shared dataypes in attributes */ + test_attr_dtype_shared(my_fapl); /* Test using shared datatypes in attributes */ /* This next test uses its own file information */ test_attr_duplicate_ids(my_fapl); diff --git a/test/API/testhdf5.h b/test/API/testhdf5.h index 3d945f8..f2510b2 100644 --- a/test/API/testhdf5.h +++ b/test/API/testhdf5.h @@ -50,7 +50,7 @@ } while (0) #define CHECK_I(ret, where) \ - { \ + do { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", (where), (int)__LINE__, \ __FILE__, (long)(ret)); \ @@ -60,7 +60,7 @@ (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ - } + } while (0) /* Check that a pointer is valid (i.e.: not NULL) */ #define CHECK_PTR(ret, where) \ @@ -207,36 +207,36 @@ #define TEST_STR "Test" #define CLEAN_STR "Cleanup" -#define AT() HDprintf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); +#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); #define TESTING(WHAT) \ { \ - HDprintf("Testing %-62s", WHAT); \ - HDfflush(stdout); \ + printf("Testing %-62s", WHAT); \ + fflush(stdout); \ } #define TESTING_2(WHAT) \ { \ - HDprintf(" Testing %-60s", WHAT); \ - HDfflush(stdout); \ + printf(" Testing %-60s", WHAT); \ + fflush(stdout); \ } #define PASSED() \ { \ HDputs(" PASSED"); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define H5_FAILED() \ { \ HDputs("*FAILED*"); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define H5_WARNING() \ { \ HDputs("*WARNING*"); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define SKIPPED() \ { \ HDputs(" -SKIP-"); \ - HDfflush(stdout); \ + fflush(stdout); \ } #define PUTS_ERROR(s) \ { \ diff --git a/test/API/tfile.c b/test/API/tfile.c index 8f1cc28..247a249 100644 --- a/test/API/tfile.c +++ b/test/API/tfile.c @@ -693,7 +693,7 @@ test_file_reopen(void) /* Create a dataset in the file */ sid = H5Screate_simple(1, &dims, &dims); - CHECK_I(sid, "H5Screate_simple") + CHECK_I(sid, "H5Screate_simple"); did = H5Dcreate2(fid, REOPEN_DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK_I(did, "H5Dcreate2"); diff --git a/test/API/titerate.c b/test/API/titerate.c index 3472866..1349e70 100644 --- a/test/API/titerate.c +++ b/test/API/titerate.c @@ -205,7 +205,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) CHECK(ret, FAIL, "H5Fclose"); /* Sort the dataset names */ - HDqsort(lnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); + qsort(lnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); /* Iterate through the datasets in the root group in various ways */ file = H5Fopen(DATAFILE, H5F_ACC_RDONLY, fapl); @@ -749,7 +749,7 @@ test_iter_group_large(hid_t fapl) CHECK(ret, FAIL, "H5Tclose"); /* Need to sort the names in the root group, cause that's what the library does */ - HDqsort(names, (size_t)(ITER_NGROUPS + 2), sizeof(iter_info), iter_strcmp2); + qsort(names, (size_t)(ITER_NGROUPS + 2), sizeof(iter_info), iter_strcmp2); /* Iterate through the file to see members of the root group */ curr_name = &names[0]; @@ -848,7 +848,7 @@ test_grp_memb_funcs(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Sort the dataset names */ - HDqsort(dnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); + qsort(dnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); /* Iterate through the datasets in the root group in various ways */ file = H5Fopen(DATAFILE, H5F_ACC_RDONLY, fapl); @@ -905,7 +905,7 @@ test_grp_memb_funcs(hid_t fapl) VERIFY(ret, FAIL, "H5Lget_name_by_idx"); /* Sort the dataset names */ - HDqsort(obj_names, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); + qsort(obj_names, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); /* Compare object names */ for (i = 0; i < (int)ginfo.nlinks; i++) { diff --git a/test/API/tmisc.c b/test/API/tmisc.c index bb10399..d4213d2 100644 --- a/test/API/tmisc.c +++ b/test/API/tmisc.c @@ -2396,8 +2396,8 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char CHECK_PTR(new_fp, "fopen"); /* Write the user block to the new file */ - written = HDfwrite(user_block, (size_t)1, size, new_fp); - VERIFY(written, size, "HDfwrite"); + written = fwrite(user_block, (size_t)1, size, new_fp); + VERIFY(written, size, "fwrite"); /* Open the old file */ old_fp = fopen(old_name, "rb"); @@ -2408,19 +2408,19 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char CHECK_PTR(copy_buf, "malloc"); /* Copy data from the old file to the new file */ - while ((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { + while ((read_in = fread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { /* Write the data to the new file */ - written = HDfwrite(copy_buf, (size_t)1, read_in, new_fp); - VERIFY(written, read_in, "HDfwrite"); + written = fwrite(copy_buf, (size_t)1, read_in, new_fp); + VERIFY(written, read_in, "fwrite"); } /* Close the old file */ - ret = HDfclose(old_fp); - VERIFY(ret, 0, "HDfclose"); + ret = fclose(old_fp); + VERIFY(ret, 0, "fclose"); /* Close the new file */ - ret = HDfclose(new_fp); - VERIFY(ret, 0, "HDfclose"); + ret = fclose(new_fp); + VERIFY(ret, 0, "fclose"); /* Free the copy buffer */ free(copy_buf); @@ -4835,7 +4835,7 @@ test_misc25a(void) sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); ret = H5Tset_size(tid, (size_t)MISC25A_ATTR1_LEN); @@ -4861,7 +4861,7 @@ test_misc25a(void) sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); ret = H5Tset_size(tid, (size_t)MISC25A_ATTR2_LEN); @@ -4931,7 +4931,7 @@ test_misc25a(void) sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); ret = H5Tset_size(tid, (size_t)MISC25A_ATTR3_LEN); @@ -4977,7 +4977,7 @@ test_misc25a(void) sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); ret = H5Tset_size(tid, (size_t)MISC25A_ATTR2_LEN); @@ -5039,7 +5039,7 @@ test_misc25a(void) sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); ret = H5Tset_size(tid, (size_t)MISC25A_ATTR2_LEN); diff --git a/test/API/tselect.c b/test/API/tselect.c index 6563d83..fc6a275 100644 --- a/test/API/tselect.c +++ b/test/API/tselect.c @@ -1383,8 +1383,8 @@ test_select_hyper_stride(hid_t xfer_plist) CHECK(ret, FAIL, "H5Dread"); /* Sort the locations into the proper order */ - HDqsort(loc1, (size_t)72, sizeof(size_t), compare_size_t); - HDqsort(loc2, (size_t)72, sizeof(size_t), compare_size_t); + qsort(loc1, (size_t)72, sizeof(size_t), compare_size_t); + qsort(loc2, (size_t)72, sizeof(size_t), compare_size_t); /* Compare data read with data written out */ for (i = 0; i < 72; i++) { tbuf = wbuf + loc1[i]; diff --git a/test/accum.c b/test/accum.c index 7a7b576..6f4db2d 100644 --- a/test/accum.c +++ b/test/accum.c @@ -24,7 +24,7 @@ /* Filename */ /* (The file names are the same as the define in accum_swmr_reader.c) */ -const char *FILENAME[] = {"accum", "accum_swmr_big", NULL}; +static const char *FILENAME[] = {"accum", "accum_swmr_big", NULL}; /* The reader forked by test_swmr_write_big() */ #define SWMR_READER "accum_swmr_reader" @@ -2214,7 +2214,7 @@ test_swmr_write_big(hbool_t newest_format) int status; /* Status returned from child process */ /* Fork child process to verify that the data at [1024, 2014] does get written to disk */ - if ((pid = HDfork()) < 0) { + if ((pid = fork()) < 0) { HDperror("fork"); FAIL_STACK_ERROR; } @@ -2227,13 +2227,13 @@ test_swmr_write_big(hbool_t newest_format) char swmr_reader[] = SWMR_READER; char *const new_argv[] = {swmr_reader, NULL}; /* Run the reader */ - status = HDexecv(SWMR_READER, new_argv); + status = execv(SWMR_READER, new_argv); printf("errno from execv = %s\n", HDstrerror(errno)); FAIL_STACK_ERROR; } /* end if */ /* Parent process -- wait for the child process to complete */ - while (pid != HDwaitpid(pid, &status, 0)) + while (pid != waitpid(pid, &status, 0)) /*void*/; /* Check if child process terminates normally and its return value */ diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index 7f8e775..659a60a 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -23,7 +23,7 @@ #include "H5VLprivate.h" /* Virtual Object Layer */ /* Filename: this is the same as the define in accum.c used by test_swmr_write_big() */ -const char *FILENAME[] = {"accum", "accum_swmr_big", NULL}; +static const char *FILENAME[] = {"accum", "accum_swmr_big", NULL}; /*------------------------------------------------------------------------- * Function: main @@ -35,17 +35,14 @@ const char *FILENAME[] = {"accum", "accum_swmr_big", NULL}; * * Return: Success: EXIT_SUCCESS * Failure: EXIT_FAILURE - * - * Programmer: Vailin Choi; June 2013 - * *------------------------------------------------------------------------- */ int main(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* file access property list ID */ - H5F_t *f = NULL; /* File pointer */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* file access property list ID */ + H5F_t *f = NULL; /* File pointer */ char filename[1024]; unsigned u; /* Local index variable */ uint8_t rbuf[1024]; /* Buffer for reading */ @@ -53,6 +50,9 @@ main(void) char *driver = NULL; /* VFD string (from env variable) */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + /* Testing setup */ + h5_reset(); + /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. */ @@ -110,7 +110,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/app_ref.c b/test/app_ref.c index 3c936ec..7d46470 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -51,13 +51,13 @@ typedef enum { T_NUMCLASSES } id_class_t; -const char *FILENAME[] = {"app_ref", NULL}; +static const char *FILENAME[] = {"app_ref", NULL}; -const char *IDNAME[T_NUMCLASSES] = {"File", "Property List", "Property Class", "Datatype", - "Dataspace", "Dataset", "Attribute", "Group", - "Error Class", "Error Message", "Error Stack"}; +static const char *IDNAME[T_NUMCLASSES] = {"File", "Property List", "Property Class", "Datatype", + "Dataspace", "Dataset", "Attribute", "Group", + "Error Class", "Error Message", "Error Stack"}; -int rc[T_NUMCLASSES]; +static int rc[T_NUMCLASSES]; void Abrt_Handler(int sig); diff --git a/test/big.c b/test/big.c index 0dc05b4..4c4d31c 100644 --- a/test/big.c +++ b/test/big.c @@ -412,7 +412,7 @@ writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n) if (H5Fclose(file) < 0) goto error; free(buf); - HDfclose(out); + fclose(out); PASSED(); return 0; @@ -426,11 +426,11 @@ error: H5Sclose(mem_space); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (buf) free(buf); if (out) - HDfclose(out); + fclose(out); return 1; } @@ -477,8 +477,8 @@ reader(char *filename, hid_t fapl) while (HDfgets(ln, (int)sizeof(ln), script)) { if ('#' != ln[0]) break; - i = (int)HDstrtol(ln + 1, &s, 10); - hs_offset[0] = HDstrtoull(s, NULL, 0); + i = (int)strtol(ln + 1, &s, 10); + hs_offset[0] = strtoull(s, NULL, 0); fprintf(stdout, "#%03d 0x%016" PRIxHSIZE "%47s", i, hs_offset[0], ""); fflush(stdout); @@ -517,7 +517,7 @@ reader(char *filename, hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR; free(buf); - HDfclose(script); + fclose(script); return nerrors; @@ -529,11 +529,11 @@ error: H5Sclose(fspace); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (buf) free(buf); if (script) - HDfclose(script); + fclose(script); return 1; } @@ -717,7 +717,7 @@ main(int ac, char **av) ac--; av++; if (ac > 0) { - family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0); + family_size_def = (hsize_t)strtoull(*av, NULL, 0); } else { printf("***Missing fsize value***\n"); diff --git a/test/btree2.c b/test/btree2.c index b56e238..9b8edbe 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -24,7 +24,7 @@ #include "H5CXprivate.h" /* API Contexts */ #include "H5VLprivate.h" /* Virtual Object Layer */ -const char *FILENAME[] = {"btree2", "btree2_tmp", NULL}; +static const char *FILENAME[] = {"btree2", "btree2_tmp", NULL}; #define INSERT_SPLIT_ROOT_NREC 63 #define INSERT_SPLIT_ROOT_NREC_REC 64 @@ -616,7 +616,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -674,7 +674,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -739,7 +739,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -779,7 +779,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_insert_basic() */ @@ -922,7 +922,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC + 2), find_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -961,7 +961,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_split_root() */ @@ -1111,7 +1111,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level1_2leaf_redistrib() */ @@ -1267,7 +1267,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level1_side_split() */ @@ -1407,7 +1407,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level1_3leaf_redistrib() */ @@ -1526,7 +1526,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level1_middle_split() */ @@ -1676,7 +1676,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -1716,7 +1716,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_make_level2() */ @@ -1941,7 +1941,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level2_leaf_redistrib() */ @@ -2170,7 +2170,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level2_leaf_split() */ @@ -2339,7 +2339,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level2_2internal_redistrib() */ @@ -2513,7 +2513,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level2_2internal_split() */ @@ -2688,7 +2688,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level2_3internal_redistrib() */ @@ -2866,7 +2866,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_insert_level2_3internal_split() */ @@ -3030,7 +3030,7 @@ fprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -3038,7 +3038,7 @@ fprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); { ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -3072,7 +3072,7 @@ fprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); { ret = H5B2_insert(bt2, &record); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -3107,7 +3107,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY free(records); return 1; } /* test_insert_lots() */ @@ -3204,7 +3204,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -3281,7 +3281,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -3358,7 +3358,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -3452,7 +3452,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -3512,7 +3512,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_update_basic() */ @@ -3716,7 +3716,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -3770,7 +3770,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_update_split_root() */ @@ -3924,7 +3924,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_update_level1_2leaf_redistrib() */ @@ -4084,7 +4084,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_update_level1_side_split() */ @@ -4228,7 +4228,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_update_level1_3leaf_redistrib() */ @@ -4350,7 +4350,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_update_level1_middle_split() */ @@ -4519,7 +4519,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -4696,7 +4696,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -4883,7 +4883,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_ { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -4938,7 +4938,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_update_make_level2() */ @@ -5094,7 +5094,7 @@ fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -5102,7 +5102,7 @@ fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); { ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -5186,7 +5186,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY free(records); return 1; @@ -5240,7 +5240,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_remove(bt2, &record, NULL, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -5280,7 +5280,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_remove(bt2, &record, NULL, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -5364,7 +5364,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ { ret = H5B2_remove(bt2, &record, NULL, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -5498,7 +5498,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_basic() */ @@ -5566,7 +5566,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt { ret = H5B2_remove(bt2, &record, NULL, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -5719,7 +5719,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_noredistrib() */ @@ -5912,7 +5912,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_redistrib() */ @@ -6087,7 +6087,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_2leaf_merge() */ @@ -6209,7 +6209,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_3leaf_merge() */ @@ -6432,7 +6432,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_promote() */ @@ -6577,7 +6577,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_promote_2leaf_redistrib() */ @@ -6722,7 +6722,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_promote_3leaf_redistrib() */ @@ -6864,7 +6864,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_promote_2leaf_merge() */ @@ -7006,7 +7006,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_promote_3leaf_merge() */ @@ -7141,7 +7141,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level1_collapse() */ @@ -7423,7 +7423,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level2_promote() */ @@ -7571,7 +7571,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level2_promote_2internal_redistrib() */ @@ -7719,7 +7719,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level2_promote_3internal_redistrib() */ @@ -7868,7 +7868,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level2_promote_2internal_merge() */ @@ -8017,7 +8017,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level2_promote_3internal_merge() */ @@ -8140,7 +8140,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level2_2internal_merge_left() */ @@ -8263,7 +8263,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level2_2internal_merge_right() */ @@ -8386,7 +8386,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level2_3internal_merge() */ @@ -8508,7 +8508,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_remove_level2_collapse_right() */ @@ -8580,7 +8580,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* gen_l4_btree2() */ @@ -9013,7 +9013,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (fd > 0) HDclose(fd); @@ -9084,7 +9084,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param { ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -9164,7 +9164,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param { ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -9242,7 +9242,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY free(records); return 1; } /* test_find_neighbor() */ @@ -9512,7 +9512,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_delete() */ @@ -9576,7 +9576,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa { ret = H5B2_modify(bt2, &record, modify_cb, &modify); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -9627,7 +9627,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa { ret = H5B2_modify(bt2, &record, modify_cb, &modify); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -9678,7 +9678,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa { ret = H5B2_modify(bt2, &record, modify_cb, &modify); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -9729,7 +9729,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa { ret = H5B2_modify(bt2, &record, modify_cb, &modify); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (ret != FAIL) TEST_ERROR; @@ -9754,7 +9754,7 @@ error: H5B2_close(bt2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_modify() */ @@ -9891,7 +9891,7 @@ error: H5Fclose(file0); H5Fclose(file00); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_open_twice_diff() */ @@ -10051,7 +10051,7 @@ error: { H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/cache.c b/test/cache.c index 48f10f2..673b253 100644 --- a/test/cache.c +++ b/test/cache.c @@ -50,7 +50,7 @@ hbool_t core_file_driver_failed = FALSE; /* global variable declarations: */ -const char *FILENAME[] = {"cache_test", NULL}; +static const char *FILENAME[] = {"cache_test", NULL}; /* private typedef declarations: */ @@ -11198,7 +11198,7 @@ check_expunge_entry(unsigned paged) size_t entry_size; H5F_t *file_ptr = NULL; test_entry_t *base_addr; - test_entry_t *entry_ptr; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("H5C_expunge_entry() functionality (paged aggregation)"); @@ -11468,7 +11468,7 @@ check_multiple_read_protect(unsigned paged) #if H5C_COLLECT_CACHE_STATS H5C_t *cache_ptr = NULL; #endif /* H5C_COLLECT_CACHE_STATS */ - test_entry_t *entry_ptr; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("multiple read only protects on a single entry (paged aggr)"); @@ -14031,8 +14031,8 @@ static unsigned check_double_pin_err(unsigned paged) { herr_t result; - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("pin a pinned entry error (paged aggregation)"); @@ -14113,8 +14113,8 @@ static unsigned check_double_unpin_err(unsigned paged) { herr_t result; - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("unpin an unpinned entry error (paged aggregation)"); @@ -14204,8 +14204,8 @@ static unsigned check_pin_entry_errs(unsigned paged) { herr_t result; - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("pin entry related errors (paged aggregation)"); @@ -14308,8 +14308,8 @@ check_pin_entry_errs(unsigned paged) static unsigned check_double_protect_err(unsigned paged) { - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; H5C_cache_entry_t *cache_entry_ptr; if (paged) @@ -14388,8 +14388,8 @@ static unsigned check_double_unprotect_err(unsigned paged) { herr_t result; - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("unprotect an unprotected entry error (paged aggregation)"); @@ -14466,8 +14466,8 @@ static unsigned check_mark_entry_dirty_errs(unsigned paged) { herr_t result; - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("mark entry dirty related errors (paged aggregation)"); @@ -14542,8 +14542,8 @@ static unsigned check_expunge_entry_errs(unsigned paged) { herr_t result; - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("expunge entry related errors (paged aggregation)"); @@ -14651,12 +14651,12 @@ static unsigned check_move_entry_errs(unsigned paged) { herr_t result; - H5F_t *file_ptr = NULL; - H5C_t *cache_ptr = NULL; - test_entry_t *entry_ptr = NULL; - test_entry_t *entry_0_0_ptr; - test_entry_t *entry_0_1_ptr; - test_entry_t *entry_1_0_ptr; + H5F_t *file_ptr = NULL; + H5C_t *cache_ptr = NULL; + test_entry_t *entry_ptr = NULL; + test_entry_t *entry_0_0_ptr = NULL; + test_entry_t *entry_0_1_ptr = NULL; + test_entry_t *entry_1_0_ptr = NULL; if (paged) TESTING("move entry related errors (paged aggregation)"); @@ -14765,8 +14765,8 @@ static unsigned check_resize_entry_errs(unsigned paged) { herr_t result; - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("resize entry related errors (paged aggregation)"); @@ -14863,8 +14863,8 @@ static unsigned check_unprotect_ro_dirty_err(unsigned paged) { herr_t result; - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; if (paged) TESTING("unprotect a read only entry dirty error (paged aggregation)"); @@ -14980,8 +14980,8 @@ check_unprotect_ro_dirty_err(unsigned paged) static unsigned check_protect_ro_rw_err(unsigned paged) { - H5F_t *file_ptr = NULL; - test_entry_t *entry_ptr; + H5F_t *file_ptr = NULL; + test_entry_t *entry_ptr = NULL; void *thing_ptr = NULL; if (paged) @@ -24623,17 +24623,6 @@ check_auto_cache_resize_input_errs(unsigned paged) if (pass) { - result = H5C_get_cache_auto_resize_config((const H5C_t *)&test_auto_size_ctl, &test_auto_size_ctl); - - if (result != FAIL) { - - pass = FALSE; - failure_mssg = "H5C_get_cache_auto_resize_config accepted bad cache_ptr.\n"; - } - } - - if (pass) { - result = H5C_get_cache_auto_resize_config(cache_ptr, NULL); if (result != FAIL) { @@ -33701,13 +33690,6 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) if (verbose) fprintf(stdout, "%s: H5C_create() failed.\n", __func__); } - else if (cache_ptr->magic != H5C__H5C_T_MAGIC) { - pass = FALSE; - failure_mssg = "Bad cache_ptr magic."; - - if (verbose) - fprintf(stdout, "%s: Bad cache_ptr magic.\n", __func__); - } } if (show_progress) /* 7 */ diff --git a/test/cache_api.c b/test/cache_api.c index 562d8dd..1752a43 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -21,7 +21,7 @@ /* global variable declarations: */ -const char *FILENAME[] = {"cache_api_test", NULL}; +static const char *FILENAME[] = {"cache_api_test", NULL}; /* macro definitions */ @@ -236,8 +236,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* verify that we can access the internal version of the cache config */ if (pass) { - if ((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) || - (cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER)) { + if (cache_ptr == NULL || cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER) { pass = FALSE; failure_mssg = "Can't access cache resize_ctl.\n"; @@ -380,8 +379,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id) /* verify that we can access the internal version of the cache config */ if (pass) { - if ((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) || - (cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER)) { + if (cache_ptr == NULL || cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER) { pass = FALSE; failure_mssg = "Can't access cache resize_ctl.\n"; @@ -1642,7 +1640,7 @@ check_fapl_mdc_api_errs(void) { result = H5Pget_mdc_config((hid_t)-1, &scratch); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1680,7 +1678,7 @@ check_fapl_mdc_api_errs(void) { result = H5Pget_mdc_config(fapl_id, NULL); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1698,7 +1696,7 @@ check_fapl_mdc_api_errs(void) { result = H5Pget_mdc_config(fapl_id, &scratch); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1717,7 +1715,7 @@ check_fapl_mdc_api_errs(void) { result = H5Pset_mdc_config((hid_t)-1, &default_config); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1732,7 +1730,7 @@ check_fapl_mdc_api_errs(void) { result = H5Pset_mdc_config(fapl_id, NULL); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1747,7 +1745,7 @@ check_fapl_mdc_api_errs(void) { result = H5Pset_mdc_config(fapl_id, &(invalid_configs[i])); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1872,7 +1870,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Fget_mdc_config((hid_t)-1, &scratch); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1892,7 +1890,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Fget_mdc_config(file_id, NULL); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1913,7 +1911,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Fget_mdc_config(file_id, &scratch); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1936,7 +1934,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Fset_mdc_config((hid_t)-1, &default_config); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1956,7 +1954,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Fset_mdc_config(file_id, NULL); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -1976,7 +1974,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Fset_mdc_config(file_id, &(invalid_configs[i])); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -2004,7 +2002,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Fget_mdc_hit_rate((hid_t)-1, &hit_rate); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -2024,7 +2022,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Fget_mdc_hit_rate(file_id, NULL); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -2045,7 +2043,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Freset_mdc_hit_rate_stats((hid_t)-1); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { @@ -2066,7 +2064,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) { result = H5Fget_mdc_size((hid_t)-1, &max_size, &min_clean_size, &cur_size, &cur_num_entries); } - H5E_END_TRY; + H5E_END_TRY if (result >= 0) { diff --git a/test/cache_common.c b/test/cache_common.c index 54ae2ad..b406ff4 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1304,9 +1304,7 @@ free_icr(test_entry_t *entry, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) assert(entry == &(entries[entry->type][entry->index])); assert(entry == entry->self); assert(entry->cache_ptr != NULL); - assert(entry->cache_ptr->magic == H5C__H5C_T_MAGIC); assert((entry->header.destroy_in_progress) || (entry->header.addr == entry->addr)); - assert(entry->header.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); assert(entry->header.size == entry->size); assert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[entry->type])); assert(entry->header.tl_next == NULL); @@ -1632,7 +1630,6 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o assert(file_ptr); cache_ptr = file_ptr->shared->cache; assert(cache_ptr != NULL); - assert(cache_ptr->magic == H5C__H5C_T_MAGIC); assert(entry_ptr != NULL); assert(entry_ptr == entry_ptr->self); assert(entry_ptr->header.addr == entry_ptr->addr); @@ -2938,7 +2935,7 @@ mark_entry_dirty(int32_t type, int32_t idx) void move_entry(H5C_t *cache_ptr, int32_t type, int32_t idx, hbool_t main_addr) { - herr_t result; + herr_t result = 0; hbool_t done = TRUE; /* will set to FALSE if we have work to do */ haddr_t old_addr = HADDR_UNDEF; haddr_t new_addr = HADDR_UNDEF; @@ -4666,11 +4663,11 @@ destroy_flush_dependency(int32_t par_type, int32_t par_idx, int32_t chd_type, in break; assert(i < chd_entry_ptr->flush_dep_npar); if (i < chd_entry_ptr->flush_dep_npar - 1) - HDmemmove(&chd_entry_ptr->flush_dep_par_type[i], &chd_entry_ptr->flush_dep_par_type[i + 1], - (chd_entry_ptr->flush_dep_npar - i - 1) * sizeof(chd_entry_ptr->flush_dep_par_type[0])); + memmove(&chd_entry_ptr->flush_dep_par_type[i], &chd_entry_ptr->flush_dep_par_type[i + 1], + (chd_entry_ptr->flush_dep_npar - i - 1) * sizeof(chd_entry_ptr->flush_dep_par_type[0])); if (i < chd_entry_ptr->flush_dep_npar - 1) - HDmemmove(&chd_entry_ptr->flush_dep_par_idx[i], &chd_entry_ptr->flush_dep_par_idx[i + 1], - (chd_entry_ptr->flush_dep_npar - i - 1) * sizeof(chd_entry_ptr->flush_dep_par_idx[0])); + memmove(&chd_entry_ptr->flush_dep_par_idx[i], &chd_entry_ptr->flush_dep_par_idx[i + 1], + (chd_entry_ptr->flush_dep_npar - i - 1) * sizeof(chd_entry_ptr->flush_dep_par_idx[0])); chd_entry_ptr->flush_dep_npar--; par_entry_ptr->flush_dep_nchd--; if (par_entry_ptr->flush_dep_nchd == 0) { @@ -4796,7 +4793,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, double *hit_rate_ptr, hbool_t d int64_t cache_hits = 0; int64_t cache_accesses = 0; double expected_hit_rate; - double hit_rate; + double hit_rate = 0.0; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; @@ -4820,16 +4817,6 @@ check_and_validate_cache_hit_rate(hid_t file_id, double *hit_rate_ptr, hbool_t d } } - /* verify that we can access the cache data structure */ - if (pass) { - - if (cache_ptr->magic != H5C__H5C_T_MAGIC) { - - pass = FALSE; - failure_mssg = "Can't access cache resize_ctl."; - } - } - /* compare the cache's internal configuration with the expected value */ if (pass) { @@ -4916,15 +4903,15 @@ check_and_validate_cache_size(hid_t file_id, size_t *max_size_ptr, size_t *min_c { herr_t result; size_t expected_max_size; - size_t max_size; + size_t max_size = 0; size_t expected_min_clean_size; - size_t min_clean_size; + size_t min_clean_size = 0; size_t expected_cur_size; - size_t cur_size; + size_t cur_size = 0; uint32_t expected_cur_num_entries; - int cur_num_entries; - H5F_t *file_ptr = NULL; - H5C_t *cache_ptr = NULL; + int cur_num_entries = 0; + H5F_t *file_ptr = NULL; + H5C_t *cache_ptr = NULL; /* get a pointer to the files internal data structure */ if (pass) { @@ -4946,16 +4933,6 @@ check_and_validate_cache_size(hid_t file_id, size_t *max_size_ptr, size_t *min_c } } - /* verify that we can access the cache data structure */ - if (pass) { - - if (cache_ptr->magic != H5C__H5C_T_MAGIC) { - - pass = FALSE; - failure_mssg = "Can't access cache data structure."; - } - } - /* compare the cache's internal configuration with the expected value */ if (pass) { @@ -5109,8 +5086,7 @@ validate_mdc_config(hid_t file_id, H5AC_cache_config_t *ext_config_ptr, hbool_t /* verify that we can access the internal version of the cache config */ if (pass) { - if ((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) || - (cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER)) { + if (cache_ptr == NULL || cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER) { pass = FALSE; HDsnprintf(tmp_msg_buf, sizeof(tmp_msg_buf), "Can't access cache resize_ctl #%d.", test_num); @@ -5190,7 +5166,6 @@ dump_LRU(H5F_t * file_ptr) H5C_t *cache_ptr = file_ptr->shared->cache; assert(cache_ptr); - assert(cache_ptr->magic == H5C__H5C_T_MAGIC); entry_ptr = cache_ptr->LRU_head_ptr; diff --git a/test/cache_image.c b/test/cache_image.c index ccf516d..ada65e4 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -19,7 +19,7 @@ /* global variable declarations: */ -const char *FILENAMES[] = {"cache_image_test", NULL}; +static const char *FILENAMES[] = {"cache_image_test", NULL}; /* local utility function declarations */ static void create_datasets(hid_t file_id, int min_dset, int max_dset); @@ -6218,7 +6218,7 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) failure_mssg = "SWMR start succeeded in file with cache image."; } } - H5E_END_TRY; + H5E_END_TRY } if (show_progress) @@ -7584,7 +7584,6 @@ evict_on_close_test(hbool_t H5_ATTR_PARALLEL_UNUSED single_file_vfd) if (verbose) { assert(cache_ptr); - assert(cache_ptr->magic == H5C__H5C_T_MAGIC); fprintf(stdout, "index size / index dirty size = %lld / %lld\n", (long long)(cache_ptr->index_size), (long long)(cache_ptr->dirty_index_size)); diff --git a/test/cache_logging.c b/test/cache_logging.c index d8aa424..5001c49 100644 --- a/test/cache_logging.c +++ b/test/cache_logging.c @@ -16,7 +16,7 @@ #define LOG_LOCATION "cache_logging.out" -const char *FILENAME[] = {"cache_logging", NULL}; +static const char *FILENAME[] = {"cache_logging", NULL}; #define N_GROUPS 100 diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 4cd247d..9af8bf2 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -519,11 +519,11 @@ check_file_open_tags(hid_t fcpl, int type) /* Variable Declarations */ hid_t fid = -1; /* File Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ - haddr_t root_tag; /* Root Group Tag */ - haddr_t sbe_tag; /* Sblock Extension Tag */ + int verbose = FALSE; /* verbose file output */ +#endif /* NDEBUG */ + hid_t fapl = -1; /* File access prop list */ + haddr_t root_tag; /* Root Group Tag */ + haddr_t sbe_tag = HADDR_UNDEF; /* Sblock Extension Tag */ /* Testing Macro */ TESTING("tag application during file open"); diff --git a/test/chunk_info.c b/test/chunk_info.c index 99430f9..cb79dc1 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -44,8 +44,13 @@ #endif /* Test file names, using H5F_libver_t as indices */ -const char *FILENAME[] = {"tchunk_info_earliest", "tchunk_info_v18", "tchunk_info_v110", - "tchunk_info_v112", "tchunk_info_v114", NULL}; +static const char *FILENAME[] = {"tchunk_info_earliest", + "tchunk_info_v18", + "tchunk_info_v110", + "tchunk_info_v112", + "tchunk_info_v114", + "tchunk_info_v116", + NULL}; /* File to be used in test_failed_attempts */ #define FILTERMASK_FILE "tflt_msk" @@ -629,7 +634,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) { ret = H5Dget_chunk_info(dset, H5S_ALL, chk_index, out_offset, &read_flt_msk, &addr, &size); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) FAIL_PUTS_ERROR(" Attempt to get info of a non-existing chunk."); @@ -686,7 +691,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) { ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) FAIL_PUTS_ERROR(" Attempt to get info of a non-existing chunk."); @@ -786,7 +791,7 @@ error: H5Pclose(cparms); H5Fclose(chunkfile); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -910,7 +915,7 @@ test_chunk_info_single_chunk(const char *filename, hid_t fapl) { ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) TEST_ERROR; @@ -933,7 +938,7 @@ error: H5Pclose(cparms); H5Fclose(chunkfile); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -1052,7 +1057,7 @@ error: H5Pclose(cparms); H5Fclose(chunkfile); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -1158,7 +1163,7 @@ test_chunk_info_fixed_array(const char *filename, hid_t fapl) { ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) FAIL_PUTS_ERROR(" Attempted to get info of a chunk using an out-of-range index."); @@ -1195,7 +1200,7 @@ error: H5Pclose(cparms); H5Fclose(chunkfile); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -1307,7 +1312,7 @@ test_chunk_info_extensible_array(const char *filename, hid_t fapl) { ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) FAIL_PUTS_ERROR(" Attempted to get info of a chunk using an out-of-range index."); @@ -1344,7 +1349,7 @@ error: H5Pclose(cparms); H5Fclose(chunkfile); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -1456,7 +1461,7 @@ test_chunk_info_version2_btrees(const char *filename, hid_t fapl) { ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) FAIL_PUTS_ERROR(" Attempted to get info of a chunk using an out-of-range index."); @@ -1493,7 +1498,7 @@ error: H5Pclose(cparms); H5Fclose(chunkfile); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -1653,7 +1658,7 @@ test_basic_query(hid_t fapl) { ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) TEST_ERROR; @@ -1732,7 +1737,7 @@ test_basic_query(hid_t fapl) { ret = H5Dchunk_iter(dset, H5P_DEFAULT, &iter_cb_fail, &cptr); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; if (cptr != &(chunk_infos[1])) @@ -1762,7 +1767,7 @@ error: H5Pclose(cparms); H5Fclose(basicfile); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -1840,7 +1845,7 @@ test_failed_attempts(const char *filename, hid_t fapl) { ret = H5Dget_num_chunks(dset, dspace, &nchunks); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) FAIL_PUTS_ERROR(" Attempt a chunk query function on a contiguous dataset."); @@ -1851,7 +1856,7 @@ test_failed_attempts(const char *filename, hid_t fapl) { ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) FAIL_PUTS_ERROR(" Attempt a chunk query function on a contiguous dataset."); @@ -1863,7 +1868,7 @@ test_failed_attempts(const char *filename, hid_t fapl) { ret = H5Dget_chunk_info_by_coord(dset, offset, &read_flt_msk, &addr, &size); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) FAIL_PUTS_ERROR(" Attempt a chunk query function on a contiguous dataset."); @@ -1885,7 +1890,7 @@ error: H5Sclose(dspace); H5Fclose(chunkfile); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -2173,7 +2178,7 @@ error: H5Pclose(dxpl); H5Fclose(filter_file); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 7bbaa4c..5e7a6e1 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -19,7 +19,7 @@ #include "h5test.h" -const char *FILENAME[] = {"cmpd_dset", "src_subset", "dst_subset", NULL}; +static const char *FILENAME[] = {"cmpd_dset", "src_subset", "dst_subset", NULL}; const char *DSET_NAME[] = {"contig_src_subset", "chunk_src_subset", "contig_dst_subset", "chunk_dst_subset", NULL}; @@ -1678,7 +1678,7 @@ test_pack_ooo(void) /* Reshape free_order to remove j (which is no longer free) */ if (j < (num_free - 1)) - HDmemmove(&free_order[j], &free_order[j + 1], (num_free - j - 1) * sizeof(free_order[0])); + memmove(&free_order[j], &free_order[j + 1], (num_free - j - 1) * sizeof(free_order[0])); } /* end for */ /* Generate order to insert inner compound type */ diff --git a/test/cork.c b/test/cork.c index 44a0e18..d67d18b 100644 --- a/test/cork.c +++ b/test/cork.c @@ -271,7 +271,7 @@ error: H5Pclose(dcpl3); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY free(buf); free(buf_data); @@ -477,7 +477,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* verify_obj_dset_cork */ @@ -730,7 +730,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY free(buf); free(buf_data); @@ -901,7 +901,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* verify_group_cork */ @@ -1174,7 +1174,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* verify_named_cork */ @@ -1464,7 +1464,7 @@ verify_multiple_cork(hbool_t swmr) { ret = H5Odisable_mdc_flushes(aidg2); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1473,7 +1473,7 @@ verify_multiple_cork(hbool_t swmr) { ret = H5Odisable_mdc_flushes(aidd1); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1482,7 +1482,7 @@ verify_multiple_cork(hbool_t swmr) { ret = H5Oare_mdc_flushes_disabled(aidt2, &corked); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1506,7 +1506,7 @@ verify_multiple_cork(hbool_t swmr) ret = H5Oare_mdc_flushes_disabled(fid1, &corked); ret = H5Odisable_mdc_flushes(fid1); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1515,7 +1515,7 @@ verify_multiple_cork(hbool_t swmr) { ret = H5Oenable_mdc_flushes(fid2); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1549,7 +1549,7 @@ error: H5Fclose(fid1); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* verify_multiple_cork */ @@ -1651,7 +1651,7 @@ test_objs_cork(hbool_t swmr, hbool_t new_format) { ret = H5Odisable_mdc_flushes(tid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1690,7 +1690,7 @@ test_objs_cork(hbool_t swmr, hbool_t new_format) { ret = H5Oenable_mdc_flushes(sid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1707,7 +1707,7 @@ test_objs_cork(hbool_t swmr, hbool_t new_format) { ret = H5Oare_mdc_flushes_disabled(aid, &corked); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1750,7 +1750,7 @@ test_objs_cork(hbool_t swmr, hbool_t new_format) { ret = H5Odisable_mdc_flushes(gid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1775,7 +1775,7 @@ test_objs_cork(hbool_t swmr, hbool_t new_format) { ret = H5Oenable_mdc_flushes(tid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -1849,7 +1849,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_objs_cork() */ @@ -2197,7 +2197,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY free(wbuf); free(wbuf_data); diff --git a/test/cross_read.c b/test/cross_read.c index 1d46b05..8369a76 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -18,7 +18,7 @@ #include "h5test.h" #include "H5srcdir.h" -const char *FILENAME[] = {"vms_data", "le_data", "be_data", NULL}; +static const char *FILENAME[] = {"vms_data", "le_data", "be_data", NULL}; #define DATASETNAME "Array_le" #define DATASETNAME1 "Array_be" @@ -120,7 +120,7 @@ error: { H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end check_data_i() */ @@ -191,7 +191,7 @@ error: { H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end check_data_f() */ @@ -322,7 +322,7 @@ error: { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return nerrors; } /* end check_file() */ diff --git a/test/dangle.c b/test/dangle.c index 64f0b8f..c589448 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -15,7 +15,7 @@ */ #include "h5test.h" -const char *FILENAME[] = {"dangle", NULL}; +static const char *FILENAME[] = {"dangle", NULL}; #define MAX_DANGLE 1000 @@ -78,7 +78,7 @@ test_dangle_dataset(H5F_close_degree_t degree) 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY if (H5Sclose(sid) < 0) TEST_ERROR; @@ -94,7 +94,7 @@ test_dangle_dataset(H5F_close_degree_t degree) if (H5Fclose(fid) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY } /* end if */ else if (H5Fclose(fid) < 0) TEST_ERROR; @@ -166,7 +166,7 @@ test_dangle_group(H5F_close_degree_t degree) { gid = H5Gcreate2(fid, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gid >= 0) TEST_ERROR; @@ -184,7 +184,7 @@ test_dangle_group(H5F_close_degree_t degree) if (H5Fclose(fid) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY } /* end if */ else if (H5Fclose(fid) < 0) TEST_ERROR; @@ -262,7 +262,7 @@ test_dangle_datatype1(H5F_close_degree_t degree) if (H5Tcommit2(fid, TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY if (H5Tclose(tid) < 0) TEST_ERROR; @@ -277,7 +277,7 @@ test_dangle_datatype1(H5F_close_degree_t degree) if (H5Fclose(fid) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY } /* end if */ else if (H5Fclose(fid) < 0) TEST_ERROR; @@ -359,7 +359,7 @@ test_dangle_datatype2(H5F_close_degree_t degree) if (H5Fclose(fid) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY } /* end if */ else if (H5Fclose(fid) < 0) TEST_ERROR; @@ -444,7 +444,7 @@ test_dangle_attribute(H5F_close_degree_t degree) if ((aid = H5Acreate2(dsid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY if (H5Sclose(sid) < 0) TEST_ERROR; @@ -463,7 +463,7 @@ test_dangle_attribute(H5F_close_degree_t degree) if (H5Fclose(fid) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY } /* end if */ else if (H5Fclose(fid) < 0) TEST_ERROR; diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c index 31ae627..58ecb61 100644 --- a/test/del_many_dense_attrs.c +++ b/test/del_many_dense_attrs.c @@ -19,7 +19,7 @@ #include "h5test.h" /* The test file name */ -const char *FILENAME[] = {"del_many_dense_attrs", NULL}; +static const char *FILENAME[] = {"del_many_dense_attrs", NULL}; #define ATTR_COUNT 64 /* The number of attributes */ diff --git a/test/direct_chunk.c b/test/direct_chunk.c index fe19035..078349c 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -86,7 +86,7 @@ static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts, const unsigned size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_BOGUS1[1] = {{ +static const H5Z_class2_t H5Z_BOGUS1[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_BOGUS1, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ @@ -96,7 +96,7 @@ const H5Z_class2_t H5Z_BOGUS1[1] = {{ filter_bogus1, /* The actual filter function */ }}; -const H5Z_class2_t H5Z_BOGUS2[1] = {{ +static const H5Z_class2_t H5Z_BOGUS2[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_BOGUS2, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ @@ -361,7 +361,7 @@ error: H5Pclose(cparms); H5Pclose(dxpl); } - H5E_END_TRY; + H5E_END_TRY if (outbuf) free(outbuf); @@ -470,7 +470,7 @@ error: H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return 1; @@ -650,7 +650,7 @@ error: H5Pclose(cparms); H5Pclose(dxpl); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return 1; @@ -918,7 +918,7 @@ error: H5Pclose(cparms); H5Pclose(dxpl); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return 1; @@ -1151,7 +1151,7 @@ error: H5Tclose(st); H5Tclose(dt); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return 1; @@ -1228,7 +1228,7 @@ test_invalid_parameters(hid_t file) if ((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY /* Try to get chunk size for a contiguous dataset. It should fail */ H5E_BEGIN_TRY @@ -1236,7 +1236,7 @@ test_invalid_parameters(hid_t file) if ((status = H5Dget_chunk_storage_size(dataset, offset, &chunk_nbytes)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY /* Try to H5Dread_chunk from the contiguous dataset. It should fail */ H5E_BEGIN_TRY @@ -1244,7 +1244,7 @@ test_invalid_parameters(hid_t file) if ((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY if (H5Dclose(dataset) < 0) goto error; @@ -1270,14 +1270,14 @@ test_invalid_parameters(hid_t file) if ((status = H5Dwrite_chunk((hid_t)-1, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY H5E_BEGIN_TRY { if ((status = H5Dread_chunk((hid_t)-1, dxpl, offset, &filter_mask, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY /* Check invalid DXPL ID for H5Dwrite_chunk and H5Dread_chunk */ H5E_BEGIN_TRY @@ -1285,14 +1285,14 @@ test_invalid_parameters(hid_t file) if ((status = H5Dwrite_chunk(dataset, (hid_t)-1, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY H5E_BEGIN_TRY { if ((status = H5Dread_chunk(dataset, (hid_t)-1, offset, &filter_mask, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY /* Check invalid OFFSET for H5Dwrite_chunk and H5Dread_chunk */ H5E_BEGIN_TRY @@ -1300,14 +1300,14 @@ test_invalid_parameters(hid_t file) if ((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, NULL, buf_size, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY H5E_BEGIN_TRY { if ((status = H5Dread_chunk(dataset, dxpl, NULL, &filter_mask, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY /* Check when OFFSET is out of dataset range for H5Dwrite_chunk and H5Dread_chunk */ offset[0] = NX + 1; @@ -1317,14 +1317,14 @@ test_invalid_parameters(hid_t file) if ((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY H5E_BEGIN_TRY { if ((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY /* Check when OFFSET is not on chunk boundary for H5Dwrite_chunk and H5Dread_chunk */ offset[0] = CHUNK_NX; @@ -1334,14 +1334,14 @@ test_invalid_parameters(hid_t file) if ((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY H5E_BEGIN_TRY { if ((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY /* Check invalid buffer size for H5Dwrite_chunk only */ offset[0] = CHUNK_NX; @@ -1352,7 +1352,7 @@ test_invalid_parameters(hid_t file) if ((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY /* Check invalid data buffer for H5Dwrite_chunk and H5Dread_chunk */ buf_size = CHUNK_NX * CHUNK_NY * sizeof(int); @@ -1361,14 +1361,14 @@ test_invalid_parameters(hid_t file) if ((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, NULL)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY H5E_BEGIN_TRY { if ((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, NULL)) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY if (H5Dclose(dataset) < 0) goto error; @@ -1393,7 +1393,7 @@ error: H5Pclose(cparms); H5Pclose(dxpl); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return 1; @@ -1578,7 +1578,7 @@ error: H5Pclose(dxpl); H5Pclose(dapl); } - H5E_END_TRY; + H5E_END_TRY if (outbuf) free(outbuf); @@ -1767,7 +1767,7 @@ error: H5Pclose(cparms); H5Pclose(dxpl); } - H5E_END_TRY; + H5E_END_TRY if (outbuf) free(outbuf); @@ -1923,7 +1923,7 @@ error: H5Pclose(cparms); H5Pclose(dxpl); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return 1; @@ -2003,7 +2003,7 @@ test_read_unallocated_chunk(hid_t file) { status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, &direct_buf); } - H5E_END_TRY; + H5E_END_TRY /* Check that the chunk read call does not succeed. */ if (status != -1) @@ -2015,7 +2015,7 @@ test_read_unallocated_chunk(hid_t file) { status = H5Dget_chunk_storage_size(dataset, offset, &direct_chunk_nbytes); } - H5E_END_TRY; + H5E_END_TRY /* Check that the chunk storage size call does not succeed. */ if (status != -1) @@ -2049,7 +2049,7 @@ error: H5Pclose(cparms); H5Pclose(dxpl); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return 1; @@ -2206,7 +2206,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return 1; diff --git a/test/dsets.c b/test/dsets.c index ca50f7d..6d8c9dc 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -52,36 +52,36 @@ #include "szlib.h" #endif -const char *FILENAME[] = {"dataset", /* 0 */ - "compact_dataset", /* 1 */ - "dset_offset", /* 2 */ - "max_compact_dataset", /* 3 */ - "simple", /* 4 */ - "set_local", /* 5 */ - "random_chunks", /* 6 */ - "huge_chunks", /* 7 */ - "chunk_cache", /* 8 */ - "big_chunk", /* 9 */ - "chunk_fast", /* 10 */ - "chunk_expand", /* 11 */ - "chunk_fixed", /* 12 */ - "copy_dcpl_newfile", /* 13 */ - "partial_chunks", /* 14 */ - "layout_extend", /* 15 */ - "zero_chunk", /* 16 */ - "chunk_single", /* 17 */ - "swmr_non_latest", /* 18 */ - "earray_hdr_fd", /* 19 */ - "farray_hdr_fd", /* 20 */ - "bt2_hdr_fd", /* 21 */ - "storage_size", /* 22 */ - "dls_01_strings", /* 23 */ - "power2up", /* 24 */ - "version_bounds", /* 25 */ - "alloc_0sized", /* 26 */ - "h5s_block", /* 27 */ - "h5s_plist", /* 28 */ - NULL}; +static const char *FILENAME[] = {"dataset", /* 0 */ + "compact_dataset", /* 1 */ + "dset_offset", /* 2 */ + "max_compact_dataset", /* 3 */ + "simple", /* 4 */ + "set_local", /* 5 */ + "random_chunks", /* 6 */ + "huge_chunks", /* 7 */ + "chunk_cache", /* 8 */ + "big_chunk", /* 9 */ + "chunk_fast", /* 10 */ + "chunk_expand", /* 11 */ + "chunk_fixed", /* 12 */ + "copy_dcpl_newfile", /* 13 */ + "partial_chunks", /* 14 */ + "layout_extend", /* 15 */ + "zero_chunk", /* 16 */ + "chunk_single", /* 17 */ + "swmr_non_latest", /* 18 */ + "earray_hdr_fd", /* 19 */ + "farray_hdr_fd", /* 20 */ + "bt2_hdr_fd", /* 21 */ + "storage_size", /* 22 */ + "dls_01_strings", /* 23 */ + "power2up", /* 24 */ + "version_bounds", /* 25 */ + "alloc_0sized", /* 26 */ + "h5s_block", /* 27 */ + "h5s_plist", /* 28 */ + NULL}; #define OHMIN_FILENAME_A "ohdr_min_a" @@ -413,7 +413,7 @@ test_create(hid_t file) dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dataset >= 0) { H5_FAILED(); HDputs(" Library allowed overwrite of existing dataset."); @@ -440,7 +440,7 @@ test_create(hid_t file) { dataset = H5Dopen2(file, "does_not_exist", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dataset >= 0) { H5_FAILED(); HDputs(" Opened a non-existent dataset."); @@ -464,7 +464,7 @@ test_create(hid_t file) dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, create_parms, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dataset >= 0) { H5_FAILED(); HDputs(" Opened a dataset with incorrect chunking parameters."); @@ -942,7 +942,7 @@ test_compact_io(hid_t fapl) { ret = H5Pset_libver_bounds(new_fapl, low, high); } - H5E_END_TRY; + H5E_END_TRY if (ret < 0) /* Invalid low/high combinations */ continue; @@ -1036,7 +1036,7 @@ error: H5Fclose(file); H5Fclose(verfile); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_compact_io() */ @@ -1166,7 +1166,7 @@ test_max_compact(hid_t fapl) { H5Dcreate2(file, DSET_COMPACT_MAX2_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* Close file */ if (H5Sclose(space) < 0) @@ -1193,7 +1193,7 @@ error: H5Dclose(dataset); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_max_compact() */ @@ -1251,7 +1251,7 @@ test_layout_extend(hid_t fapl) FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Create dataset with extendible dataspace (unlimited max_dims) should fail */ H5E_BEGIN_TRY @@ -1260,7 +1260,7 @@ test_layout_extend(hid_t fapl) FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Create property list for contiguous dataset creation */ if ((dcpl_contig = H5Pcreate(H5P_DATASET_CREATE)) < 0) @@ -1274,7 +1274,7 @@ test_layout_extend(hid_t fapl) if (H5Dcreate2(fid, "contig", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT) != FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Create dataset with extendible dataspace (unlimited max_dims) should fail*/ H5E_BEGIN_TRY @@ -1283,7 +1283,7 @@ test_layout_extend(hid_t fapl) FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Create property list for chunked dataset creation */ if ((dcpl_chunked = H5Pcreate(H5P_DATASET_CREATE)) < 0) @@ -1339,7 +1339,7 @@ error: H5Dclose(did_unlim); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_layout_extend() */ @@ -1466,7 +1466,7 @@ test_conv_buffer(hid_t fid) { status = H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Library shouldn't allow conversion buffer too small"); @@ -1524,7 +1524,7 @@ error: H5Tclose(arr_type5); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_conv_buffer() */ @@ -1610,7 +1610,7 @@ error: H5Dclose(dataset); H5Sclose(space); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_tconv() */ @@ -1630,7 +1630,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ * Function: can_apply_bogus * * Purpose: A bogus 'can apply' callback that returns 0 for H5T_NATIVE_DOUBLE - * dataype, but returns 1 for all other datatypes + * datatype, but returns 1 for all other datatypes * * Return: Success: Described above * Failure: 0 @@ -2003,7 +2003,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; @@ -2021,7 +2021,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; } @@ -2070,7 +2070,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; @@ -2088,7 +2088,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; } @@ -2134,7 +2134,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; @@ -2153,7 +2153,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; } /* end if */ @@ -2201,7 +2201,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; @@ -2219,7 +2219,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; } @@ -2471,7 +2471,7 @@ test_get_filter_info(void) { err = H5Zget_filter_info(-1, &flags); } - H5E_END_TRY; + H5E_END_TRY if (err >= 0) TEST_ERROR; @@ -3017,7 +3017,7 @@ test_missing_filter(hid_t file) { ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_data); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf(" Line %d: Should not be able to read dataset data\n", __LINE__); @@ -5679,7 +5679,7 @@ error: H5Sclose(space); H5Pclose(dcpl); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_multiopen() */ @@ -5787,7 +5787,7 @@ error: H5Sclose(space); H5Dclose(dset); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_types() */ @@ -5863,7 +5863,7 @@ test_can_apply(hid_t file) { dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dsid >= 0) { H5_FAILED(); printf(" Line %d: Shouldn't have created dataset!\n", __LINE__); @@ -5876,7 +5876,7 @@ test_can_apply(hid_t file) { dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dsid >= 0) { H5_FAILED(); printf(" Line %d: Shouldn't have created dataset!\n", __LINE__); @@ -6225,7 +6225,7 @@ error: H5Tclose(strtid); H5Tclose(vlentid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_optional_filters() */ @@ -6290,7 +6290,7 @@ test_can_apply_szip(hid_t { ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf(" Line %d: Shouldn't be able to set szip filter\n", __LINE__); @@ -6303,7 +6303,7 @@ test_can_apply_szip(hid_t { ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf(" Line %d: Shouldn't be able to set szip filter\n", __LINE__); @@ -6326,7 +6326,7 @@ test_can_apply_szip(hid_t dsid = H5Dcreate2(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dsid <= 0) { H5_FAILED(); printf(" Line %d: Should have created dataset!\n", __LINE__); @@ -6388,7 +6388,7 @@ test_can_apply_szip(hid_t dsid = H5Dcreate2(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dsid >= 0) { H5_FAILED(); printf(" Line %d: Shouldn't have created dataset!\n", __LINE__); @@ -6794,7 +6794,7 @@ error: H5Pclose(dcpl1); H5Pclose(dcpl2); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_compare_dcpl() */ @@ -6954,7 +6954,7 @@ error: H5Pclose(dcpl1_copy); H5Pclose(dcpl2_copy); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_copy_dcpl() */ @@ -7037,7 +7037,7 @@ test_filter_delete(hid_t file) { ret = H5Pget_filter_by_id2(dcpl1, H5Z_FILTER_DEFLATE, &flags, NULL, NULL, (size_t)0, NULL, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf(" Line %d: Shouldn't have deleted filter!\n", __LINE__); @@ -7049,7 +7049,7 @@ test_filter_delete(hid_t file) { ret = H5Premove_filter(dcpl1, H5Z_FILTER_DEFLATE); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf(" Line %d: Shouldn't have deleted filter!\n", __LINE__); @@ -7099,7 +7099,7 @@ error: H5Dclose(dsid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; #else (void)file; /* Silence compiler */ @@ -7186,7 +7186,7 @@ error: if (buf) free(buf); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end auxread_fdata() */ @@ -7260,7 +7260,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_filters_endianess() */ @@ -7318,7 +7318,7 @@ test_zero_dims(hid_t file) { d = H5Dcreate2(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (d > 0) { H5Dclose(d); FAIL_PUTS_ERROR("created dataset with undefined chunk dimensions"); @@ -7329,7 +7329,7 @@ test_zero_dims(hid_t file) { ret = H5Pset_chunk(dcpl, 1, &dzero); } - H5E_END_TRY; + H5E_END_TRY if (ret > 0) FAIL_PUTS_ERROR("set zero-sized chunk dimensions"); @@ -7399,7 +7399,7 @@ test_zero_dims(hid_t file) { d2 = H5Dcreate2(file, ZERODIM_DATASET2, H5T_NATIVE_INT, s2, H5P_DEFAULT, dcpl2, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (d2 > 0) { H5Dclose(d2); FAIL_PUTS_ERROR("created dataset with undefined chunk dimensions"); @@ -7410,7 +7410,7 @@ test_zero_dims(hid_t file) { ret = H5Pset_chunk(dcpl2, 2, dzero2); } - H5E_END_TRY; + H5E_END_TRY if (ret > 0) FAIL_PUTS_ERROR("set zero-sized chunk dimensions"); @@ -7466,7 +7466,7 @@ error: H5Dclose(d2); H5Sclose(s2); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_zero_dims() */ @@ -7714,7 +7714,7 @@ error: H5Sclose(s); H5Sclose(sid2); } - H5E_END_TRY; + H5E_END_TRY free(rdata); free(wdata); @@ -8255,7 +8255,7 @@ error: H5Dclose(d); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_random_chunks_real() */ @@ -8291,7 +8291,6 @@ test_random_chunks(hid_t fapl) nerrors += test_random_chunks_real("Write/read on randomly selected chunks w/implicit index", TRUE, fapl); return nerrors; - ; } /* end test_random_chunks() */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -8370,7 +8369,7 @@ test_deprec(hid_t file) { dataset = H5Dcreate1(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dataset >= 0) { H5_FAILED(); HDputs(" Library allowed overwrite of existing dataset."); @@ -8395,7 +8394,7 @@ test_deprec(hid_t file) { dataset = H5Dopen1(file, "does_not_exist"); } - H5E_END_TRY; + H5E_END_TRY if (dataset >= 0) { H5_FAILED(); HDputs(" Opened a non-existent dataset."); @@ -8448,7 +8447,7 @@ test_deprec(hid_t file) { dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms); } - H5E_END_TRY; + H5E_END_TRY if (dataset >= 0) { H5_FAILED(); HDputs(" Opened a dataset with incorrect chunking parameters."); @@ -8570,7 +8569,7 @@ test_huge_chunks(hid_t fapl) { ret = H5Pset_chunk(dcpl, 1, &chunk_dim); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions."); @@ -8582,7 +8581,7 @@ test_huge_chunks(hid_t fapl) { ret = H5Pset_chunk(dcpl, 3, chunk_dim2); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions."); @@ -8601,7 +8600,7 @@ test_huge_chunks(hid_t fapl) { dsid = H5Dcreate2(fid, HUGE_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dsid >= 0) FAIL_PUTS_ERROR(" 1-D Dataset with too large of chunk dimensions created."); @@ -8628,7 +8627,7 @@ test_huge_chunks(hid_t fapl) { dsid = H5Dcreate2(fid, HUGE_DATASET2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dsid >= 0) FAIL_PUTS_ERROR(" n-D Dataset with too large of chunk dimensions created."); @@ -8653,7 +8652,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_huge_chunks() */ @@ -8918,7 +8917,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_chunk_cache() */ @@ -9281,7 +9280,7 @@ error: H5Sclose(t_sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY free(wdata); free(rdata1); @@ -9704,7 +9703,7 @@ error: H5Fclose(fid); H5Pclose(my_fapl); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_chunk_fast() */ @@ -9839,7 +9838,7 @@ error: H5Sclose(scalar_sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_reopen_chunk_fast() */ @@ -9981,7 +9980,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY free(wbuf); free(rbuf); @@ -10162,7 +10161,7 @@ test_chunk_expand(hid_t fapl) { dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dsid >= 0) FAIL_PUTS_ERROR("should fail to create dataset when allocation time is early"); @@ -10170,7 +10169,7 @@ test_chunk_expand(hid_t fapl) { dsid2 = H5Dcreate2(fid, "dset2", H5T_NATIVE_UINT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dsid2 >= 0) FAIL_PUTS_ERROR("should fail to create dataset when allocation time is early"); @@ -10267,7 +10266,7 @@ test_chunk_expand(hid_t fapl) { status = H5Dwrite(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &write_elem); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR("should fail to write to dataset when allocation time is not early"); @@ -10276,7 +10275,7 @@ test_chunk_expand(hid_t fapl) status = H5Dwrite(dsid2, H5T_NATIVE_UINT, scalar_sid, sid2, H5P_DEFAULT, &write_elem2); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR("should fail to write to dataset when allocation time is not early"); } /* end for */ @@ -10363,7 +10362,7 @@ test_chunk_expand(hid_t fapl) status = H5Dwrite(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &write_elem); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR( "should fail to write to dataset when allocation time is not early"); @@ -10373,7 +10372,7 @@ test_chunk_expand(hid_t fapl) status = H5Dwrite(dsid2, H5T_NATIVE_UINT, scalar_sid, sid2, H5P_DEFAULT, &write_elem2); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR( "should fail to write to dataset when allocation time is not early"); @@ -10502,7 +10501,7 @@ test_chunk_expand(hid_t fapl) { status = H5Dwrite(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &write_elem); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR("should fail to write to dataset when allocation time is not early"); @@ -10511,7 +10510,7 @@ test_chunk_expand(hid_t fapl) status = H5Dwrite(dsid2, H5T_NATIVE_UINT, scalar_sid, sid2, H5P_DEFAULT, &write_elem2); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR("should fail to write to dataset when allocation time is not early"); } /* end for */ @@ -10571,7 +10570,7 @@ error: H5Sclose(scalar_sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_chunk_expand() */ @@ -11101,7 +11100,7 @@ error: H5Sclose(mem_id); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY free(wbuf_big); free(rbuf_big); @@ -11398,7 +11397,7 @@ error: H5Sclose(sid_max); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (wbuf) free(wbuf); if (rbuf) @@ -11483,7 +11482,7 @@ error: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_idx_compatible() */ @@ -11622,7 +11621,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_unfiltered_edge_chunks() */ @@ -11755,7 +11754,7 @@ error: H5Sclose(scalar_sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_large_chunk_shrink() */ @@ -11796,7 +11795,7 @@ test_zero_dim_dset(hid_t fapl) { ret = H5Pset_libver_bounds(fapl, low, high); } - H5E_END_TRY; + H5E_END_TRY if (ret < 0) /* Invalid low/high combinations */ continue; @@ -11858,7 +11857,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_zero_dim_dset() */ @@ -12129,7 +12128,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* test_swmr_non_latest() */ @@ -12250,7 +12249,7 @@ error: H5Sclose(sid); H5Sclose(msid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* test_earray_hdr_fd() */ @@ -12371,7 +12370,7 @@ error: H5Sclose(sid); H5Sclose(msid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_farray_hdr_fd() */ @@ -12498,7 +12497,7 @@ error: H5Sclose(sid); H5Sclose(msid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_bt2_hdr_fd() */ @@ -12985,7 +12984,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_storage_size() */ @@ -13051,7 +13050,7 @@ test_power2up(hid_t fapl) { status = H5Dset_extent(did, ext_dims); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; @@ -13078,7 +13077,7 @@ error: H5Pclose(dcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_power2up() */ @@ -13387,7 +13386,7 @@ error: { H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_scatter() */ @@ -13751,7 +13750,7 @@ error: { H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_gather() */ @@ -13981,7 +13980,7 @@ error: { H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_scatter_error() */ @@ -14144,7 +14143,7 @@ error: { H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_gather_error() */ @@ -14506,7 +14505,7 @@ test_compact_open_close_dirty(hid_t fapl) { did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (did < 0) TEST_ERROR; if (H5Dclose(did) < 0) @@ -14552,7 +14551,7 @@ error: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_compact_open_close_dirty() */ @@ -14637,7 +14636,7 @@ test_versionbounds(void) { ret = H5Pset_libver_bounds(fapl, low, high); } - H5E_END_TRY; + H5E_END_TRY if (ret < 0) /* Invalid low/high combinations */ continue; @@ -14658,7 +14657,7 @@ test_versionbounds(void) { vdset = H5Dcreate2(vfile, V_DSET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (vdset > 0) /* dataset created successfully */ { @@ -14715,7 +14714,7 @@ error: H5Fclose(srcfile); H5Fclose(vfile); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_versionbounds() */ @@ -14791,7 +14790,7 @@ test_object_header_minimization_dcpl(void) { ret = H5Pget_dset_no_attrs_hint(H5I_INVALID_HID, &minimize); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; @@ -14800,7 +14799,7 @@ test_object_header_minimization_dcpl(void) { ret = H5Pset_dset_no_attrs_hint(H5I_INVALID_HID, FALSE); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; @@ -14809,7 +14808,7 @@ test_object_header_minimization_dcpl(void) { ret = H5Pset_dset_no_attrs_hint(H5I_INVALID_HID, TRUE); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; @@ -14818,7 +14817,7 @@ test_object_header_minimization_dcpl(void) { ret = H5Pget_dset_no_attrs_hint(dcpl_id, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; @@ -14841,7 +14840,7 @@ error: H5Pclose(dcpl_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_object_header_minimization_dcpl() */ @@ -14896,7 +14895,7 @@ test_h5s_block(void) { ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_BLOCK, H5P_DEFAULT, buf); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; @@ -14959,7 +14958,7 @@ error: H5Dclose(dset_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_h5s_block() */ @@ -15025,7 +15024,7 @@ test_h5s_plist(void) ret = H5Pset_dataset_io_hyperslab_selection(dxpl_id, 0, H5S_SELECT_SET, &start, &stride, &count, &block); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; H5E_BEGIN_TRY @@ -15034,7 +15033,7 @@ test_h5s_plist(void) ret = H5Pset_dataset_io_hyperslab_selection(dxpl_id, 1, H5S_SELECT_NOOP, &start, &stride, &count, &block); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; H5E_BEGIN_TRY @@ -15043,7 +15042,7 @@ test_h5s_plist(void) ret = H5Pset_dataset_io_hyperslab_selection(dxpl_id, 1, H5S_SELECT_SET, NULL, &stride, &count, &block); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; H5E_BEGIN_TRY @@ -15054,7 +15053,7 @@ test_h5s_plist(void) &block); stride = 1; } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; H5E_BEGIN_TRY @@ -15063,7 +15062,7 @@ test_h5s_plist(void) ret = H5Pset_dataset_io_hyperslab_selection(dxpl_id, 1, H5S_SELECT_SET, &start, &stride, NULL, &block); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; @@ -15074,7 +15073,7 @@ test_h5s_plist(void) /* H5S_PLIST for memory dataspace */ ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_PLIST, H5S_ALL, H5P_DEFAULT, buf); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; @@ -15133,7 +15132,7 @@ test_h5s_plist(void) ret = H5Pset_dataset_io_hyperslab_selection(dxpl_id_copy, H5S_MAX_RANK + 1, H5S_SELECT_OR, &start, &stride, &count, &block); } - H5E_END_TRY; + H5E_END_TRY if (ret == SUCCEED) TEST_ERROR; @@ -15198,7 +15197,7 @@ error: H5Dclose(dset_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_h5s_plist() */ @@ -15389,7 +15388,7 @@ error: H5Dclose(dset_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_0sized_dset_metadata_alloc() */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 7c3ded6..ed80d5f 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -42,7 +42,7 @@ #endif #define SET_ALIGNMENT(TYPE, VAL) H5T_NATIVE_##TYPE##_ALIGN_g = MAX(H5T_NATIVE_##TYPE##_ALIGN_g, VAL) -const char *FILENAME[] = {"dt_arith1", "dt_arith2", NULL}; +static const char *FILENAME[] = {"dt_arith1", "dt_arith2", NULL}; /* * Count up or down depending on whether the machine is big endian or little @@ -103,7 +103,7 @@ static int without_hardware_g = 0; * This algorithm is mainly to avoid any casting and comparison between source and destination types * for compiler, because we're testing conversions. */ #define INIT_INTEGER(TYPE, SRC_MAX, SRC_MIN, SRC_SIZE, DST_SIZE, SRC_PREC, BUF, SAVED, NELMTS) \ - { \ + do { \ unsigned char *buf_p, *saved_p; \ unsigned int n; \ TYPE value1 = 1; \ @@ -157,13 +157,13 @@ static int without_hardware_g = 0; if (n < SRC_PREC - 1) \ value2 = (TYPE)(value2 << 1); \ } \ - } + } while (0) /* Change a buffer's byte order from big endian to little endian. It's mainly for library's * bit operations which handle only little endian order. */ #define CHANGE_ORDER(EBUF, EORDER, ESIZE) \ - { \ + do { \ unsigned int m; \ if (H5T_ORDER_BE == EORDER) { \ unsigned char mediator; \ @@ -187,14 +187,14 @@ static int without_hardware_g = 0; EBUF[(ESIZE - 1) - m] = mediator2; \ } \ } \ - } + } while (0) /* Allocate buffer and initialize it with floating-point normalized values. * It's for conversion test of floating-point as the source. */ #define INIT_FP_NORM(TYPE, SRC_MAX, SRC_MIN, SRC_MAX_10_EXP, SRC_MIN_10_EXP, SRC_SIZE, DST_SIZE, BUF, SAVED, \ NELMTS) \ - { \ + do { \ unsigned char *buf_p, *saved_p; \ size_t num_norm, factor, n; \ TYPE value1, value2; \ @@ -267,13 +267,13 @@ static int without_hardware_g = 0; memcpy(saved_p, &value2, SRC_SIZE); \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ - } + } while (0) /* Allocate buffer and initialize it with floating-point denormalized values. * It's for conversion test of floating-point as the source. */ #define INIT_FP_DENORM(TYPE, SRC_MANT_DIG, SRC_SIZE, SRC_PREC, SRC_ORDR, DST_SIZE, BUF, SAVED, NELMTS) \ - { \ + do { \ unsigned char *buf_p, *saved_p; \ unsigned char *tmp1, *tmp2; \ size_t n; \ @@ -319,13 +319,13 @@ static int without_hardware_g = 0; } \ free(tmp1); \ free(tmp2); \ - } + } while (0) /* Allocate buffer and initialize it with floating-point special values, +/-0, +/-infinity, * +/-QNaN, +/-SNaN. It's for conversion test of floating-point as the source. */ #define INIT_FP_SPECIAL(SRC_SIZE, SRC_PREC, SRC_ORDR, SRC_MANT_DIG, DST_SIZE, BUF, SAVED, NELMTS) \ - { \ + do { \ unsigned char *buf_p; \ unsigned char *value; \ int n; \ @@ -383,7 +383,7 @@ static int without_hardware_g = 0; \ memcpy(SAVED, BUF, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ free(value); \ - } + } while (0) static hbool_t overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits); static int my_isnan(dtype_t type, void *val); @@ -745,7 +745,7 @@ error: { H5Pclose(dxpl_id); } - H5E_END_TRY; + H5E_END_TRY if (buf1) free(buf1); if (buf2) @@ -1199,7 +1199,7 @@ error: H5Pclose(dxpl_id); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -1508,7 +1508,7 @@ error: H5Pclose(dxpl_id); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -2785,12 +2785,12 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) */ fflush(stdout); fflush(stderr); - if ((child_pid = HDfork()) < 0) { + if ((child_pid = fork()) < 0) { HDperror("fork"); return 1; } else if (child_pid > 0) { - while (child_pid != HDwaitpid(child_pid, &status, 0)) /*void*/ + while (child_pid != waitpid(child_pid, &status, 0)) /*void*/ ; if (WIFEXITED(status) && 255 == WEXITSTATUS(status)) { return 0; /*child exit after catching SIGFPE*/ diff --git a/test/dtransform.c b/test/dtransform.c index a67cfed..3768320 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -214,7 +214,7 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, } #define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ - { \ + do { \ struct { \ TYPE arr[ROWS][COLS]; \ } *array = NULL; \ @@ -298,10 +298,10 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, TEST_ERROR; \ \ free(array); \ - } + } while (0) #define INVALID_SET_TEST(TRANSFORM) \ - { \ + do { \ if (H5Pset_data_transform(dxpl_id, TRANSFORM) < 0) { \ PASSED(); \ } \ @@ -310,7 +310,7 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, fprintf(stderr, " ERROR: Data transform allowed invalid TRANSFORM transform to be set\n"); \ goto error; \ } \ - } + } while (0) int main(void) diff --git a/test/dtypes.c b/test/dtypes.c index 387b608..21a79a1 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -73,8 +73,8 @@ } \ } while (0) -const char *FILENAME[] = {"dtypes0", "dtypes1", "dtypes2", "dtypes3", "dtypes4", "dtypes5", - "dtypes6", "dtypes7", "dtypes8", "dtypes9", "dtypes10", NULL}; +static const char *FILENAME[] = {"dtypes0", "dtypes1", "dtypes2", "dtypes3", "dtypes4", "dtypes5", + "dtypes6", "dtypes7", "dtypes8", "dtypes9", "dtypes10", NULL}; #define TESTFILE "bad_compound.h5" @@ -306,7 +306,7 @@ test_copy(void) { status = H5Tclose(H5T_NATIVE_SCHAR); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Should not be able to close a predefined type!"); @@ -585,7 +585,7 @@ test_compound_1(void) { ret = H5Tinsert(complex_id, "compound", (size_t)0, complex_id); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { FAIL_PUTS_ERROR("Inserted compound datatype into itself?"); } /* end if */ @@ -602,7 +602,7 @@ test_compound_1(void) { ret = H5Tset_size(complex_id, sizeof(double)); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -611,7 +611,7 @@ test_compound_1(void) { size = H5Tget_precision(complex_id); } - H5E_END_TRY; + H5E_END_TRY if (size > 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -621,7 +621,7 @@ test_compound_1(void) { ret = H5Tset_precision(complex_id, size); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -630,7 +630,7 @@ test_compound_1(void) { ret = H5Tget_pad(complex_id, &lsb, &msb); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -639,7 +639,7 @@ test_compound_1(void) { size = H5Tget_ebias(complex_id); } - H5E_END_TRY; + H5E_END_TRY if (size > 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -648,7 +648,7 @@ test_compound_1(void) { lsb = H5Tget_inpad(complex_id); } - H5E_END_TRY; + H5E_END_TRY if (lsb >= 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -657,7 +657,7 @@ test_compound_1(void) { cset = H5Tget_cset(complex_id); } - H5E_END_TRY; + H5E_END_TRY if (cset > -1) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -666,7 +666,7 @@ test_compound_1(void) { strpad = H5Tget_strpad(complex_id); } - H5E_END_TRY; + H5E_END_TRY if (strpad > -1) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -675,7 +675,7 @@ test_compound_1(void) { offset = H5Tget_offset(complex_id); } - H5E_END_TRY; + H5E_END_TRY if (offset >= 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -690,7 +690,7 @@ test_compound_1(void) { sign = H5Tget_sign(complex_id); } - H5E_END_TRY; + H5E_END_TRY if (sign > -1) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -699,7 +699,7 @@ test_compound_1(void) { tag = H5Tget_tag(complex_id); } - H5E_END_TRY; + H5E_END_TRY if (tag) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -708,7 +708,7 @@ test_compound_1(void) { super = H5Tget_super(complex_id); } - H5E_END_TRY; + H5E_END_TRY if (super >= 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -1385,7 +1385,7 @@ test_compound_7(void) { ret = H5Tinsert(tid2, "d", HOFFSET(struct s2, d), H5T_NATIVE_DOUBLE); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf("Inserted field 'd'?\n"); @@ -1397,7 +1397,7 @@ test_compound_7(void) { ret = H5Tset_size(tid2, sizeof(struct s1) / 2); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf("Shrunk compound type?\n"); @@ -1626,7 +1626,7 @@ test_compound_8(void) { ret = H5Tpack(tid3); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); AT(); @@ -2522,7 +2522,7 @@ test_compound_12(void) { ret = H5Tset_size(complex_id, size); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); HDputs(" Tries to cut off the last member. Should have failed."); @@ -3408,7 +3408,7 @@ error: H5Sclose(space_id); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_compound_15_attr() */ @@ -3721,7 +3721,7 @@ test_compound_18(void) { did = H5Dcreate2(file, "dataset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (did > 0) { H5Dclose(did); FAIL_PUTS_ERROR("created dataset with bad compound datatype"); @@ -3736,7 +3736,7 @@ test_compound_18(void) { aid = H5Acreate2(gid, "attr", tid, sid, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (aid > 0) { H5Aclose(aid); FAIL_PUTS_ERROR("created attribute with bad compound datatype"); @@ -3747,7 +3747,7 @@ test_compound_18(void) { ret = H5Tcommit2(file, "cmpnd", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { FAIL_PUTS_ERROR("committed named datatype with bad compound datatype"); } /* end if */ @@ -3776,7 +3776,7 @@ test_compound_18(void) { tid = H5Topen2(file, "cmpnd", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (tid > 0) { H5Tclose(tid); FAIL_PUTS_ERROR("opened named datatype with bad compound datatype"); @@ -3787,7 +3787,7 @@ test_compound_18(void) { did = H5Dopen2(file, "dataset", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (did > 0) { H5Dclose(did); FAIL_PUTS_ERROR("opened dataset with bad compound datatype"); @@ -3802,7 +3802,7 @@ test_compound_18(void) { aid = H5Aopen(gid, "attr", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (aid > 0) { H5Aclose(aid); FAIL_PUTS_ERROR("opened attribute with bad compound datatype"); @@ -3888,27 +3888,32 @@ test_query(void) printf("Can't create enumerate type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "RED", (enum_val = 10, &enum_val)) < 0) { + enum_val = 10; + if (H5Tenum_insert(tid2, "RED", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "GREEN", (enum_val = 11, &enum_val)) < 0) { + enum_val = 11; + if (H5Tenum_insert(tid2, "GREEN", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "BLUE", (enum_val = 12, &enum_val)) < 0) { + enum_val = 12; + if (H5Tenum_insert(tid2, "BLUE", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "ORANGE", (enum_val = 13, &enum_val)) < 0) { + enum_val = 13; + if (H5Tenum_insert(tid2, "ORANGE", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; } /* end if */ - if (H5Tenum_insert(tid2, "YELLOW", (enum_val = 14, &enum_val)) < 0) { + enum_val = 14; + if (H5Tenum_insert(tid2, "YELLOW", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; @@ -4057,7 +4062,7 @@ error: H5Tclose(tid2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -4095,7 +4100,7 @@ test_transient(hid_t fapl) { status = H5Tset_precision(H5T_NATIVE_INT, (size_t)256); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Predefined types should not be modifiable!"); @@ -4105,7 +4110,7 @@ test_transient(hid_t fapl) { status = H5Tclose(H5T_NATIVE_INT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Predefined types should not be closable!"); @@ -4123,7 +4128,7 @@ test_transient(hid_t fapl) { ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret_id >= 0) { H5_FAILED(); HDputs(" Attributes should not be allowed for transient types!"); @@ -4145,7 +4150,7 @@ test_transient(hid_t fapl) { status = H5Tset_precision(t2, (size_t)256); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Dataset datatypes should not be modifiable!"); @@ -4168,7 +4173,7 @@ test_transient(hid_t fapl) { status = H5Tset_precision(t2, (size_t)256); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Dataset datatypes should not be modifiable!"); @@ -4209,7 +4214,7 @@ error: H5Dclose(dset); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -4249,7 +4254,7 @@ test_named(hid_t fapl) status = H5Tcommit2(file, "test_named_1 (should not exist)", H5T_NATIVE_INT, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Predefined types should not be committable!"); @@ -4274,7 +4279,7 @@ test_named(hid_t fapl) { status = H5Tset_precision(type, (size_t)256); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Committed type is not constant!"); @@ -4287,7 +4292,7 @@ test_named(hid_t fapl) status = H5Tcommit2(file, "test_named_2 (should not exist)", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Committed types should not be recommitted!"); @@ -4461,7 +4466,7 @@ test_named(hid_t fapl) status = H5Tcommit2(file, "test_named_3 (should not exist)", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Types should not be committable to a read-only file!"); @@ -4475,7 +4480,7 @@ test_named(hid_t fapl) { status = H5Tcommit_anon(file, type, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Types should not be committable to a read-only file!"); @@ -4501,7 +4506,7 @@ error: H5Dclose(dset); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -4930,7 +4935,7 @@ error: H5Tclose(src_type); H5Tclose(dst_type); } - H5E_END_TRY; + H5E_END_TRY if (buf) free(buf); @@ -4998,7 +5003,7 @@ error: H5Tclose(c_type); H5Tclose(f_type); } - H5E_END_TRY; + H5E_END_TRY if (buf) free(buf); @@ -5073,7 +5078,7 @@ test_conv_str_3(void) { ret = H5Tset_precision(type, nelmts); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -5082,7 +5087,7 @@ test_conv_str_3(void) { size = H5Tget_ebias(type); } - H5E_END_TRY; + H5E_END_TRY if (size > 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -5091,7 +5096,7 @@ test_conv_str_3(void) { inpad = H5Tget_inpad(type); } - H5E_END_TRY; + H5E_END_TRY if (inpad > -1) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -5100,7 +5105,7 @@ test_conv_str_3(void) { sign = H5Tget_sign(type); } - H5E_END_TRY; + H5E_END_TRY if (sign > -1) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -5109,7 +5114,7 @@ test_conv_str_3(void) { tag = H5Tget_tag(type); } - H5E_END_TRY; + H5E_END_TRY if (tag) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -5118,7 +5123,7 @@ test_conv_str_3(void) { super = H5Tget_super(type); } - H5E_END_TRY; + H5E_END_TRY if (super >= 0) { FAIL_PUTS_ERROR("Operation not allowed for this type."); } /* end if */ @@ -5132,7 +5137,7 @@ error: H5Tclose(type); H5Tclose(super); } - H5E_END_TRY; + H5E_END_TRY if (buf) free(buf); @@ -5178,7 +5183,8 @@ test_conv_enum_1(void) for (i = 0; i < 26; i++) { s[0] = (char)('A' + i); H5Tenum_insert(t1, s, &i); - H5Tenum_insert(t2, s, (val = i * 1000 + i, &val)); + val = i * 1000 + i; + H5Tenum_insert(t2, s, &val); } /* end for */ /* Initialize the buffer */ @@ -5210,7 +5216,7 @@ error: H5Tclose(t1); H5Tclose(t2); } - H5E_END_TRY; + H5E_END_TRY if (buf) free(buf); @@ -5444,7 +5450,7 @@ test_bitfield_funcs(void) { size = H5Tget_ebias(type); } - H5E_END_TRY; + H5E_END_TRY if (size > 0) { H5_FAILED(); printf("Operation not allowed for this type.\n"); @@ -5455,7 +5461,7 @@ test_bitfield_funcs(void) { inpad = H5Tget_inpad(type); } - H5E_END_TRY; + H5E_END_TRY if (inpad > -1) { H5_FAILED(); printf("Operation not allowed for this type.\n"); @@ -5466,7 +5472,7 @@ test_bitfield_funcs(void) { cset = H5Tget_cset(type); } - H5E_END_TRY; + H5E_END_TRY if (cset > -1) { H5_FAILED(); printf("Operation not allowed for this type.\n"); @@ -5477,7 +5483,7 @@ test_bitfield_funcs(void) { strpad = H5Tget_strpad(type); } - H5E_END_TRY; + H5E_END_TRY if (strpad > -1) { H5_FAILED(); printf("Operation not allowed for this type.\n"); @@ -5488,7 +5494,7 @@ test_bitfield_funcs(void) { ret = H5Tset_sign(type, H5T_SGN_2); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf("Operation not allowed for this type.\n"); @@ -5499,7 +5505,7 @@ test_bitfield_funcs(void) { tag = H5Tget_tag(type); } - H5E_END_TRY; + H5E_END_TRY if (tag) { H5_FAILED(); printf("Operation not allowed for this type.\n"); @@ -5510,7 +5516,7 @@ test_bitfield_funcs(void) { super = H5Tget_super(type); } - H5E_END_TRY; + H5E_END_TRY if (super >= 0) { H5_FAILED(); printf("Operation not allowed for this type.\n"); @@ -5632,7 +5638,7 @@ opaque_check(int tag_it) { status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); printf(" opaque conversion should have failed but succeeded\n"); @@ -5701,7 +5707,7 @@ opaque_long(void) { ret = H5Tset_tag(dt, long_tag); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) TEST_ERROR; @@ -5758,7 +5764,7 @@ opaque_funcs(void) { ret = H5Tset_precision(type, (size_t)32); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { printf("Operation not allowed for this type.\n"); TEST_ERROR; @@ -5768,7 +5774,7 @@ opaque_funcs(void) { ret = H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { printf("Operation not allowed for this type.\n"); TEST_ERROR; @@ -5778,7 +5784,7 @@ opaque_funcs(void) { size = H5Tget_ebias(type); } - H5E_END_TRY; + H5E_END_TRY if (size > 0) { printf("Operation not allowed for this type.\n"); TEST_ERROR; @@ -5788,7 +5794,7 @@ opaque_funcs(void) { inpad = H5Tget_inpad(type); } - H5E_END_TRY; + H5E_END_TRY if (inpad > -1) { printf("Operation not allowed for this type.\n"); TEST_ERROR; @@ -5798,7 +5804,7 @@ opaque_funcs(void) { cset = H5Tget_cset(type); } - H5E_END_TRY; + H5E_END_TRY if (cset > -1) { printf("Operation not allowed for this type.\n"); TEST_ERROR; @@ -5808,7 +5814,7 @@ opaque_funcs(void) { strpad = H5Tget_strpad(type); } - H5E_END_TRY; + H5E_END_TRY if (strpad > -1) { printf("Operation not allowed for this type.\n"); TEST_ERROR; @@ -5818,7 +5824,7 @@ opaque_funcs(void) { ret = H5Tset_offset(type, (size_t)16); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { printf("Operation not allowed for this type.\n"); TEST_ERROR; @@ -5828,7 +5834,7 @@ opaque_funcs(void) { sign = H5Tget_sign(type); } - H5E_END_TRY; + H5E_END_TRY if (sign > -1) { printf("Operation not allowed for this type.\n"); TEST_ERROR; @@ -5838,7 +5844,7 @@ opaque_funcs(void) { super = H5Tget_super(type); } - H5E_END_TRY; + H5E_END_TRY if (super >= 0) { printf("Operation not allowed for this type.\n"); TEST_ERROR; @@ -5938,27 +5944,32 @@ test_encode(void) printf("Can't create enumerate type\n"); goto error; } - if (H5Tenum_insert(tid2, "RED", (enum_val = 0, &enum_val)) < 0) { + enum_val = 0; + if (H5Tenum_insert(tid2, "RED", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; } - if (H5Tenum_insert(tid2, "GREEN", (enum_val = 1, &enum_val)) < 0) { + enum_val = 1; + if (H5Tenum_insert(tid2, "GREEN", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; } - if (H5Tenum_insert(tid2, "BLUE", (enum_val = 2, &enum_val)) < 0) { + enum_val = 2; + if (H5Tenum_insert(tid2, "BLUE", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; } - if (H5Tenum_insert(tid2, "ORANGE", (enum_val = 3, &enum_val)) < 0) { + enum_val = 3; + if (H5Tenum_insert(tid2, "ORANGE", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; } - if (H5Tenum_insert(tid2, "YELLOW", (enum_val = 4, &enum_val)) < 0) { + enum_val = 4; + if (H5Tenum_insert(tid2, "YELLOW", &enum_val) < 0) { H5_FAILED(); printf("Can't insert field into enumeration type\n"); goto error; @@ -5995,7 +6006,7 @@ test_encode(void) { ret_id = H5Tdecode(cmpd_buf); } - H5E_END_TRY; + H5E_END_TRY if (ret_id != FAIL) { H5_FAILED(); printf("Decoded an empty buffer!\n"); @@ -6347,7 +6358,7 @@ test_encode(void) { ret = H5Tclose(decoded_tid1); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) { H5_FAILED(); printf("Decoded datatype should have been closed\n"); @@ -6358,7 +6369,7 @@ test_encode(void) { ret = H5Tclose(decoded_tid2); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) { H5_FAILED(); printf("Decoded datatype should have been closed\n"); @@ -6369,7 +6380,7 @@ test_encode(void) { ret = H5Tclose(decoded_tid3); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) { H5_FAILED(); printf("Decoded datatype should have been closed\n"); @@ -6420,7 +6431,7 @@ error: H5Tclose(decoded_tid3); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -6605,7 +6616,7 @@ error: H5Fclose(file); H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_latest() */ @@ -6799,7 +6810,7 @@ error: { H5Pclose(dxpl); } - H5E_END_TRY; + H5E_END_TRY return 1; #endif /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */ } /* end test_int_float_except() */ @@ -7030,7 +7041,7 @@ test_set_order(void) error: H5E_BEGIN_TRY H5Tclose(dtype); - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_set_order() */ @@ -7195,7 +7206,7 @@ error: H5Tclose(cmpd); H5Tclose(cmpd_array); H5Fclose(file); - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_set_order_compound() */ @@ -7456,7 +7467,7 @@ error: H5Dclose(dset); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (tag_ret) H5free_memory(tag_ret); return 1; @@ -7680,7 +7691,7 @@ error: H5Fclose(filea2); H5Fclose(fileb); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_delete_obj_named() */ @@ -7879,7 +7890,7 @@ error: H5Fclose(attr_fid); H5Fclose(type_fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_delete_obj_named_fileid() */ @@ -7963,7 +7974,7 @@ test_deprec(hid_t fapl) { status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR(" Predefined types should not be committable!"); @@ -7982,7 +7993,7 @@ test_deprec(hid_t fapl) { status = H5Tset_precision(type, (size_t)256); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR(" Committed type is not constant!"); @@ -7991,7 +8002,7 @@ test_deprec(hid_t fapl) { status = H5Tcommit1(file, "test_named_2 (should not exist)", type); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR(" Committed types should not be recommitted!"); @@ -8024,7 +8035,7 @@ test_deprec(hid_t fapl) { status = H5Tcommit1(file, "test_named_3 (should not exist)", type); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Types should not be committable to a read-only file!"); @@ -8046,7 +8057,7 @@ error: H5Tclose(type); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_deprec() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -8305,7 +8316,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -8448,7 +8459,7 @@ error: H5Tclose(base_dtype); H5Tclose(mem_dtype); } - H5E_END_TRY; + H5E_END_TRY return ret; } /* end of verify_version */ @@ -8650,7 +8661,7 @@ test_versionbounds(void) { ret = H5Pset_libver_bounds(fapl, versions[low], versions[high]); } - H5E_END_TRY; + H5E_END_TRY if (ret < 0) /* Invalid low/high combinations */ continue; @@ -8717,7 +8728,7 @@ error: H5Pclose(fapl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_versionbounds() */ diff --git a/test/earray.c b/test/earray.c index ad85281..8f5b2be 100644 --- a/test/earray.c +++ b/test/earray.c @@ -158,7 +158,7 @@ typedef struct earray_test_t { /* Local prototypes */ /* Local variables */ -const char *FILENAME[] = {"earray", "earray_tmp", NULL}; +static const char *FILENAME[] = {"earray", "earray_tmp", NULL}; /* Filename to use for all tests */ char filename_g[EARRAY_FILENAME_LEN]; @@ -591,7 +591,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -608,7 +608,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -624,7 +624,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -641,7 +641,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -656,7 +656,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -671,7 +671,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -688,7 +688,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -707,7 +707,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -724,7 +724,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -739,7 +739,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE { ea = H5EA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened extensible array */ H5EA_close(ea); @@ -790,7 +790,7 @@ error: H5EA_close(ea); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_create() */ @@ -858,7 +858,7 @@ error: H5EA_close(ea); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_reopen() */ @@ -963,7 +963,7 @@ error: H5Fclose(file); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_open_twice() */ @@ -1102,7 +1102,7 @@ error: H5Fclose(file0); H5Fclose(file00); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_open_twice_diff() */ @@ -1164,7 +1164,7 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { ea2 = H5EA_open(f, ea_addr, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea2) { /* Close opened array */ H5EA_close(ea2); @@ -1187,7 +1187,7 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { ea = H5EA_open(f, ea_addr, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ea) { /* Close opened array */ H5EA_close(ea); @@ -1222,7 +1222,7 @@ error: H5EA_close(ea2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_delete_open() */ @@ -2117,7 +2117,7 @@ error: H5EA_close(ea); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_set_elmts() */ @@ -2273,7 +2273,7 @@ error: H5EA_close(ea); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_skip_elmts() */ @@ -2495,7 +2495,7 @@ error: { H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/efc.c b/test/efc.c index 4e35e43..cb7cdde 100644 --- a/test/efc.c +++ b/test/efc.c @@ -18,7 +18,7 @@ #include "H5Iprivate.h" #include "H5Pprivate.h" /* Property lists */ -const char *FILENAME[] = {"efc0", "efc1", "efc2", "efc3", "efc4", "efc5", NULL}; +static const char *FILENAME[] = {"efc0", "efc1", "efc2", "efc3", "efc4", "efc5", NULL}; /* Windows doesn't have PATH_MAX */ #ifndef PATH_MAX diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 83375f8..cd97cb9 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -105,7 +105,7 @@ error: H5Pclose(pl); H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY return (-1); } /* end test_encode_decode() */ diff --git a/test/err_compat.c b/test/err_compat.c index 62a310f..f2bd2ab 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -24,15 +24,15 @@ main(void) } #else /* H5_NO_DEPRECATED_SYMBOLS */ -const char *FILENAME[] = {"errors_compat", NULL}; +static const char *FILENAME[] = {"errors_compat", NULL}; #define DIM0 100 #define DIM1 200 -int **ipoints2 = NULL; -int **icheck2 = NULL; -int *ipoints2_data = NULL; -int *icheck2_data = NULL; +static int **ipoints2 = NULL; +static int **icheck2 = NULL; +static int *ipoints2_data = NULL; +static int *icheck2_data = NULL; #define DSET_NAME "a_dataset" @@ -345,7 +345,7 @@ test_h5epush1(hid_t file) did = H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* Create the dataset */ if ((did = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/test/error_test.c b/test/error_test.c index 4fe96f4..b4d366a 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -25,31 +25,31 @@ main(void) } #else /* H5_USE_16_API */ -const char *FILENAME[] = {"errors", NULL}; +static const char *FILENAME[] = {"errors", NULL}; #define DATAFILE "filter_error" #define DIM0 100 #define DIM1 200 -int **ipoints2 = NULL; -int **icheck2 = NULL; -int *ipoints2_data = NULL; -int *icheck2_data = NULL; +static int **ipoints2 = NULL; +static int **icheck2 = NULL; +static int *ipoints2_data = NULL; +static int *icheck2_data = NULL; -hid_t ERR_CLS; -hid_t ERR_CLS2; -hid_t ERR_STACK; +static hid_t ERR_CLS; +static hid_t ERR_CLS2; +static hid_t ERR_STACK; -hid_t ERR_MAJ_TEST; -hid_t ERR_MAJ_IO; -hid_t ERR_MAJ_API; +static hid_t ERR_MAJ_TEST; +static hid_t ERR_MAJ_IO; +static hid_t ERR_MAJ_API; -hid_t ERR_MIN_SUBROUTINE; -hid_t ERR_MIN_ERRSTACK; -hid_t ERR_MIN_CREATE; -hid_t ERR_MIN_WRITE; -hid_t ERR_MIN_GETNUM; +static hid_t ERR_MIN_SUBROUTINE; +static hid_t ERR_MIN_ERRSTACK; +static hid_t ERR_MIN_CREATE; +static hid_t ERR_MIN_WRITE; +static hid_t ERR_MIN_GETNUM; #define DSET_NAME "a_dataset" #define FAKE_ID (hid_t)0 @@ -110,7 +110,7 @@ test_error(hid_t file) { dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* Create the dataset */ if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < diff --git a/test/event_set.c b/test/event_set.c index e520fe3..8102d4a 100644 --- a/test/event_set.c +++ b/test/event_set.c @@ -18,9 +18,9 @@ #define EVENT_SET_NUM_CONNECTOR_IDS 2 -const char *FILENAME[] = {"event_set_1", NULL}; +static const char *FILENAME[] = {"event_set_1", NULL}; -hid_t connector_ids_g[EVENT_SET_NUM_CONNECTOR_IDS]; +static hid_t connector_ids_g[EVENT_SET_NUM_CONNECTOR_IDS]; herr_t fake_wait_request_wait(void *req, uint64_t timeout, H5VL_request_status_t *status); herr_t fake_wait_request_free(void *req); @@ -232,7 +232,7 @@ error: { H5ESclose(es_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -633,7 +633,7 @@ error: { H5ESclose(es_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } diff --git a/test/evict_on_close.c b/test/evict_on_close.c index 89a1ae0..feebb08 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -562,7 +562,7 @@ error: H5Pclose(dcpl_id); H5Pclose(fapl_copy_id); } - H5E_END_TRY; + H5E_END_TRY free(data); @@ -678,7 +678,7 @@ error: H5Gclose(gid1); H5Gclose(gid2); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -781,7 +781,7 @@ error: { H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -847,7 +847,7 @@ check_evict_on_close_api(void) { status = H5Pset_evict_on_close(dapl_id, evict_on_close); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR("H5Pset_evict_on_close() accepted invalid access plist."); @@ -856,7 +856,7 @@ check_evict_on_close_api(void) { status = H5Pget_evict_on_close(H5I_INVALID_HID, &evict_on_close); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR("H5Pget_evict_on_close() accepted invalid hid_t."); @@ -969,7 +969,7 @@ error: H5Fclose(fid); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY exit(EXIT_FAILURE); @@ -1006,7 +1006,7 @@ check_evict_on_close_parallel_fail(void) { status = H5Pset_evict_on_close(fapl_id, evict_on_close); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR("H5Pset_evict_on_close() did not fail in parallel HDF5."); diff --git a/test/extend.c b/test/extend.c index 66927c0..554cf2a 100644 --- a/test/extend.c +++ b/test/extend.c @@ -16,7 +16,7 @@ #include "h5test.h" -const char *FILENAME[] = {"extend", NULL}; +static const char *FILENAME[] = {"extend", NULL}; #define N1X 100 /* USE AN EVEN NUMBER! */ #define N1Y 100 /* USE AN EVEN NUMBER! */ diff --git a/test/external.c b/test/external.c index 1865359..cc0d262 100644 --- a/test/external.c +++ b/test/external.c @@ -128,7 +128,7 @@ test_non_extendible(hid_t file) { dset_addr = H5Dget_offset(dset); } - H5E_END_TRY; + H5E_END_TRY if (dset_addr != HADDR_UNDEF) FAIL_STACK_ERROR; @@ -175,7 +175,7 @@ error: H5Sclose(space); H5Dclose(dset); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_non_extendible() */ @@ -213,7 +213,7 @@ test_too_small(hid_t file) { dset = H5Dcreate2(file, "dset2", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dset >= 0) FAIL_PUTS_ERROR(" Small external file succeeded instead of failing."); if (H5Sclose(space) < 0) @@ -231,7 +231,7 @@ error: H5Pclose(dcpl); H5Dclose(dset); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_too_small() */ @@ -284,7 +284,7 @@ error: H5Pclose(dcpl); H5Sclose(space); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_large_enough_current_eventual() */ @@ -322,7 +322,7 @@ test_large_enough_current_not_eventual(hid_t file) { dset = H5Dcreate2(file, "dset4", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dset >= 0) FAIL_PUTS_ERROR(" Small external file succeeded instead of failing."); @@ -341,7 +341,7 @@ error: H5Pclose(dcpl); H5Sclose(space); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_large_enough_current_not_eventual() */ @@ -431,7 +431,7 @@ error: H5Pclose(dcpl); H5Sclose(space); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_unlimited() */ @@ -531,7 +531,7 @@ test_multiple_files(hid_t file) { dset = H5Dcreate2(file, "dset7", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dset >= 0) FAIL_PUTS_ERROR(" Small external files succeeded instead of failing."); @@ -550,7 +550,7 @@ error: H5Pclose(dcpl); H5Sclose(space); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_multiple_files() */ @@ -583,7 +583,7 @@ test_add_to_unlimited(void) { status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR(" H5Pset_external() succeeded when it should have failed."); @@ -602,7 +602,7 @@ error: { H5Pclose(dcpl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_add_to_unlimited() */ @@ -634,7 +634,7 @@ test_overflow(void) { status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR(" H5Pset_external() succeeded when it should have failed."); @@ -649,7 +649,7 @@ error: { H5Pclose(dcpl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_overflow() */ @@ -771,7 +771,7 @@ error: H5Sclose(hs_space); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_read_file_set() */ @@ -894,7 +894,7 @@ error: H5Sclose(file_space); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_write_file_set() */ @@ -988,7 +988,7 @@ error: H5Pclose(dcpl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_path_absolute() */ @@ -1075,7 +1075,7 @@ error: H5Sclose(space); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_path_relative() */ @@ -1165,7 +1165,7 @@ test_path_relative_cwd(hid_t fapl) { dset3 = H5Dopen2(file, "dset1", dapl); } - H5E_END_TRY; + H5E_END_TRY if (dset3 >= 0) FAIL_PUTS_ERROR("reopening the dataset with a different efile_prefix succeeded"); @@ -1202,7 +1202,7 @@ test_path_relative_cwd(hid_t fapl) { dset3 = H5Dopen2(file, "dset1", dapl); } - H5E_END_TRY; + H5E_END_TRY if (dset3 >= 0) FAIL_PUTS_ERROR("reopening the dataset with a different efile_prefix succeeded"); @@ -1243,7 +1243,7 @@ error: H5Sclose(space); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_path_relative_cwd() */ @@ -1345,7 +1345,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_h5d_get_access_plist() */ @@ -1471,7 +1471,7 @@ error: H5Pclose(fapl_id_new); H5Gclose(gid); } - H5E_END_TRY; + H5E_END_TRY nerrors = MAX(1, nerrors); printf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s"); return EXIT_FAILURE; diff --git a/test/external_env.c b/test/external_env.c index 49a865c..1a91c2a 100644 --- a/test/external_env.c +++ b/test/external_env.c @@ -121,7 +121,7 @@ error: H5Sclose(space); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_path_env() */ @@ -206,7 +206,7 @@ error: H5Pclose(fapl_id_new); H5Gclose(gid); } - H5E_END_TRY; + H5E_END_TRY nerrors = MAX(1, nerrors); printf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s"); return EXIT_FAILURE; diff --git a/test/farray.c b/test/farray.c index ff5685a..a7a4125 100644 --- a/test/farray.c +++ b/test/farray.c @@ -95,7 +95,7 @@ struct farray_test_param_t { }; /* Local variables */ -const char *FILENAME[] = {"farray", "farray_tmp", NULL}; +static const char *FILENAME[] = {"farray", "farray_tmp", NULL}; /* Filename to use for all tests */ char filename_g[FARRAY_FILENAME_LEN]; @@ -443,7 +443,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE { fa = H5FA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (fa) { /* Close opened fixed array */ H5FA_close(fa); @@ -460,7 +460,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE { fa = H5FA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (fa) { /* Close opened fixed array */ H5FA_close(fa); @@ -477,7 +477,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE { fa = H5FA_create(f, &test_cparam, NULL); } - H5E_END_TRY; + H5E_END_TRY if (fa) { /* Close opened fixed array */ H5FA_close(fa); @@ -528,7 +528,7 @@ error: H5FA_close(fa); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_create() */ @@ -596,7 +596,7 @@ error: H5FA_close(fa); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_reopen() */ @@ -699,7 +699,7 @@ error: H5Fclose(fid); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_open_twice() */ @@ -832,7 +832,7 @@ error: H5Fclose(fid0); H5Fclose(fid00); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_open_twice_diff() */ @@ -894,7 +894,7 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) { fa2 = H5FA_open(f, fa_addr, NULL); } - H5E_END_TRY; + H5E_END_TRY if (fa2) { /* Close opened array */ H5FA_close(fa2); @@ -917,7 +917,7 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) { fa = H5FA_open(f, fa_addr, NULL); } - H5E_END_TRY; + H5E_END_TRY if (fa) { /* Close opened array */ H5FA_close(fa); @@ -952,7 +952,7 @@ error: H5FA_close(fa2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_delete_open() */ @@ -1476,7 +1476,7 @@ error: H5FA_close(fa); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_set_elmts() */ @@ -1604,7 +1604,7 @@ error: H5FA_close(fa); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_skip_elmts() */ @@ -1796,7 +1796,7 @@ error: { H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/fheap.c b/test/fheap.c index 6c6a003..b8c78da 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -86,7 +86,7 @@ #define NUM_PB_FS 6 #define PAGE_BUFFER_PAGE_SIZE 4096 -const char *FILENAME[] = {"fheap", NULL}; +static const char *FILENAME[] = {"fheap", NULL}; /* Types of tests to perform */ typedef enum { @@ -1818,7 +1818,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_create() */ @@ -1968,7 +1968,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_reopen() */ @@ -2142,7 +2142,7 @@ error: H5Fclose(file); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_open_twice() */ @@ -2242,7 +2242,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { fh2 = H5HF_open(f, fh_addr); } - H5E_END_TRY; + H5E_END_TRY if (fh2) { /* Close opened heap */ H5HF_close(fh2); @@ -2282,7 +2282,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { fh = H5HF_open(f, fh_addr); } - H5E_END_TRY; + H5E_END_TRY if (fh) { /* Close opened heap */ H5HF_close(fh); @@ -2318,7 +2318,7 @@ error: H5HF_close(fh2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_delete_open() */ @@ -2469,7 +2469,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { fh = H5HF_create(f, &tmp_cparam); } - H5E_END_TRY; + H5E_END_TRY if (NULL != fh) FAIL_STACK_ERROR; @@ -2633,7 +2633,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { fh = H5HF_create(f, &tmp_cparam); } - H5E_END_TRY; + H5E_END_TRY if (NULL != fh) FAIL_STACK_ERROR; @@ -2653,7 +2653,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_id_limits() */ @@ -2772,7 +2772,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_filtered_create() */ @@ -2908,7 +2908,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_size() */ @@ -3040,7 +3040,7 @@ error: H5Fclose(file1); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_reopen_hdr() */ @@ -3111,7 +3111,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa { ret = H5HF_insert(fh, (size_t)0, shared_wobj_g, heap_id); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5Eclear2(H5E_DEFAULT); @@ -3149,7 +3149,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_insert_weird() */ @@ -3249,7 +3249,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_insert_first() */ @@ -3341,7 +3341,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_insert_second() */ @@ -3436,7 +3436,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_insert_root_mult() */ @@ -3539,7 +3539,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_insert_force_indirect() */ @@ -3642,7 +3642,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_insert_fill_second() */ @@ -3751,7 +3751,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_insert_third_direct() */ @@ -3844,7 +3844,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_first_row() */ @@ -3944,7 +3944,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_start_second_row() */ @@ -4041,7 +4041,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_second_row() */ @@ -4149,7 +4149,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_start_third_row() */ @@ -4244,7 +4244,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_fourth_row() */ @@ -4337,7 +4337,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_all_root_direct() */ @@ -4435,7 +4435,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_first_recursive_indirect() */ @@ -4542,7 +4542,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_second_direct_recursive_indirect() */ @@ -4641,7 +4641,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_first_recursive_indirect() */ @@ -4748,7 +4748,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_second_recursive_indirect() */ @@ -4853,7 +4853,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_second_recursive_indirect() */ @@ -4950,7 +4950,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_recursive_indirect_row() */ @@ -5056,7 +5056,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_start_2nd_recursive_indirect() */ @@ -5155,7 +5155,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_recursive_indirect_two_deep() */ @@ -5262,7 +5262,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_start_3rd_recursive_indirect() */ @@ -5370,7 +5370,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_first_3rd_recursive_indirect() */ @@ -5475,7 +5475,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_3rd_recursive_indirect_row() */ @@ -5580,7 +5580,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_all_3rd_recursive_indirect() */ @@ -5692,7 +5692,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_start_4th_recursive_indirect() */ @@ -5810,7 +5810,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_first_4th_recursive_indirect() */ @@ -5919,7 +5919,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_4th_recursive_indirect_row() */ @@ -6028,7 +6028,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_all_4th_recursive_indirect() */ #endif /* ALL_INSERT_TESTS */ @@ -6159,7 +6159,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_start_5th_recursive_indirect() */ @@ -6251,7 +6251,7 @@ fprintf(stderr, "Random # seed was: %lu\n", seed); { ret = H5HF_remove(fh, heap_id); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) FAIL_STACK_ERROR; @@ -6280,7 +6280,7 @@ fprintf(stderr, "Random # seed was: %lu\n", seed); { ret = H5HF_remove(fh, heap_id); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5Eclear2(H5E_DEFAULT); @@ -6290,7 +6290,7 @@ fprintf(stderr, "Random # seed was: %lu\n", seed); { ret = H5HF_read(fh, heap_id, shared_robj_g); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5Eclear2(H5E_DEFAULT); @@ -6316,7 +6316,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_bogus() */ @@ -6477,7 +6477,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_one() */ @@ -6667,7 +6667,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_two() */ @@ -6833,7 +6833,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_one_larger() */ @@ -7070,7 +7070,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_two_larger() */ @@ -7367,7 +7367,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_three_larger() */ @@ -7488,7 +7488,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY free(heap_id); free(heap_id_data); @@ -7562,7 +7562,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_root_direct() */ @@ -7647,7 +7647,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_two_direct() */ @@ -7714,7 +7714,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_first_row() */ @@ -7783,7 +7783,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_first_two_rows() */ @@ -7856,7 +7856,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_first_four_rows() */ @@ -7923,7 +7923,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_all_root_direct() */ @@ -7994,7 +7994,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_2nd_indirect() */ @@ -8069,7 +8069,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_remove_3rd_indirect() */ @@ -8146,7 +8146,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_skip_start_block() */ @@ -8241,7 +8241,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_skip_start_block_add_back() */ @@ -8348,7 +8348,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_skip_start_block_add_skipped() */ @@ -8439,7 +8439,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_skip_2nd_block() */ @@ -8579,7 +8579,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_skip_2nd_block_add_skipped() */ @@ -8744,7 +8744,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_one_partial_skip_2nd_block_add_skipped() */ @@ -8871,7 +8871,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_row_skip_add_skipped() */ @@ -8997,7 +8997,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_skip_direct_skip_indirect_two_rows_add_skipped() */ @@ -9118,7 +9118,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_direct_skip_indirect_start_block_add_skipped() */ @@ -9246,7 +9246,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped() */ @@ -9386,7 +9386,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped() */ @@ -9551,7 +9551,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped() */ @@ -9702,7 +9702,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_direct_skip_indirect_two_rows_add_skipped() */ @@ -9884,7 +9884,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped() */ @@ -10010,7 +10010,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_2nd_direct_skip_start_block_add_skipped() */ @@ -10149,7 +10149,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped() */ @@ -10298,7 +10298,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped() */ @@ -10452,7 +10452,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped() */ @@ -10612,7 +10612,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped() */ @@ -10779,7 +10779,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped() */ @@ -10937,7 +10937,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped() */ @@ -11114,7 +11114,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped() */ @@ -11328,7 +11328,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped() */ @@ -11526,7 +11526,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped() */ @@ -11760,7 +11760,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped() */ @@ -11890,7 +11890,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_frag_simple() */ @@ -12056,7 +12056,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_frag_direct() */ @@ -12164,7 +12164,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_frag_2nd_direct() */ @@ -12281,7 +12281,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_man_frag_3rd_direct() */ @@ -12428,7 +12428,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_huge_insert_one() */ @@ -12655,7 +12655,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_huge_insert_two() */ @@ -12957,7 +12957,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_huge_insert_three() */ @@ -13379,7 +13379,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_huge_insert_mix() */ @@ -13587,7 +13587,7 @@ error: H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */ H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_filtered_huge() */ @@ -13734,7 +13734,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_tiny_insert_one() */ @@ -13961,7 +13961,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_tiny_insert_two() */ @@ -14565,7 +14565,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_tiny_insert_mix() */ @@ -14735,7 +14735,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_filtered_man_root_direct() */ @@ -15058,7 +15058,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_filtered_man_root_indirect() */ @@ -15258,7 +15258,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_random() */ @@ -15472,7 +15472,7 @@ error: H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */ H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_random_pow2() */ @@ -15586,7 +15586,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { ret = H5HF_write(fh, huge_heap_id, &id_changed, shared_wobj_g); } - H5E_END_TRY; + H5E_END_TRY assert(!id_changed); if (tparam->comp == FHEAP_TEST_COMPRESS) { if (ret >= 0) @@ -15602,7 +15602,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { ret = H5HF_write(fh, tiny_heap_id, &id_changed, shared_wobj_g); } - H5E_END_TRY; + H5E_END_TRY assert(!id_changed); if (ret >= 0) TEST_ERROR; @@ -15760,7 +15760,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_write() */ @@ -15929,7 +15929,7 @@ error: H5HF_close(fh); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_bug1() */ @@ -16551,7 +16551,7 @@ error: H5Pclose(def_fcpl); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/file_image.c b/test/file_image.c index 84cd6f9..2b4e481 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -43,19 +43,19 @@ #define USERBLOCK_SIZE 512 -const char *FILENAME[] = {"file_image_core_test", NULL}; +static const char *FILENAME[] = {"file_image_core_test", NULL}; /* need a second file name array, as the first file name array contains * files we don't want to delete on cleanup. */ -const char *FILENAME2[] = {"sec2_get_file_image_test", - "stdio_get_file_image_test", - "core_get_file_image_test", - "family_get_file_image_test", - "multi_get_file_image_test", - "split_get_file_image_test", - "get_file_image_error_rejection_test", - NULL}; +static const char *FILENAME2[] = {"sec2_get_file_image_test", + "stdio_get_file_image_test", + "core_get_file_image_test", + "family_get_file_image_test", + "multi_get_file_image_test", + "split_get_file_image_test", + "get_file_image_error_rejection_test", + NULL}; typedef struct { unsigned char used_callbacks; /* Bitfield for tracking callbacks */ @@ -1033,7 +1033,7 @@ test_get_file_image_error_rejection(void) { bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)(image_size - 1)); } - H5E_END_TRY; + H5E_END_TRY VERIFY(bytes_read < 0, "H5Fget_file_image(2 -- test 1) succeeded."); /* Call H5Fget_file_image() with good buffer and buffer size, @@ -1043,7 +1043,7 @@ test_get_file_image_error_rejection(void) { bytes_read = H5Fget_file_image((hid_t)0, image_ptr, (size_t)(image_size)); } - H5E_END_TRY; + H5E_END_TRY VERIFY(bytes_read < 0, "H5Fget_file_image(3 -- test 1) succeeded."); /* Call H5Fget_file_image() with good buffer and buffer size, @@ -1053,7 +1053,7 @@ test_get_file_image_error_rejection(void) { bytes_read = H5Fget_file_image(dset_id, image_ptr, (size_t)(image_size)); } - H5E_END_TRY; + H5E_END_TRY VERIFY(bytes_read < 0, "H5Fget_file_image(4 -- test 1) succeeded."); /* Close dset and space */ @@ -1157,7 +1157,7 @@ test_get_file_image_error_rejection(void) { image_size = H5Fget_file_image(file_id, NULL, (size_t)0); } - H5E_END_TRY; + H5E_END_TRY VERIFY(image_size == -1, "H5Fget_file_image(5) succeeded."); /* Close dset and space */ @@ -1219,7 +1219,7 @@ test_get_file_image_error_rejection(void) { image_size = H5Fget_file_image(file_id, NULL, (size_t)0); } - H5E_END_TRY; + H5E_END_TRY VERIFY(image_size == -1, "H5Fget_file_image(6) succeeded."); /* Close dset and space */ @@ -1279,7 +1279,7 @@ test_get_file_image_error_rejection(void) { image_size = H5Fget_file_image(file_id, NULL, (size_t)0); } - H5E_END_TRY; + H5E_END_TRY VERIFY(image_size == -1, "H5Fget_file_image(7) succeeded."); /* Close dset and space */ diff --git a/test/fillval.c b/test/fillval.c index 565c82f..81f7b36 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -22,8 +22,8 @@ */ /* #define NO_FILLING */ -const char *FILENAME[] = {"fillval_1", "fillval_2", "fillval_3", "fillval_4", "fillval_5", - "fillval_6", "fillval_7", "fillval_8", "fillval_9", NULL}; +static const char *FILENAME[] = {"fillval_1", "fillval_2", "fillval_3", "fillval_4", "fillval_5", + "fillval_6", "fillval_7", "fillval_8", "fillval_9", NULL}; /* Common type for compound datatype operations */ typedef struct { @@ -81,7 +81,7 @@ error: { H5Tclose(ret_value); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -131,7 +131,7 @@ error: H5Tclose(str_id); H5Tclose(ret_value); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end create_compound_vl_type() */ @@ -187,7 +187,7 @@ test_getset(void) { H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i); } - H5E_END_TRY; + H5E_END_TRY if (fill_i != 0) { H5_FAILED(); HDputs(" H5Pget_fill_value() should return default 0"); @@ -256,7 +256,7 @@ error: H5Tclose(type_si); H5Tclose(type_ss); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -369,7 +369,7 @@ error: H5E_BEGIN_TRY { } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_getset_vl() */ @@ -495,7 +495,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if (H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY } /* II. Test early space allocation cases */ @@ -548,7 +548,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if (H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT) != FAIL) goto error; } - H5E_END_TRY; + H5E_END_TRY /* Close everything */ if (H5D_COMPACT != layout) { @@ -824,7 +824,7 @@ error: H5Dclose(dset8); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -852,8 +852,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f int i, j, *buf = NULL, odd; unsigned u; comp_datatype rd_c, fill_c, should_be_c; - comp_datatype *buf_c = NULL; - H5D_space_status_t allocation; + comp_datatype *buf_c = NULL; + H5D_space_status_t allocation = H5D_SPACE_STATUS_ERROR; fill_c.a = 0; fill_c.x = 0; @@ -1156,7 +1156,7 @@ error: H5Sclose(fspace); H5Sclose(mspace); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -1352,7 +1352,7 @@ error: H5Tclose(ctype_id); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return nerrors; } @@ -1981,7 +1981,7 @@ error: H5Sclose(fspace); H5Sclose(mspace); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_extend_cases() */ @@ -2128,7 +2128,7 @@ error: H5Pclose(dcpl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; skip: @@ -2140,7 +2140,7 @@ skip: H5Pclose(dcpl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 0; } /* end test_extend() */ @@ -2291,7 +2291,7 @@ error: H5Dclose(dset2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -2411,7 +2411,7 @@ error: H5Sclose(fspace); H5Sclose(rspace); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -2555,7 +2555,7 @@ error: H5Pclose(dcpl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return nerrors; } diff --git a/test/filter_fail.c b/test/filter_fail.c index 37ba9bf..0044cf9 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -22,7 +22,7 @@ #define DIM 10 #define FILTER_CHUNK_DIM 2 -const char *FILENAME[] = {"filter_fail_with_cache", "filter_fail_without_cache", NULL}; +static const char *FILENAME[] = {"filter_fail_with_cache", "filter_fail_without_cache", NULL}; static size_t filter_fail(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); @@ -156,7 +156,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) { ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); HDputs(" Data writing is supposed to fail because the chunk can't be written to file."); @@ -177,7 +177,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) { ret = H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); HDputs(" Dataset is supposed to fail because the chunk can't be flushed to file."); @@ -205,7 +205,7 @@ error: H5Dclose(dataset); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_filter_write() */ @@ -343,7 +343,7 @@ error: H5Dclose(dataset); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_filter_read() */ diff --git a/test/filter_plugin.c b/test/filter_plugin.c index 3bedc57..64230e5 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -30,7 +30,7 @@ #define FILTER3_ID 259 #define FILTER4_ID 260 -const char *FILENAME[] = {"filter_plugin", NULL}; +static const char *FILENAME[] = {"filter_plugin", NULL}; #define FILENAME_BUF_SIZE 1024 /* Dataset names */ @@ -50,10 +50,10 @@ const char *FILENAME[] = {"filter_plugin", NULL}; #define HYPERSLAB_SIZE2 50 /* Global size arrays */ -const hsize_t sizes_g[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */ -const hsize_t hs_sizes_g[2] = {HYPERSLAB_SIZE1, HYPERSLAB_SIZE2}; /* Hyperslab sizes */ -const hsize_t hs_offsets_g[2] = {HYPERSLAB_OFFSET1, HYPERSLAB_OFFSET2}; /* Hyperslab offsets */ -const hsize_t chunk_sizes_g[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chunk dimensions */ +static const hsize_t sizes_g[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */ +static const hsize_t hs_sizes_g[2] = {HYPERSLAB_SIZE1, HYPERSLAB_SIZE2}; /* Hyperslab sizes */ +static const hsize_t hs_offsets_g[2] = {HYPERSLAB_OFFSET1, HYPERSLAB_OFFSET2}; /* Hyperslab offsets */ +static const hsize_t chunk_sizes_g[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chunk dimensions */ /* Limit random number within 20000 */ #define RANDOM_LIMIT 20000 @@ -64,10 +64,10 @@ const hsize_t chunk_sizes_g[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chun #define TOP_LEVEL_GROUP_NAME "top-level group" /* Global arrays in which to save data */ -int **orig_deflate_g = NULL; -int **orig_dynlib1_g = NULL; -int **orig_dynlib2_g = NULL; -int **orig_dynlib4_g = NULL; +static int **orig_deflate_g = NULL; +static int **orig_dynlib1_g = NULL; +static int **orig_dynlib2_g = NULL; +static int **orig_dynlib4_g = NULL; /*------------------------------------------------------------------------- * Function: free_2D_array @@ -1333,7 +1333,7 @@ test_filter_numbers(void) id = H5Z_FILTER_MAX + 1; status = H5Pget_filter_by_id2(dcpl_id, id, &flags, &nelmts, NULL, 0, NULL, &filter_config); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (status != FAIL) @@ -1344,7 +1344,7 @@ test_filter_numbers(void) id = -1; status = H5Pget_filter_by_id2(dcpl_id, id, &flags, &nelmts, NULL, 0, NULL, &filter_config); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (status != FAIL) @@ -1358,7 +1358,7 @@ test_filter_numbers(void) id = H5Z_FILTER_MAX + 1; status = H5Pget_filter_by_id1(dcpl_id, id, &flags, &nelmts, NULL, 0, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (status != FAIL) @@ -1369,7 +1369,7 @@ test_filter_numbers(void) id = -1; status = H5Pget_filter_by_id1(dcpl_id, id, &flags, &nelmts, NULL, 0, NULL); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (status != FAIL) @@ -1388,7 +1388,7 @@ error: { H5Pclose(dcpl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_filter_numbers() */ diff --git a/test/flush1.c b/test/flush1.c index 37e8201..074c76c 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -24,9 +24,9 @@ #define H5FD_TESTING #include "H5FDpkg.h" /* File drivers */ -const char *FILENAME[] = {"flush", "flush-swmr", "noflush", - "noflush-swmr", "flush_extend", "flush_extend-swmr", - "noflush_extend", "noflush_extend-swmr", NULL}; +static const char *FILENAME[] = {"flush", "flush-swmr", "noflush", + "noflush-swmr", "flush_extend", "flush_extend-swmr", + "noflush_extend", "noflush_extend-swmr", NULL}; /* Number and size of dataset dims, chunk size, etc. */ #define NDIMS 1 @@ -93,7 +93,7 @@ error: H5Gclose(gid); H5Gclose(top_gid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end create_file() */ @@ -154,7 +154,7 @@ error: H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY free(data); @@ -318,7 +318,7 @@ error: { H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY exit(EXIT_FAILURE); } /* end main() */ diff --git a/test/flush2.c b/test/flush2.c index 8c54577..05beed7 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -27,9 +27,9 @@ /* This is used in the helper routine clear_status_flags() */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" -const char *FILENAME[] = {"flush", "flush-swmr", "noflush", - "noflush-swmr", "flush_extend", "flush_extend-swmr", - "noflush_extend", "noflush_extend-swmr", NULL}; +static const char *FILENAME[] = {"flush", "flush-swmr", "noflush", + "noflush-swmr", "flush_extend", "flush_extend-swmr", + "noflush_extend", "noflush_extend-swmr", NULL}; /* Number and size of dataset dims, chunk size, etc. */ #define NELEMENTS 10000 @@ -94,7 +94,7 @@ error: H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY free(data); @@ -155,7 +155,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* end file_ok() */ @@ -205,7 +205,7 @@ error: H5Pclose(new_fapl_id); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end clear_status_flags() */ diff --git a/test/flushrefresh.c b/test/flushrefresh.c index a9d9f02..745b6ef 100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -63,26 +63,26 @@ For errors occurring in the spawned process (from the test script), use the PROCESS_ERROR macro, which will send a signal to the main process so the main process can propagate errors correctly. */ -FILE *errorfile; +static FILE *errorfile; #define ERRFILE "flushrefresh_ERROR" #define PROCESS_ERROR \ - { \ + do { \ errorfile = fopen(ERRFILE, "w+"); \ fprintf(errorfile, "Error occurred in flushrefresh.\n"); \ fflush(errorfile); \ - HDfclose(errorfile); \ + fclose(errorfile); \ TEST_ERROR; \ - } + } while (0) #define CLEANUP_FILES \ - { \ + do { \ HDremove(ERRFILE); \ HDremove(FILENAME); \ HDremove(SIGNAL_TO_SCRIPT); \ HDremove(SIGNAL_BETWEEN_PROCESSES_1); \ HDremove(SIGNAL_BETWEEN_PROCESSES_2); \ HDremove(SIGNAL_FROM_SCRIPT); \ - } + } while (0) /* ===================== */ /* Function Declarations */ @@ -177,7 +177,7 @@ main(int argc, char *argv[]) else { /* Illegal number of arguments supplied. Error. */ fprintf(stderr, "Error. %d is an Invalid number of arguments to main().\n", argc); - PROCESS_ERROR + PROCESS_ERROR; } /* end if */ return EXIT_SUCCESS; @@ -1065,7 +1065,7 @@ flush_verification(const char *obj_pathname, const char *expected) oid = H5Oopen(fid, obj_pathname, H5P_DEFAULT); status = H5Oget_info3(oid, &oinfo, H5O_INFO_BASIC); } - H5E_END_TRY; + H5E_END_TRY /* Compare to expected result */ if (HDstrcmp(expected, FLUSHED) == 0) { @@ -1092,7 +1092,7 @@ flush_verification(const char *obj_pathname, const char *expected) H5Oclose(oid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return SUCCEED; @@ -1356,7 +1356,7 @@ check_for_errors(void) FILE *file; if ((file = fopen(ERRFILE, "r"))) { - HDfclose(file); + fclose(file); HDremove(ERRFILE); return FAIL; } /* end if */ diff --git a/test/freespace.c b/test/freespace.c index b00540b..e1628b7 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -58,7 +58,7 @@ #define FSPACE_THRHD_DEF 1 /* Default: no alignment threshold */ #define FSPACE_ALIGN_DEF 1 /* Default: no alignment */ -const char *FILENAME[] = {"frspace", NULL}; +static const char *FILENAME[] = {"frspace", NULL}; typedef struct frspace_state_t { hsize_t tot_space; /* Total amount of space tracked */ @@ -550,7 +550,7 @@ error: H5FS_close(f, frsp); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_fs_create() */ @@ -898,7 +898,7 @@ error: H5FS_close(f, frsp); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_fs_sect_add() */ @@ -1270,7 +1270,7 @@ error: H5FS_close(f, frsp); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_fs_sect_find() */ @@ -1746,7 +1746,7 @@ error: H5FS_close(f, frsp); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_fs_sect_merge() */ @@ -2110,7 +2110,7 @@ error: H5FS_close(f, frsp); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_sect_shrink() */ @@ -2385,7 +2385,7 @@ error: H5FS_close(f, frsp); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_sect_change_class() */ @@ -2763,7 +2763,7 @@ error: H5FS_close(f, frsp); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_sect_extend() */ @@ -2867,7 +2867,7 @@ error: H5FS_close(f, frsp); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_fs_sect_iterate() */ @@ -2926,7 +2926,7 @@ error: { H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/gen_bad_compound.c b/test/gen_bad_compound.c index cfa2975..2f2cd55 100644 --- a/test/gen_bad_compound.c +++ b/test/gen_bad_compound.c @@ -23,7 +23,7 @@ #define FILENAME "bad_compound.h5" int -main() +main(void) { hid_t file; hid_t cmpd_dt; diff --git a/test/gen_bad_offset.c b/test/gen_bad_offset.c index d07ff96..e9e3393 100644 --- a/test/gen_bad_offset.c +++ b/test/gen_bad_offset.c @@ -139,7 +139,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return EXIT_FAILURE; } /* end main() */ diff --git a/test/gen_bad_ohdr.c b/test/gen_bad_ohdr.c index 4dd64a3..d2a9d09 100644 --- a/test/gen_bad_ohdr.c +++ b/test/gen_bad_ohdr.c @@ -107,7 +107,7 @@ error: H5Pclose(gcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY #else /* H5O_ENABLE_BAD_MESG_COUNT */ HDputs("H5O_BAD_MESG_COUNT compiler macro not defined!"); #endif /* H5O_ENABLE_BAD_MESG_COUNT */ diff --git a/test/gen_bogus.c b/test/gen_bogus.c index ef544ca..adccc5c 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -130,7 +130,7 @@ error: H5Sclose(sid); H5Pclose(dcpl); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* generate_datasets() */ @@ -174,7 +174,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY #else /* H5O_ENABLE_BOGUS */ HDputs("H5O_ENABLE_BOGUS compiler macro not defined!"); #endif /* H5O_ENABLE_BOGUS */ diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 57b8026..1198694 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -236,7 +236,7 @@ error: H5Fclose(fid); free(buf); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* gen_earliest_latest */ @@ -351,7 +351,7 @@ error: H5Fclose(fid); free(buf); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* gen_earliest_v18 */ @@ -461,7 +461,7 @@ error: H5Fclose(fid); free(buf); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* gen_latest_latest */ @@ -577,7 +577,7 @@ error: H5Fclose(fid); free(buf); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* gen_v18_latest */ @@ -739,7 +739,7 @@ error: H5Fclose(fid); free(buf); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* gen_v18_v18 */ @@ -952,7 +952,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -1203,7 +1203,7 @@ error: H5Fclose(fid); free(dwbuf); } - H5E_END_TRY; + H5E_END_TRY return FAIL; diff --git a/test/gen_cross.c b/test/gen_cross.c index 0327aca..1bcfd64 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -170,7 +170,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -255,7 +255,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -340,7 +340,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -433,7 +433,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -526,7 +526,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -619,7 +619,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -713,7 +713,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -798,7 +798,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -891,7 +891,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -979,7 +979,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1065,7 +1065,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1171,7 +1171,7 @@ error: H5Pclose(dcpl); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } diff --git a/test/gen_deflate.c b/test/gen_deflate.c index 1081052..9c3d20f 100644 --- a/test/gen_deflate.c +++ b/test/gen_deflate.c @@ -105,7 +105,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return EXIT_FAILURE; } /* end main() */ diff --git a/test/gen_file_image.c b/test/gen_file_image.c index 8c7c46a..bb86ecc 100644 --- a/test/gen_file_image.c +++ b/test/gen_file_image.c @@ -81,7 +81,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return EXIT_FAILURE; } /* end main() */ diff --git a/test/gen_filespace.c b/test/gen_filespace.c index b9baa82..69c1c1e 100644 --- a/test/gen_filespace.c +++ b/test/gen_filespace.c @@ -114,6 +114,6 @@ error: H5Pclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } diff --git a/test/gen_filters.c b/test/gen_filters.c index 64e8774..2bb458c 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -98,7 +98,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_filters_endianess() */ @@ -208,7 +208,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } diff --git a/test/gen_mergemsg.c b/test/gen_mergemsg.c index 7f0315e..ed3c180 100644 --- a/test/gen_mergemsg.c +++ b/test/gen_mergemsg.c @@ -33,7 +33,7 @@ #define ATTR3_LEN 1 int -main() +main(void) { hid_t fid; /* File ID */ hid_t gid, gid2, gid3; /* Group IDs */ @@ -78,7 +78,7 @@ main() sid = H5Screate(H5S_SCALAR); assert(sid > 0); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); assert(tid > 0); ret = H5Tset_size(tid, ATTR1_LEN); @@ -104,7 +104,7 @@ main() sid = H5Screate(H5S_SCALAR); assert(sid > 0); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); assert(tid > 0); ret = H5Tset_size(tid, ATTR2_LEN); @@ -174,7 +174,7 @@ main() sid = H5Screate(H5S_SCALAR); assert(sid > 0); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); assert(tid > 0); ret = H5Tset_size(tid, ATTR3_LEN); @@ -220,7 +220,7 @@ main() sid = H5Screate(H5S_SCALAR); assert(sid > 0); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); assert(tid > 0); ret = H5Tset_size(tid, ATTR2_LEN); @@ -282,7 +282,7 @@ main() sid = H5Screate(H5S_SCALAR); assert(sid > 0); - /* Create dataype for attribute */ + /* Create datatype for attribute */ tid = H5Tcopy(H5T_C_S1); assert(tid > 0); ret = H5Tset_size(tid, ATTR2_LEN); diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c index cb42d50..955c375 100644 --- a/test/gen_new_fill.c +++ b/test/gen_new_fill.c @@ -95,6 +95,6 @@ error: H5Dclose(dset2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } diff --git a/test/gen_new_group.c b/test/gen_new_group.c index 253b5cc..31c44cc 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -114,6 +114,6 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } diff --git a/test/gen_old_group.c b/test/gen_old_group.c index 65f938c..3ed8a1f 100644 --- a/test/gen_old_group.c +++ b/test/gen_old_group.c @@ -55,6 +55,6 @@ error: H5Dclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } diff --git a/test/genall5.c b/test/genall5.c index 51e9606..005e944 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -1044,7 +1044,7 @@ os_grp_0(hid_t fid, const char *group_name) { hid_t gid = -1; hid_t fapl = -1; - H5F_libver_t low, high; + H5F_libver_t low = H5F_LIBVER_ERROR, high = H5F_LIBVER_ERROR; herr_t ret; @@ -1244,7 +1244,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) hid_t gid = -1; unsigned u; hid_t fapl = -1; - H5F_libver_t low, high; + H5F_libver_t low = H5F_LIBVER_ERROR, high = H5F_LIBVER_ERROR; herr_t ret; if (pass) { /* get the file's file access property list */ diff --git a/test/getname.c b/test/getname.c index 884f213..12f85d0 100644 --- a/test/getname.c +++ b/test/getname.c @@ -32,7 +32,7 @@ typedef struct s1_t { float c; } s1_t; -const char *FILENAME[] = {"getname", "getname1", "getname2", "getname3", NULL}; +static const char *FILENAME[] = {"getname", "getname1", "getname2", "getname3", NULL}; #define NAME_BUF_SIZE 64 #define SMALL_NAME_BUF_SIZE 2 @@ -1528,7 +1528,7 @@ test_main(hid_t file_id, hid_t fapl) if (H5Iget_name(type_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Get name for dataspace, it should fail */ H5E_BEGIN_TRY @@ -1536,7 +1536,7 @@ test_main(hid_t file_id, hid_t fapl) if (H5Iget_name(space_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY } /* Close */ @@ -3077,7 +3077,7 @@ test_main(hid_t file_id, hid_t fapl) if ((size = H5Iget_name(dtype, NULL, 0)) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY if (H5Tcommit_anon(file2_id, dtype, H5P_DEFAULT, H5P_DEFAULT)) TEST_ERROR; @@ -3799,7 +3799,7 @@ error: { H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY HDputs("***** GET NAME TESTS FAILED *****"); diff --git a/test/gheap.c b/test/gheap.c index 6b02c98..714ba27 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -34,17 +34,17 @@ #define GHEAP_TEST_NOBJS 1024 #define GHEAP_REPEATED_ERR(MSG) \ - { \ + do { \ nerrors++; \ if (nerrors <= GHEAP_REPEATED_ERR_LIM) { \ H5_FAILED(); \ HDputs(MSG); \ if (nerrors == GHEAP_REPEATED_ERR_LIM) \ HDputs(" Suppressing further errors..."); \ - } /* end if */ \ - } /* end GHEAP_REPEATED_ERR */ + } /* end if */ \ + } while (0) /* end GHEAP_REPEATED_ERR */ -const char *FILENAME[] = {"gheap1", "gheap2", "gheap3", "gheap4", "gheapooo", NULL}; +static const char *FILENAME[] = {"gheap1", "gheap2", "gheap3", "gheap4", "gheapooo", NULL}; /*------------------------------------------------------------------------- * Function: test_1 @@ -146,7 +146,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (obj) free(obj); return MAX(1, nerrors); @@ -243,7 +243,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (obj) free(obj); return MAX(1, nerrors); @@ -330,7 +330,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (obj) free(obj); return MAX(1, nerrors); @@ -423,7 +423,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (obj) free(obj); return MAX(1, nerrors); @@ -481,7 +481,7 @@ test_ooo_indices(hid_t fapl) H5Eclear2(H5E_DEFAULT); status = H5HG_insert(f, sizeof(j), &j, &obj[j]); if (status < 0) - GHEAP_REPEATED_ERR(" Unable to insert object into global heap") + GHEAP_REPEATED_ERR(" Unable to insert object into global heap"); /* Check that the index is as expected */ if (obj[j].idx != ((1000 * i) + j - (1000 * ((~i & 1)))) % ((1U << 16) - 1) + 1) @@ -539,7 +539,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (obj) free(obj); return MAX(1, nerrors); @@ -597,7 +597,7 @@ error: { H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/h5test.c b/test/h5test.c index 6fcbffc..0628643 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -189,7 +189,7 @@ h5_delete_test_file(const char *base_name, hid_t fapl) { H5Fdelete(filename, fapl); } - H5E_END_TRY; + H5E_END_TRY } /* end h5_delete_test_file() */ @@ -292,15 +292,11 @@ h5_restore_err(void) } /*------------------------------------------------------------------------- - * Function: h5_reset + * Function: h5_reset * - * Purpose: Reset the library by closing it. - * - * Return: void - * - * Programmer: Robb Matzke - * Friday, November 20, 1998 + * Purpose: Reset the library by closing it * + * Return: void *------------------------------------------------------------------------- */ void @@ -314,36 +310,6 @@ h5_reset(void) assert(err_func == NULL); H5Eget_auto2(H5E_DEFAULT, &err_func, NULL); H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL); - -/* - * I commented this chunk of code out because it's not clear what diagnostics - * were being output and under what circumstances, and creating this file - * is throwing off debugging some of the tests. I can't see any _direct_ - * harm in keeping this section of code, but I can't see any _direct_ - * benefit right now either. If we figure out under which circumstances - * diagnostics are being output, we should enable this behavior based on - * appropriate configure flags/macros. QAK - 2007/12/20 - */ -#ifdef OLD_WAY - { - char filename[1024]; - - /* - * Cause the library to emit some diagnostics early so they don't - * interfere with other formatted output. - */ - HDsnprintf(filename, sizeof(filename), "/tmp/h5emit-%05d.h5", HDgetpid()); - H5E_BEGIN_TRY - { - hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - hid_t grp = H5Gcreate2(file, "emit", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(grp); - H5Fclose(file); - HDunlink(filename); - } - H5E_END_TRY; - } -#endif /* OLD_WAY */ } /*------------------------------------------------------------------------- @@ -932,7 +898,7 @@ h5_show_hostname(void) #endif #ifdef H5_HAVE_GETHOSTNAME - if (HDgethostname(hostname, (size_t)80) < 0) + if (gethostname(hostname, (size_t)80) < 0) printf(" gethostname failed\n"); else printf(" hostname=%s\n", hostname); @@ -1515,7 +1481,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1563,7 +1529,7 @@ h5_send_message(const char *send, const char *arg1, const char *arg2) assert(arg2 == NULL); } /* end else */ - HDfclose(signalfile); + fclose(signalfile); HDrename(TMP_SIGNAL_FILE, send); } /* h5_send_message() */ @@ -1618,7 +1584,7 @@ h5_wait_message(const char *waitfor) } /* end if */ } /* end while */ - HDfclose(returnfile); + fclose(returnfile); HDunlink(waitfor); return SUCCEED; @@ -1883,11 +1849,11 @@ h5_compare_file_bytes(char *f1name, char *f2name) HDrewind(f1ptr); HDrewind(f2ptr); for (ii = 0; ii < f1size; ii++) { - if (HDfread(&f1char, 1, 1, f1ptr) != 1) { + if (fread(&f1char, 1, 1, f1ptr) != 1) { ret_value = -1; goto done; } - if (HDfread(&f2char, 1, 1, f2ptr) != 1) { + if (fread(&f2char, 1, 1, f2ptr) != 1) { ret_value = -1; goto done; } @@ -1900,9 +1866,9 @@ h5_compare_file_bytes(char *f1name, char *f2name) done: if (f1ptr) - HDfclose(f1ptr); + fclose(f1ptr); if (f2ptr) - HDfclose(f2ptr); + fclose(f2ptr); return ret_value; } /* end h5_compare_file_bytes() */ @@ -2013,20 +1979,20 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) } while (read_size > 0) { - if (HDfread(dup_buf, read_size, 1, orig_ptr) != 1) { + if (fread(dup_buf, read_size, 1, orig_ptr) != 1) { ret_value = -1; goto done; } - HDfwrite(dup_buf, read_size, 1, dest_ptr); + fwrite(dup_buf, read_size, 1, dest_ptr); fsize -= read_size; read_size = MIN(fsize, max_buf); } done: if (orig_ptr != NULL) - HDfclose(orig_ptr); + fclose(orig_ptr); if (dest_ptr != NULL) - HDfclose(dest_ptr); + fclose(dest_ptr); if (dup_buf != NULL) free(dup_buf); return ret_value; diff --git a/test/h5test.h b/test/h5test.h index 1a94c09..27d90af 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -87,7 +87,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ */ #define AT() \ do { \ - HDprintf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \ + printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \ } while (0) /* @@ -101,37 +101,37 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ */ #define TESTING(WHAT) \ do { \ - HDprintf("Testing %-62s", WHAT); \ - HDfflush(stdout); \ + printf("Testing %-62s", WHAT); \ + fflush(stdout); \ n_tests_run_g++; \ } while (0) #define TESTING_2(WHAT) \ do { \ - HDprintf(" Testing %-60s", WHAT); \ - HDfflush(stdout); \ + printf(" Testing %-60s", WHAT); \ + fflush(stdout); \ n_tests_run_g++; \ } while (0) #define PASSED() \ do { \ HDputs(" PASSED"); \ - HDfflush(stdout); \ + fflush(stdout); \ n_tests_passed_g++; \ } while (0) #define H5_FAILED() \ do { \ HDputs("*FAILED*"); \ - HDfflush(stdout); \ + fflush(stdout); \ n_tests_failed_g++; \ } while (0) #define H5_WARNING() \ do { \ HDputs("*WARNING*"); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) #define SKIPPED() \ do { \ HDputs(" -SKIP-"); \ - HDfflush(stdout); \ + fflush(stdout); \ n_tests_skipped_g++; \ } while (0) #define PUTS_ERROR(s) \ @@ -171,9 +171,9 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ */ #define TESTING_MULTIPART(WHAT) \ do { \ - HDprintf("Testing %-62s", WHAT); \ + printf("Testing %-62s", WHAT); \ HDputs(""); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) /* @@ -263,7 +263,7 @@ extern "C" { * an equivalent non-const pointer around) is far messier. */ #ifndef h5_free_const -#define h5_free_const(mem) HDfree((void *)(uintptr_t)mem) +#define h5_free_const(mem) free((void *)(uintptr_t)mem) #endif /* Generally useful testing routines */ diff --git a/test/hdfs.c b/test/hdfs.c index 5e0caf9..3c4add5 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -510,7 +510,7 @@ test_fapl_config_validation(void) */ success = H5Pset_fapl_hdfs(fapl_id, &case_ptr->config); } - H5E_END_TRY; + H5E_END_TRY JSVERIFY(case_ptr->expected, success, case_ptr->msg) @@ -552,7 +552,7 @@ error: { (void)H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY } return 1; #endif /* H5_HAVE_LIBHDFS */ @@ -633,7 +633,7 @@ error: { (void)H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; #endif /* H5_HAVE_LIBHDFS */ @@ -818,7 +818,7 @@ test_vfd_open(void) { fd = H5FDopen(T.url, T.flags, fapl_id, T.maxaddr); } - H5E_END_TRY; + H5E_END_TRY if (NULL != fd) { if (TRUE == T.might_use_other_driver && H5FD_HDFS != fd->driver_id) { fprintf(stderr, "\n!!!!! WARNING !!!!!\n" @@ -882,7 +882,7 @@ error: (void)H5Pclose(fapl_unconfigured); } } - H5E_END_TRY; + H5E_END_TRY return 1; @@ -999,7 +999,7 @@ error: { (void)H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY } return 1; @@ -1062,19 +1062,17 @@ test_H5FDread_without_eoa_set_fails(void) * TEST * ********/ - H5E_BEGIN_TRY{/* mute stack trace on expected failure */ - JSVERIFY(FAIL, H5FDread(file_shakespeare, H5FD_MEM_DRAW, H5P_DEFAULT, 1200699, 102, buffer), - "cannot read before eoa is set")} H5E_END_TRY; - for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++) { - JSVERIFY(0, (unsigned)buffer[i], "buffer was modified by write!") - } + H5E_BEGIN_TRY{ + /* mute stack trace on expected failure */ + JSVERIFY(FAIL, H5FDread(file_shakespeare, H5FD_MEM_DRAW, H5P_DEFAULT, 1200699, 102, buffer), + "cannot read before eoa is set")} H5E_END_TRY for (i = 0; i < HDFS_TEST_MAX_BUF_SIZE; i++){ + JSVERIFY(0, (unsigned)buffer[i], "buffer was modified by write!")} /************ * TEARDOWN * ************/ - FAIL_IF(FAIL == H5FDclose(file_shakespeare)) - file_shakespeare = NULL; + FAIL_IF(FAIL == H5FDclose(file_shakespeare)) file_shakespeare = NULL; FAIL_IF(FAIL == H5Pclose(fapl_id)) fapl_id = -1; @@ -1096,7 +1094,7 @@ error: { (void)H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY } return 1; @@ -1263,7 +1261,7 @@ test_read(void) { open_return = H5FDread(file_raven, H5FD_MEM_DRAW, H5P_DEFAULT, test.addr, test.len, buffer); } - H5E_END_TRY; + H5E_END_TRY JSVERIFY(test.success, open_return, test.message) @@ -1300,7 +1298,7 @@ error: { (void)H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY } return 1; @@ -1377,19 +1375,19 @@ test_noops_and_autofails(void) /* auto-fail calls to write and truncate */ H5E_BEGIN_TRY{JSVERIFY(FAIL, H5FDwrite(file, H5FD_MEM_DRAW, H5P_DEFAULT, 1000, 35, data), - "write must fail")} H5E_END_TRY; + "write must fail")} H5E_END_TRY - H5E_BEGIN_TRY{JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, FALSE), "truncate must fail")} H5E_END_TRY; + H5E_BEGIN_TRY{ + JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, FALSE), "truncate must fail")} H5E_END_TRY - H5E_BEGIN_TRY{ - JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, TRUE), "truncate must fail (closing)")} H5E_END_TRY; + H5E_BEGIN_TRY{JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, TRUE), + "truncate must fail (closing)")} H5E_END_TRY - /************ - * TEARDOWN * - ************/ + /************ + * TEARDOWN * + ************/ - FAIL_IF(FAIL == H5FDclose(file)) - file = NULL; + FAIL_IF(FAIL == H5FDclose(file)) file = NULL; FAIL_IF(FAIL == H5Pclose(fapl_id)) fapl_id = -1; @@ -1408,7 +1406,7 @@ error: { (void)H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY } if (file != NULL) { (void)H5FDclose(file); @@ -1504,16 +1502,16 @@ test_H5F_integration(void) /* Read-Write Open access is not allowed with this file driver. */ - H5E_BEGIN_TRY{FAIL_IF(0 <= H5Fopen(filename_example_h5, H5F_ACC_RDWR, fapl_id))} H5E_END_TRY; + H5E_BEGIN_TRY{FAIL_IF(0 <= H5Fopen(filename_example_h5, H5F_ACC_RDWR, fapl_id))} H5E_END_TRY - /* H5Fcreate() is not allowed with this file driver. - */ - H5E_BEGIN_TRY{ - FAIL_IF(0 <= H5Fcreate(filename_missing, H5F_ACC_RDONLY, H5P_DEFAULT, fapl_id))} H5E_END_TRY; + /* H5Fcreate() is not allowed with this file driver. + */ + H5E_BEGIN_TRY{ + FAIL_IF(0 <= H5Fcreate(filename_missing, H5F_ACC_RDONLY, H5P_DEFAULT, fapl_id))} H5E_END_TRY - /* Successful open. - */ - file = H5Fopen(filename_example_h5, H5F_ACC_RDONLY, fapl_id); + /* Successful open. + */ + file = H5Fopen(filename_example_h5, H5F_ACC_RDONLY, fapl_id); FAIL_IF(file < 0) /************ @@ -1544,7 +1542,7 @@ error: { (void)H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY } if (file > 0) { (void)H5Fclose(file); diff --git a/test/hyperslab.c b/test/hyperslab.c index ae94286..e2ca4f1 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -111,7 +111,7 @@ print_ref(size_t nx, size_t ny, size_t nz) init_full(array, nx, ny, nz); print_array(array, nx, ny, nz); free(array); - } /* end if */ + } } /* end print_ref() */ /*------------------------------------------------------------------------- diff --git a/test/istore.c b/test/istore.c index 7bc0696..8dcc205 100644 --- a/test/istore.c +++ b/test/istore.c @@ -26,7 +26,7 @@ #include "H5Oprivate.h" #include "H5VMprivate.h" -const char *FILENAME[] = {"istore", NULL}; +static const char *FILENAME[] = {"istore", NULL}; #define TEST_SMALL 0x0001 #define TEST_MEDIUM 0x0002 diff --git a/test/lheap.c b/test/lheap.c index 81e8da9..5f99c43 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -21,7 +21,7 @@ #include "H5Iprivate.h" #include "H5VLprivate.h" /* Virtual Object Layer */ -const char *FILENAME[] = {"lheap", NULL}; +static const char *FILENAME[] = {"lheap", NULL}; #define TESTFILE "tsizeslheap.h5" @@ -215,7 +215,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/links.c b/test/links.c index 154ae30..1c46fb7 100644 --- a/test/links.c +++ b/test/links.c @@ -46,61 +46,61 @@ #define SYMLINK1 TMPDIR "sym1.h5" #define SYMLINK2 TMPDIR2 "sym2.h5" -const char *FILENAME[] = {"links0", - "links1", - "links2", - "links3", - "links4a", /* 4 */ - "links4b", /* 5 */ - "links4c", /* 6 */ - "links4d", /* 7 */ - "links5", /* 8 */ - "links6", /* 9 */ - "links7", /* 10 */ - "links8", /* 11 */ - "extlinks0", /* 12: main files */ - TMPDIR "extlinks0", /* 13: */ - "extlinks1", /* 14: target files */ - TMPDIR "extlinks1", /* 15: */ - "extlinks2", /* 16: */ - TMPDIR "extlinks2", /* 17: */ - "extlinks3", /* 18: */ - TMPDIR "extlinks3", /* 19: */ - "extlinks4", /* 20: */ - TMPDIR "extlinks4", /* 21: */ - "extlinks5", /* 22: */ - TMPDIR "extlinks6", /* 23: */ - "extlinks7", /* 24: */ - TMPDIR "extlinks7", /* 25: */ - TMPDIR "extlinks8", /* 26: */ - "extlinks9", /* 27: */ - TMPDIR "extlinks9", /* 28: */ - "extlinks10", - /* 29: */ /* TESTS for windows */ - TMPDIR "extlinks10", /* 30: */ - TMPDIR "extlinks11", /* 31: */ - TMPDIR "extlinks12", /* 32: */ - "extlinks13", /* 33: */ - TMPDIR "extlinks13", /* 34: */ - TMPDIR "extlinks14", /* 35: */ - TMPDIR "extlinks15", /* 36: */ - "extlinks16A", - /* 37: */ /* TESTS for H5P_set_elink_fapl */ - "extlinks16B", /* 38: */ - "extlinks17", /* 39: */ - "extlinks18A", /* 40: */ - "extlinks18B", /* 41: */ - "extlinks19A", /* 42: */ - "extlinks19B", /* 43: */ - "extlinks20", /* 44: */ - "extlinks21A", /* 45: Files for symlink() tests*/ - TMPDIR2 "extlinks21B", /* 46: */ - TMPDIR2 "extlinks21C", /* 47: */ - "extlinks21C", /* 48: (same as #47, only without the TMPDIR2 prefix) */ - TMPDIR "extlinks21D", /* 49: */ - TMPDIR "extlinks21E", /* 50: */ - "extlinks21E", /* 51: (same as #50, only without the TMPDIR prefix) */ - NULL}; +static const char *FILENAME[] = {"links0", + "links1", + "links2", + "links3", + "links4a", /* 4 */ + "links4b", /* 5 */ + "links4c", /* 6 */ + "links4d", /* 7 */ + "links5", /* 8 */ + "links6", /* 9 */ + "links7", /* 10 */ + "links8", /* 11 */ + "extlinks0", /* 12: main files */ + TMPDIR "extlinks0", /* 13: */ + "extlinks1", /* 14: target files */ + TMPDIR "extlinks1", /* 15: */ + "extlinks2", /* 16: */ + TMPDIR "extlinks2", /* 17: */ + "extlinks3", /* 18: */ + TMPDIR "extlinks3", /* 19: */ + "extlinks4", /* 20: */ + TMPDIR "extlinks4", /* 21: */ + "extlinks5", /* 22: */ + TMPDIR "extlinks6", /* 23: */ + "extlinks7", /* 24: */ + TMPDIR "extlinks7", /* 25: */ + TMPDIR "extlinks8", /* 26: */ + "extlinks9", /* 27: */ + TMPDIR "extlinks9", /* 28: */ + "extlinks10", + /* 29: */ /* TESTS for windows */ + TMPDIR "extlinks10", /* 30: */ + TMPDIR "extlinks11", /* 31: */ + TMPDIR "extlinks12", /* 32: */ + "extlinks13", /* 33: */ + TMPDIR "extlinks13", /* 34: */ + TMPDIR "extlinks14", /* 35: */ + TMPDIR "extlinks15", /* 36: */ + "extlinks16A", + /* 37: */ /* TESTS for H5P_set_elink_fapl */ + "extlinks16B", /* 38: */ + "extlinks17", /* 39: */ + "extlinks18A", /* 40: */ + "extlinks18B", /* 41: */ + "extlinks19A", /* 42: */ + "extlinks19B", /* 43: */ + "extlinks20", /* 44: */ + "extlinks21A", /* 45: Files for symlink() tests*/ + TMPDIR2 "extlinks21B", /* 46: */ + TMPDIR2 "extlinks21C", /* 47: */ + "extlinks21C", /* 48: (same as #47, only without the TMPDIR2 prefix) */ + TMPDIR "extlinks21D", /* 49: */ + TMPDIR "extlinks21E", /* 50: */ + "extlinks21E", /* 51: (same as #50, only without the TMPDIR prefix) */ + NULL}; #define FAMILY_SIZE 1024 #define CORE_INCREMENT 1024 @@ -535,13 +535,13 @@ new_links(hid_t fapl, hbool_t new_format) if (H5Lcreate_hard(H5L_SAME_LOC, "dataset1", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) != FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY H5E_BEGIN_TRY { if (H5Lcreate_soft("dataset1", H5L_SAME_LOC, "soft", H5P_DEFAULT, H5P_DEFAULT) != FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Create links across files with hard link. Should fail. */ H5E_BEGIN_TRY @@ -549,7 +549,7 @@ new_links(hid_t fapl, hbool_t new_format) if (H5Lcreate_hard(file_a, "dataset1", file_b, "hard", H5P_DEFAULT, H5P_DEFAULT) != FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Create hard link to test H5L_SAME_LOC */ if (H5Lcreate_hard(grp1_a, "dataset2", H5L_SAME_LOC, "hard1", H5P_DEFAULT, H5P_DEFAULT) < 0) @@ -595,7 +595,7 @@ error: H5Fclose(file_a); H5Fclose(file_b); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -667,7 +667,7 @@ cklinks(hid_t fapl, hbool_t new_format) { status = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" H5Lexists() should have failed for a path with missing components."); @@ -677,7 +677,7 @@ cklinks(hid_t fapl, hbool_t new_format) { status = H5Lexists(file, "/no_grp1/hard", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" H5Lexists() should have failed for a path with missing components."); @@ -715,7 +715,7 @@ cklinks(hid_t fapl, hbool_t new_format) { status = H5Oget_info_by_name3(file, "grp1/dangle", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" H5Oget_info_by_name() should have failed for a dangling link."); @@ -746,7 +746,7 @@ cklinks(hid_t fapl, hbool_t new_format) { status = H5Oget_info_by_name3(file, "grp1/recursive", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" H5Oget_info_by_name() should have failed for a recursive link."); @@ -924,7 +924,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY free(objname); return FAIL; } @@ -1083,7 +1083,7 @@ toomany(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "soft17", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gid >= 0) { H5_FAILED(); HDputs(" Should have failed for sequence of too many nested links."); @@ -1124,7 +1124,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end toomany() */ @@ -1337,7 +1337,7 @@ error: H5Sclose(space_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_lcpl() */ @@ -1394,7 +1394,7 @@ test_move(hid_t fapl, hbool_t new_format) FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Move a group across files. Should fail. */ H5E_BEGIN_TRY @@ -1402,7 +1402,7 @@ test_move(hid_t fapl, hbool_t new_format) if (H5Lmove(grp_1, "group_move", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) != FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Move a soft link across files. Should succeed. */ if (H5Lmove(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) @@ -1431,7 +1431,7 @@ test_move(hid_t fapl, hbool_t new_format) { moved_grp = H5Gopen2(grp_1, "group_move", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (moved_grp >= 0) { H5_FAILED(); HDputs(" Group still in original location?"); @@ -1482,7 +1482,7 @@ test_move(hid_t fapl, hbool_t new_format) if ((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR; } - H5E_END_TRY; + H5E_END_TRY H5Gclose(grp_1); H5Gclose(grp_2); @@ -1504,7 +1504,7 @@ error: H5Fclose(file_a); H5Fclose(file_b); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -1561,7 +1561,7 @@ test_copy(hid_t fapl, hbool_t new_format) FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Copy a group across files. Should fail. */ H5E_BEGIN_TRY @@ -1569,7 +1569,7 @@ test_copy(hid_t fapl, hbool_t new_format) if (H5Lcopy(grp_1, "group_copy", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) != FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Copy a soft link across files. Should succeed. */ if (H5Lcopy(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) @@ -1678,7 +1678,7 @@ error: H5Fclose(file_a); H5Fclose(file_b); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -1918,7 +1918,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_move_preserves() */ @@ -1989,7 +1989,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_objname_by_idx(group1_id, (hsize_t)1, tmpstr, sizeof(tmpstr)) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Test getting the type for objects */ if ((obj_type = H5Gget_objtype_by_idx(group1_id, (hsize_t)0)) < 0) @@ -2001,7 +2001,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_objtype_by_idx(group1_id, (hsize_t)1) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Test getting the number of objects in a group */ if (H5Gget_num_objs(file_id, &num_objs) < 0) @@ -2058,7 +2058,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_objinfo(file_id, "/group2/soft_link_no_exist", TRUE, NULL) >= 0) FAIL_STACK_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Test the dangling soft link */ if (H5Gget_objinfo(file_id, "/group2/dangle_soft_link", FALSE, &sb_soft2) < 0) @@ -2105,7 +2105,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gopen2(file_id, "moved_group1/moved_group2", H5P_DEFAULT) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY if (H5Fclose(file_id) < 0) FAIL_STACK_ERROR; @@ -2120,7 +2120,7 @@ error: H5Gclose(group1_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_deprec() */ @@ -2185,7 +2185,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) { exists = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (exists >= 0) { H5_FAILED(); HDputs(" H5Lexists() should have failed for a path with missing components."); @@ -2195,7 +2195,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) { exists = H5Lexists(file, "/no_grp1/hard", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (exists >= 0) { H5_FAILED(); HDputs(" H5Lexists() should have failed for a path with missing components."); @@ -2231,7 +2231,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) { status = H5Oget_info_by_name2(file, "grp1/dangle", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" H5Oget_info_by_name() should have failed for a dangling link."); @@ -2262,7 +2262,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) { status = H5Oget_info_by_name2(file, "grp1/recursive", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" H5Oget_info_by_name() should have failed for a recursive link."); @@ -2510,7 +2510,7 @@ error: H5Sclose(space_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_lcpl_deprec() */ @@ -2751,7 +2751,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_move_preserves_deprec() */ @@ -2969,7 +2969,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_root_deprec() */ @@ -3123,7 +3123,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_query_deprec() */ @@ -3438,7 +3438,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* external_link_closing_deprec() */ @@ -3761,7 +3761,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end ud_hard_links_deprec() */ @@ -3945,7 +3945,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end ud_link_reregister_deprec() */ @@ -4112,7 +4112,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end ud_callbacks_deprec() */ @@ -4258,7 +4258,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format) { gid = H5Oopen(fid, "soft5", plist); } - H5E_END_TRY; + H5E_END_TRY if (gid >= 0) { H5_FAILED(); HDputs(" Should have failed for sequence of too many nested links."); @@ -4420,7 +4420,7 @@ error: H5Pclose(plist); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end lapl_nlinks_deprec() */ @@ -4532,7 +4532,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end linkinfo_deprec() */ @@ -4674,7 +4674,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end corder_create_compact_deprec() */ @@ -4837,7 +4837,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end corder_create_dense_deprec() */ @@ -5126,7 +5126,7 @@ link_info_by_idx_deprec(hid_t fapl) ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -5134,7 +5134,7 @@ link_info_by_idx_deprec(hid_t fapl) name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (name_len >= 0) TEST_ERROR; @@ -5178,7 +5178,7 @@ link_info_by_idx_deprec(hid_t fapl) ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -5186,7 +5186,7 @@ link_info_by_idx_deprec(hid_t fapl) ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -5194,7 +5194,7 @@ link_info_by_idx_deprec(hid_t fapl) name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (name_len >= 0) TEST_ERROR; @@ -5238,7 +5238,7 @@ link_info_by_idx_deprec(hid_t fapl) ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -5246,7 +5246,7 @@ link_info_by_idx_deprec(hid_t fapl) ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -5254,7 +5254,7 @@ link_info_by_idx_deprec(hid_t fapl) name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (name_len >= 0) TEST_ERROR; @@ -5283,7 +5283,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end link_info_by_idx_deprec() */ @@ -5454,7 +5454,7 @@ link_info_by_idx_old_deprec(hid_t fapl) ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -5462,7 +5462,7 @@ link_info_by_idx_old_deprec(hid_t fapl) name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (name_len >= 0) TEST_ERROR; @@ -5489,7 +5489,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end link_info_by_idx_old_deprec() */ @@ -5596,7 +5596,7 @@ delete_by_idx_deprec(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -5605,7 +5605,7 @@ delete_by_idx_deprec(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, "None", idx_type, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -5637,7 +5637,7 @@ delete_by_idx_deprec(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -5711,7 +5711,7 @@ delete_by_idx_deprec(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -5763,7 +5763,7 @@ delete_by_idx_deprec(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -5897,7 +5897,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end delete_by_idx_deprec() */ @@ -5951,7 +5951,7 @@ delete_by_idx_old_deprec(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -5981,7 +5981,7 @@ delete_by_idx_old_deprec(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -5990,7 +5990,7 @@ delete_by_idx_old_deprec(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -6037,7 +6037,7 @@ delete_by_idx_old_deprec(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -6163,7 +6163,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end delete_by_idx_old_deprec() */ @@ -6427,7 +6427,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o { ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_fail_deprec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -6590,7 +6590,7 @@ link_iterate_deprec(hid_t fapl) { ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -6623,7 +6623,7 @@ link_iterate_deprec(hid_t fapl) { ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -6662,7 +6662,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY if (visited) free(visited); @@ -6907,7 +6907,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma { ret = H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_fail_deprec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -6917,7 +6917,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma { ret = H5Literate1((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_deprec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -6925,7 +6925,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma { ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_deprec_cb, iter_info); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -7020,7 +7020,7 @@ link_iterate_old_deprec(hid_t fapl) { ret = H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_deprec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -7031,7 +7031,7 @@ link_iterate_old_deprec(hid_t fapl) { ret = H5Literate1(group_id, H5_INDEX_CRT_ORDER, order, &skip, link_iterate_old_deprec_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -7063,7 +7063,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY if (visited) free(visited); @@ -7286,7 +7286,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_root() */ @@ -7408,7 +7408,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_path() */ @@ -7607,7 +7607,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_mult() */ @@ -7788,7 +7788,7 @@ error: H5Pclose(lcpl_id); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_self() */ @@ -7929,7 +7929,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_pingpong() */ @@ -8055,7 +8055,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "link1", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gid >= 0) { H5_FAILED(); printf("%d: Should have failed for sequence of too many nested links.", __LINE__); @@ -8098,7 +8098,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_toomany() */ @@ -8165,7 +8165,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "no_file", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gid >= 0) { H5_FAILED(); HDputs(" Should have failed for sequence of too many nested links."); @@ -8177,7 +8177,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "no_object", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gid >= 0) { H5_FAILED(); HDputs(" Should have failed for sequence of too many nested links."); @@ -8189,7 +8189,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) { status = H5Lget_name_by_idx(rid, "no_file", H5_INDEX_NAME, H5_ITER_INC, 0, NULL, 0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs( @@ -8213,7 +8213,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_dangling() */ @@ -8288,7 +8288,7 @@ external_link_prefix(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", gapl_id); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file from pathnames set via H5Pset_elink_prefix() */ if (gid < 0) { @@ -8312,7 +8312,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_prefix() */ @@ -8385,7 +8385,7 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file from absolute path set for main file */ if (gid < 0) { @@ -8409,7 +8409,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_abs_mainpath() */ @@ -8473,7 +8473,7 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file from the main file's relative pathname */ if (gid < 0) { @@ -8497,7 +8497,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_rel_mainpath() */ @@ -8566,7 +8566,7 @@ external_link_cwd(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file from the current working directory */ if (gid < 0) { @@ -8590,7 +8590,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_cwd() */ @@ -8664,7 +8664,7 @@ external_link_abstar(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file with absolute path */ if (gid < 0) { @@ -8688,7 +8688,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_abstar() */ @@ -8762,7 +8762,7 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file from main file's current working directory */ if (gid < 0) { @@ -8786,7 +8786,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_abstar_cur() */ @@ -8867,7 +8867,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_reltar() */ @@ -8937,7 +8937,7 @@ external_link_chdir(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (HDchdir("..") < 0) TEST_ERROR; @@ -8967,7 +8967,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_chdir() */ @@ -9181,7 +9181,7 @@ error: H5Oclose(oidB); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_set_elink_fapl1() */ @@ -9388,7 +9388,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY free(points); free(points_data); @@ -9515,7 +9515,7 @@ error: H5Pclose(core_fapl); H5Pclose(stdio_fapl); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_set_elink_fapl3() */ @@ -9572,7 +9572,7 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo { group = H5Gcreate2(file1, "/ext_link/group", H5P_DEFAULT, H5P_DEFAULT, gapl); } - H5E_END_TRY; + H5E_END_TRY if (group != FAIL) TEST_ERROR; @@ -9603,7 +9603,7 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo { subgroup = H5Gcreate2(file1, "/ext_link/group/subgroup", H5P_DEFAULT, H5P_DEFAULT, gapl); } - H5E_END_TRY; + H5E_END_TRY if (subgroup != FAIL) TEST_ERROR; @@ -9623,21 +9623,21 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_TRUNC); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) TEST_ERROR; H5E_BEGIN_TRY { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_EXCL); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) TEST_ERROR; H5E_BEGIN_TRY { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_CREAT); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) TEST_ERROR; /* SWMR reader with write access */ @@ -9645,7 +9645,7 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_RDWR | H5F_ACC_SWMR_READ); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) TEST_ERROR; /* SWMR writer with read-only access */ @@ -9653,7 +9653,7 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE); } - H5E_END_TRY; + H5E_END_TRY if (ret != FAIL) TEST_ERROR; @@ -9769,28 +9769,28 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo { file1 = H5Fcreate(filename1, H5F_ACC_DEFAULT, H5P_DEFAULT, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file1 != FAIL) TEST_ERROR; H5E_BEGIN_TRY { file1 = H5Fcreate(filename1, H5F_ACC_TRUNC | H5F_ACC_DEFAULT, H5P_DEFAULT, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file1 != FAIL) TEST_ERROR; H5E_BEGIN_TRY { file1 = H5Fopen(filename1, H5F_ACC_DEFAULT, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file1 != FAIL) TEST_ERROR; H5E_BEGIN_TRY { file1 = H5Fopen(filename1, H5F_ACC_RDWR | H5F_ACC_DEFAULT, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file1 != FAIL) TEST_ERROR; @@ -9810,7 +9810,7 @@ error: H5Fclose(file2); H5Pclose(gapl); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_set_elink_acc_flags() */ @@ -9975,7 +9975,7 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) { group = H5Gopen2(file1, "/group1/ext_link/group2", gapl); } - H5E_END_TRY; + H5E_END_TRY if (group != FAIL) TEST_ERROR; @@ -9987,7 +9987,7 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) { group = H5Gopen2(file1, "/group1/ext_link/group2", gapl); } - H5E_END_TRY; + H5E_END_TRY if (group != FAIL) TEST_ERROR; @@ -10010,7 +10010,7 @@ error: H5Pclose(ret_fapl); H5Pclose(fam_fapl); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_set_elink_cb() */ @@ -10068,7 +10068,7 @@ external_reset_register(void) { H5Fdelete(filename, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY PASSED(); return SUCCEED; @@ -10078,7 +10078,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_reset_register() */ @@ -10150,7 +10150,7 @@ external_link_win1(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file via main file's CWD*/ if (gid < 0) { @@ -10174,7 +10174,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_win1() */ @@ -10247,7 +10247,7 @@ external_link_win2(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file directly */ if (gid < 0) { @@ -10271,7 +10271,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_win2() */ @@ -10341,7 +10341,7 @@ external_link_win3(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file directly */ if (gid < 0) { @@ -10365,7 +10365,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_win3() */ @@ -10432,7 +10432,7 @@ external_link_win4(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file via main file's absolute drive/relative path */ if (gid < 0) { @@ -10456,7 +10456,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_win4() */ @@ -10533,7 +10533,7 @@ external_link_win5(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file via main file's rel drive/abs path */ if (gid < 0) { @@ -10557,7 +10557,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_win5() */ @@ -10631,7 +10631,7 @@ external_link_win6(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file via target file's rel path in current drive */ if (gid < 0) { @@ -10655,7 +10655,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_win6() */ @@ -10726,7 +10726,7 @@ external_link_win7(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file via main file's local host/main drive*/ if (gid < 0) { @@ -10750,7 +10750,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_win7() */ @@ -10826,7 +10826,7 @@ external_link_win8(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file directly */ if (gid < 0) { @@ -10850,7 +10850,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_win8() */ @@ -10921,7 +10921,7 @@ external_link_win9(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* should be able to find the target file via main file's local host/main drive*/ if (gid < 0) { @@ -10945,7 +10945,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_win9() */ @@ -10996,7 +10996,7 @@ external_link_recursive(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "recursive", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gid >= 0) { H5_FAILED(); HDputs(" Should have failed for recursive external links."); @@ -11016,7 +11016,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_recursive() */ @@ -11170,7 +11170,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_query() */ @@ -11263,7 +11263,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_unlink_compact() */ @@ -11440,7 +11440,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_unlink_dense() */ @@ -11674,7 +11674,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_move() */ @@ -11906,7 +11906,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_ride() */ @@ -12221,7 +12221,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* external_link_closing() */ @@ -12307,7 +12307,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -12412,7 +12412,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end external_link_strong() */ @@ -12513,7 +12513,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Create symbolic link #1 in temporary directory #1 to file #2 in temporary directory #2 */ /* (i.e. tmp_links/sym1.h5 -> /tmp2_links/extlinks21B.h5) */ - if (HDsymlink(filename2b, SYMLINK1) < 0 && errno != EEXIST) + if (symlink(filename2b, SYMLINK1) < 0 && errno != EEXIST) TEST_ERROR; /* set up name for file #3 in temporary directory #2: "tmp2_links/extlinks21C" */ @@ -12527,7 +12527,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Create symbolic link #2 in temporary directory #2 to file #4 in temporary directory #1 */ /* (i.e. tmp2_links/sym2.h5 -> /tmp_links/extlinks21D.h5) */ - if (HDsymlink(filename4b, SYMLINK2) < 0 && errno != EEXIST) + if (symlink(filename4b, SYMLINK2) < 0 && errno != EEXIST) TEST_ERROR; /* set up name for file #5 in temporary directory #1: "tmp_links/extlinks21E" */ @@ -12689,7 +12689,7 @@ error: H5Fclose(file2); H5Fclose(file1); } - H5E_END_TRY; + H5E_END_TRY free(filename1); free(filename2a); @@ -14141,7 +14141,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end ud_hard_links() */ @@ -14353,7 +14353,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end ud_link_reregister() */ @@ -14664,7 +14664,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end ud_callbacks() */ @@ -14819,7 +14819,7 @@ error: H5Gclose(gid2); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end lapl_udata() */ @@ -15091,7 +15091,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format) if (H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, NULL, 1, H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Create a user-defined link to the group. */ HDstrcpy(group_name, "/group"); @@ -15199,7 +15199,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end ud_link_errors() */ @@ -15345,7 +15345,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) { gid = H5Oopen(fid, "soft5", plist); } - H5E_END_TRY; + H5E_END_TRY if (gid >= 0) { H5_FAILED(); HDputs(" Should have failed for sequence of too many nested links."); @@ -15507,7 +15507,7 @@ error: H5Pclose(plist); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end lapl_nlinks() */ @@ -15619,7 +15619,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end linkinfo() */ @@ -15671,7 +15671,7 @@ error: { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end check_all_closed() */ @@ -15800,7 +15800,7 @@ error: { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end build_visit_file() */ @@ -15903,7 +15903,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end link_visit() */ @@ -15991,7 +15991,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end link_visit_by_name() */ @@ -16098,7 +16098,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end obj_visit() */ @@ -16195,7 +16195,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end obj_visit_by_name() */ @@ -16278,7 +16278,7 @@ error: { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end obj_visit_stop() */ @@ -16756,7 +16756,7 @@ error: H5Pclose(gcpl2); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end link_filters() */ @@ -17085,7 +17085,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end obj_exists() */ @@ -17130,7 +17130,7 @@ corder_create_empty(hid_t fapl) { ret = H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_INDEXED); } - H5E_END_TRY; + H5E_END_TRY if (ret > 0) { H5_FAILED(); HDputs( @@ -17214,7 +17214,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end corder_create_empty() */ @@ -17356,7 +17356,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end corder_create_compact() */ @@ -17519,7 +17519,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end corder_create_dense() */ @@ -17815,7 +17815,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end corder_transition() */ @@ -17966,7 +17966,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end corder_delete() */ @@ -18250,7 +18250,7 @@ link_info_by_idx(hid_t fapl) ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -18258,7 +18258,7 @@ link_info_by_idx(hid_t fapl) name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (name_len >= 0) TEST_ERROR; @@ -18302,7 +18302,7 @@ link_info_by_idx(hid_t fapl) ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -18310,7 +18310,7 @@ link_info_by_idx(hid_t fapl) ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -18318,7 +18318,7 @@ link_info_by_idx(hid_t fapl) name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (name_len >= 0) TEST_ERROR; @@ -18362,7 +18362,7 @@ link_info_by_idx(hid_t fapl) ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -18370,7 +18370,7 @@ link_info_by_idx(hid_t fapl) ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -18378,7 +18378,7 @@ link_info_by_idx(hid_t fapl) name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (name_len >= 0) TEST_ERROR; @@ -18407,7 +18407,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end link_info_by_idx() */ @@ -18596,7 +18596,7 @@ link_info_by_idx_old(hid_t fapl) ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY @@ -18604,7 +18604,7 @@ link_info_by_idx_old(hid_t fapl) name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (name_len >= 0) TEST_ERROR; @@ -18631,7 +18631,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end link_info_by_idx_old() */ @@ -18738,7 +18738,7 @@ delete_by_idx(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -18747,7 +18747,7 @@ delete_by_idx(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, "None", idx_type, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -18779,7 +18779,7 @@ delete_by_idx(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -18853,7 +18853,7 @@ delete_by_idx(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -18905,7 +18905,7 @@ delete_by_idx(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -19039,7 +19039,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end delete_by_idx() */ @@ -19102,7 +19102,7 @@ delete_by_idx_old(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -19133,7 +19133,7 @@ delete_by_idx_old(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -19142,7 +19142,7 @@ delete_by_idx_old(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -19193,7 +19193,7 @@ delete_by_idx_old(hid_t fapl) { ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -19328,7 +19328,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end delete_by_idx_old() */ @@ -19607,7 +19607,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u { ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_fail_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -19770,7 +19770,7 @@ link_iterate(hid_t fapl) { ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -19803,7 +19803,7 @@ link_iterate(hid_t fapl) { ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -19842,7 +19842,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY if (visited) free(visited); @@ -20101,7 +20101,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links { ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20111,7 +20111,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links { ret = H5Literate2((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20120,7 +20120,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links { ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_cb, iter_info); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -20213,7 +20213,7 @@ link_iterate_old(hid_t fapl) { ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20224,7 +20224,7 @@ link_iterate_old(hid_t fapl) { ret = H5Literate2(group_id, H5_INDEX_CRT_ORDER, order, &skip, link_iterate_old_cb, NULL); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20256,7 +20256,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY if (visited) free(visited); @@ -20506,7 +20506,7 @@ open_by_idx(hid_t fapl) { ret = H5Oopen_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20546,7 +20546,7 @@ open_by_idx(hid_t fapl) { ret = H5Oopen_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20590,7 +20590,7 @@ open_by_idx(hid_t fapl) { ret = H5Oopen_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20637,7 +20637,7 @@ error: H5Fclose(file_id); H5Fclose(mount_file_id); } - H5E_END_TRY; + H5E_END_TRY if (objno) free(objno); @@ -20821,7 +20821,7 @@ open_by_idx_old(hid_t fapl) { ret = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20860,7 +20860,7 @@ open_by_idx_old(hid_t fapl) { ret = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20869,7 +20869,7 @@ open_by_idx_old(hid_t fapl) { ret = H5Oopen_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, order, (hsize_t)(u - 1), H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -20905,7 +20905,7 @@ error: H5Fclose(file_id); H5Fclose(mount_file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end open_by_idx_old() */ @@ -21129,7 +21129,7 @@ object_info(hid_t fapl) ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -21186,7 +21186,7 @@ object_info(hid_t fapl) ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -21247,7 +21247,7 @@ object_info(hid_t fapl) ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -21290,7 +21290,7 @@ error: H5Gclose(soft_group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY if (objno) free(objno); @@ -21447,7 +21447,7 @@ object_info_old(hid_t fapl) ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -21503,7 +21503,7 @@ object_info_old(hid_t fapl) ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -21513,7 +21513,7 @@ object_info_old(hid_t fapl) ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_CRT_ORDER, order, (hsize_t)(u - 1), &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -21549,7 +21549,7 @@ error: H5Gclose(soft_group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end object_info_old() */ @@ -21680,7 +21680,7 @@ group_info(hid_t fapl) ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &grp_info, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -21872,7 +21872,7 @@ group_info(hid_t fapl) ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &grp_info, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -22064,7 +22064,7 @@ group_info(hid_t fapl) ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &grp_info, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -22098,7 +22098,7 @@ error: H5Gclose(soft_group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end group_info() */ @@ -22160,7 +22160,7 @@ group_info_old(hid_t fapl) { ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &grp_info, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -22350,7 +22350,7 @@ group_info_old(hid_t fapl) { ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &grp_info, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -22360,7 +22360,7 @@ group_info_old(hid_t fapl) ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, order, (hsize_t)0, &grp_info, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -22387,7 +22387,7 @@ error: H5Gclose(soft_group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end group_info_old() */ @@ -22624,7 +22624,7 @@ error: H5Gclose(group_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end timestamps() */ diff --git a/test/links_env.c b/test/links_env.c index a4d6757..620380b 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -25,10 +25,10 @@ #define TMPDIR "tmp_links_env/" #define NAME_BUF_SIZE 1024 -const char *FILENAME[] = {"extlinks_env0", /* 0: main file */ - "extlinks_env1", /* 1: target file */ - TMPDIR "extlinks_env1", /* 2 */ - NULL}; +static const char *FILENAME[] = {"extlinks_env0", /* 0: main file */ + "extlinks_env1", /* 1: target file */ + TMPDIR "extlinks_env1", /* 2 */ + NULL}; static int external_link_env(hid_t fapl, hbool_t new_format); @@ -104,7 +104,7 @@ external_link_env(hid_t fapl, hbool_t new_format) { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* Should be able to find the target file from pathnames set via HDF5_EXT_PREFIX */ if (gid < 0) { @@ -128,7 +128,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end external_link_env() */ diff --git a/test/mdset.c b/test/mdset.c index beb5500..6e736df 100644 --- a/test/mdset.c +++ b/test/mdset.c @@ -44,7 +44,7 @@ (MDSET_FLAG_CHUNK | MDSET_FLAG_MLAYOUT | MDSET_FLAG_SHAPESAME | MDSET_FLAG_MDSET | MDSET_FLAG_TCONV | \ MDSET_FLAG_FILTER) -const char *FILENAME[] = {"mdset", "mdset1", "mdset2", NULL}; +static const char *FILENAME[] = {"mdset", "mdset1", "mdset2", NULL}; /* Names for datasets */ char dset_name[MAX_DSETS][DSET_MAX_NAME_LEN]; diff --git a/test/mf.c b/test/mf.c index 9dfdcb9..c224119 100644 --- a/test/mf.c +++ b/test/mf.c @@ -98,7 +98,7 @@ #define TEST_THRESHOLD10 10 #define TEST_THRESHOLD3 3 -const char *FILENAME[] = {"mf", NULL}; +static const char *FILENAME[] = {"mf", NULL}; typedef enum { TEST_NORMAL, /* size of aggregator is >= alignment size */ @@ -335,7 +335,7 @@ error: H5Pclose(fapl_new); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_eoa() */ @@ -366,8 +366,8 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size = 0, new_file_size; /* file size */ - H5FD_mem_t type; - haddr_t addr = 0; + H5FD_mem_t type = H5FD_MEM_DEFAULT; + haddr_t addr = 0; haddr_t ma_addr = HADDR_UNDEF, new_ma_addr = HADDR_UNDEF; hsize_t ma_size = 0, new_ma_size = 0; hbool_t suitable_vfd; @@ -626,7 +626,7 @@ error: H5Pclose(fapl_new); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_eoa_shrink() */ @@ -833,7 +833,7 @@ error: H5Pclose(fapl_new); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_eoa_extend() */ @@ -941,14 +941,14 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) { status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; H5E_BEGIN_TRY { status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; @@ -957,7 +957,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) { status = H5MF_xfree(f, H5FD_MEM_SUPER, tmp_addr, (hsize_t)TBLOCK_SIZE30); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; @@ -998,7 +998,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) { check_addr = H5MF_alloc_tmp(f, (hsize_t)(maxaddr / 3)); } - H5E_END_TRY; + H5E_END_TRY if (H5_addr_defined(check_addr)) TEST_ERROR; @@ -1007,7 +1007,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) { check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3)); } - H5E_END_TRY; + H5E_END_TRY if (H5_addr_defined(check_addr)) TEST_ERROR; @@ -1041,7 +1041,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_tmp() */ @@ -1133,7 +1133,7 @@ error: H5Pclose(fapl_new); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_fs_start() */ @@ -1450,7 +1450,7 @@ error: H5Pclose(fapl_new); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_fs_alloc_free() */ @@ -1971,7 +1971,7 @@ error: H5Pclose(fapl_new); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_fs_extend() */ @@ -2154,7 +2154,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_fs_absorb() */ @@ -2300,7 +2300,7 @@ error: H5Fclose(file); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_aggr_alloc1() */ @@ -2444,7 +2444,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_aggr_alloc2() */ @@ -2610,7 +2610,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_aggr_alloc3() */ @@ -2778,7 +2778,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_aggr_alloc4() */ @@ -2904,7 +2904,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_aggr_alloc5() */ @@ -3067,7 +3067,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_aggr_alloc6() */ @@ -3259,7 +3259,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_aggr_alloc7() */ @@ -3558,7 +3558,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_aggr_extend() */ @@ -3798,7 +3798,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_aggr_absorb() */ @@ -4095,7 +4095,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_align_eoa() */ @@ -4390,7 +4390,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_align_fs() */ @@ -4666,7 +4666,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_align_alloc1() */ @@ -4960,7 +4960,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_align_alloc2() */ @@ -5346,7 +5346,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_align_alloc3() */ @@ -5562,7 +5562,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_align_alloc4() */ @@ -5792,7 +5792,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_align_alloc5() */ @@ -6107,7 +6107,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_mf_align_alloc6() */ @@ -6284,7 +6284,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_bug1() */ @@ -6563,7 +6563,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_fs_persist_split() */ @@ -6920,7 +6920,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_fs_persist_multi() */ #endif /* PB_OUT */ @@ -7096,7 +7096,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl2); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_fs_persist() */ @@ -7285,7 +7285,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl2); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_fs_gone() */ @@ -7454,7 +7454,7 @@ error: H5Pclose(fapl2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_strat_thres_persist() */ @@ -7643,7 +7643,7 @@ error: H5Pclose(fapl2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_mf_strat_thres_gone() */ @@ -7734,7 +7734,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_dichotomy() */ @@ -8014,7 +8014,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl_new); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_page_alloc_xfree() */ @@ -8143,7 +8143,7 @@ error: H5Fclose(fid); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_page_try_shrink() */ @@ -8321,7 +8321,7 @@ error: H5Fclose(fid); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_page_small_try_extend() */ @@ -8482,7 +8482,7 @@ error: H5Fclose(fid); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_page_large_try_extend() */ @@ -8635,7 +8635,7 @@ error: { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_page_large() */ @@ -8805,7 +8805,7 @@ error: H5Fclose(fid); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_page_small() */ @@ -9118,7 +9118,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl_new); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* test_page_alignment() */ @@ -9279,7 +9279,7 @@ error: H5Pclose(fapl); H5Pclose(new_fapl); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index 0d88a30..e0068c0 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -262,7 +262,7 @@ error: { H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_fapl_configuration() */ @@ -1274,7 +1274,7 @@ error: H5Pclose(splitter_config->rw_fapl_id); H5Pclose(ret_value); } - H5E_END_TRY; + H5E_END_TRY free(splitter_config); return H5I_INVALID_HID; @@ -1329,7 +1329,7 @@ error: H5Fclose(file_id); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_create_and_close() */ @@ -1497,7 +1497,7 @@ error: */ H5Pclose(dcpl_id); } - H5E_END_TRY; + H5E_END_TRY LOGPRINT(1, "_create_chunking_ids() FAILED\n"); @@ -1815,7 +1815,7 @@ error: H5Sclose(dspace_id); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_basic_dataset_write() */ @@ -1903,7 +1903,7 @@ error: H5Fclose(file_id); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_chunked_dataset_write() */ @@ -1995,7 +1995,7 @@ error: H5Gclose(grp_id); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_on_disk_zoo() */ @@ -2137,7 +2137,7 @@ error: H5Dclose(dset_id); H5Sclose(dspace_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_vanishing_datasets() */ @@ -2274,7 +2274,7 @@ error: H5Pclose(bundle[i].fapl_id); } } - H5E_END_TRY; + H5E_END_TRY free(bundle); free(buf); return -1; @@ -2332,19 +2332,19 @@ confirm_server(struct mt_opts *opts) struct sockaddr_in target_addr; unsigned attempt = 0; - live_socket = HDsocket(AF_INET, SOCK_STREAM, 0); + live_socket = socket(AF_INET, SOCK_STREAM, 0); if (live_socket < 0) { printf("ERROR socket()\n"); return -1; } target_addr.sin_family = AF_INET; - target_addr.sin_port = HDhtons((uint16_t)opts->portno); - target_addr.sin_addr.s_addr = HDinet_addr(opts->ip); + target_addr.sin_port = htons((uint16_t)opts->portno); + target_addr.sin_addr.s_addr = inet_addr(opts->ip); memset(target_addr.sin_zero, '\0', sizeof(target_addr.sin_zero)); while (1) { - if (HDconnect(live_socket, (struct sockaddr *)&target_addr, (socklen_t)sizeof(target_addr)) < 0) { + if (connect(live_socket, (struct sockaddr *)&target_addr, (socklen_t)sizeof(target_addr)) < 0) { if (attempt > 10) { printf("ERROR connect() (%d)\n%s\n", errno, HDstrerror(errno)); return -1; @@ -2362,7 +2362,7 @@ confirm_server(struct mt_opts *opts) printf("attempt #%u: ERROR connect() (%d)\n%s\n", attempt, errno, HDstrerror(errno)); /* Re-open socket for retry */ - live_socket = HDsocket(AF_INET, SOCK_STREAM, 0); + live_socket = socket(AF_INET, SOCK_STREAM, 0); if (live_socket < 0) { printf("ERROR socket()\n"); return -1; diff --git a/test/mount.c b/test/mount.c index 2e012b5..e418b25 100644 --- a/test/mount.c +++ b/test/mount.c @@ -17,14 +17,15 @@ #include "H5Fprivate.h" /* File access */ #include "H5Iprivate.h" /* IDs */ -const char *FILENAME[] = {"mount_1", "mount_2", "mount_3", "mount_4", "mount_5", "mount_6", "mount_7", NULL}; +static const char *FILENAME[] = {"mount_1", "mount_2", "mount_3", "mount_4", + "mount_5", "mount_6", "mount_7", NULL}; /* For "mount_after_close" test */ #define RANK 2 #define NX 4 #define NY 5 #define NAME_BUF_SIZE 40 -int bm[NX][NY], bm_out[NX][NY]; /* Data buffers */ +static int bm[NX][NY]; /* Data buffers */ /*------------------------------------------------------------------------- * Function: setup @@ -91,7 +92,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end setup() */ @@ -142,7 +143,7 @@ error: H5Fclose(file1); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_basic() */ @@ -185,7 +186,7 @@ test_illegal(hid_t fapl) { status = H5Fmount(file1, "/mnt1", file1, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Mounting a file on itself should have failed."); @@ -205,7 +206,7 @@ test_illegal(hid_t fapl) { status = H5Fmount(mnt, ".", file3, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Mounting two files at one mount point should have failed."); @@ -230,7 +231,7 @@ test_illegal(hid_t fapl) { status = H5Fmount(mnt, ".", file3b, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Mounting same file opened twice at one mount point should have failed."); @@ -248,7 +249,7 @@ test_illegal(hid_t fapl) { status = H5Fmount(file2, "/mnt1/file2", file1b, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Creating a cycle with mount points should have failed."); @@ -282,7 +283,7 @@ error: H5Fclose(file3); H5Fclose(file3b); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_illegal() */ @@ -350,7 +351,7 @@ test_samefile(hid_t fapl) { status = H5Fmount(mnt1b, ".", file3, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR(" Mounting different files at one mount point should have failed."); if (H5Funmount(mnt1a, ".") < 0) @@ -389,7 +390,7 @@ test_samefile(hid_t fapl) { status = H5Fmount(mnt1b, ".", file2, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR(" Mounting same files at one mount point should have failed."); if (H5Funmount(mnt1a, ".") < 0) @@ -422,7 +423,7 @@ error: H5Fclose(file2); H5Fclose(file3); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_samefile() */ @@ -468,7 +469,7 @@ test_hide(hid_t fapl) { grp = H5Gopen2(file1, "/mnt1/file1", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (grp >= 0) { H5_FAILED(); HDputs(" Name is still accessible under mount point."); @@ -518,7 +519,7 @@ error: H5Fclose(file1); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_hide() */ @@ -601,7 +602,7 @@ error: H5Fclose(file2); H5Fclose(file1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_assoc() */ @@ -666,7 +667,7 @@ error: H5Fclose(file1); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_mntlnk() */ @@ -708,7 +709,7 @@ test_move(hid_t fapl) { status = H5Lmove(file1, "/mnt1/rename_b/y", H5L_SAME_LOC, "/y", H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Moving an object across files shouldn't have been possible"); @@ -732,7 +733,7 @@ error: H5Fclose(file1); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_move() */ @@ -795,7 +796,7 @@ error: H5Fclose(file2); H5Fclose(file1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_preopen() */ @@ -865,7 +866,7 @@ error: H5Fclose(file2); H5Fclose(file1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_postopen() */ @@ -929,7 +930,7 @@ test_unlink(hid_t fapl) { status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Incorrect traversal from mount point!"); @@ -950,7 +951,7 @@ test_unlink(hid_t fapl) { status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Traversal through mount point should not have worked!"); @@ -960,7 +961,7 @@ test_unlink(hid_t fapl) { status = H5Oget_info_by_name3(file2, "/mnt_unlink/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Traversal through mount point should not have worked!"); @@ -976,7 +977,7 @@ test_unlink(hid_t fapl) { status = H5Funmount(file1, "/mnt_unlink"); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); printf(" %d: Unmount by name should not have been allowed!\n", __LINE__); @@ -986,7 +987,7 @@ test_unlink(hid_t fapl) { status = H5Funmount(file2, "/"); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); printf(" %d: Unmount by name should not have been allowed!\n", __LINE__); @@ -1016,7 +1017,7 @@ error: H5Fclose(file2); H5Fclose(file1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_unlink() */ @@ -1074,7 +1075,7 @@ error: H5Fclose(file1); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_mvmpt() */ @@ -1116,7 +1117,7 @@ test_interlink(hid_t fapl) { status = H5Lcreate_hard(file1, "/mnt1/file2", H5L_SAME_LOC, "/file2", H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Interfile hard link should not have been allowed!"); @@ -1128,7 +1129,7 @@ test_interlink(hid_t fapl) { status = H5Lmove(file1, "/mnt1/file2", H5L_SAME_LOC, "/file2", H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) { H5_FAILED(); HDputs(" Interfile renaming should not have been allowed!"); @@ -1151,7 +1152,7 @@ test_interlink(hid_t fapl) { dset = H5Dcreate2(file1, "/mnt1/file2/dset", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dset >= 0) { H5_FAILED(); HDputs(" Dataset and shared type must be in the same file!"); @@ -1190,7 +1191,7 @@ error: H5Fclose(file1); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_interlink() */ @@ -1265,7 +1266,7 @@ error: H5Fclose(file1); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_uniformity() */ @@ -1349,7 +1350,7 @@ error: H5Fclose(file1); H5Fclose(file2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_close() */ @@ -1579,7 +1580,7 @@ error: H5Fclose(fid1); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_mount_after_close() */ @@ -1843,7 +1844,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -1990,7 +1991,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_missing_unmount() */ @@ -2115,7 +2116,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_hold_open_file() */ @@ -2266,7 +2267,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_hold_open_group() */ @@ -2345,7 +2346,7 @@ test_fcdegree_same(hid_t fapl) { ret = H5Fmount(gidA, ".", fid2, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2405,7 +2406,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_fcdegree_same() */ @@ -2496,7 +2497,7 @@ test_fcdegree_semi(hid_t fapl) { ret = H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2509,7 +2510,7 @@ test_fcdegree_semi(hid_t fapl) { ret = H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2543,7 +2544,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_fcdegree_semi() */ @@ -2645,14 +2646,14 @@ test_fcdegree_strong(hid_t fapl) { ret = H5Oget_info3(gidA, &oinfo, H5O_INFO_BASIC); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; H5E_BEGIN_TRY { ret = H5Oget_info3(gidAM, &oinfo, H5O_INFO_BASIC); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2678,7 +2679,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_fcdegree_strong() */ @@ -2784,14 +2785,14 @@ test_acc_perm(hid_t fapl) { bad_id = H5Gcreate2(gidAM, "Z", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (bad_id >= 0) TEST_ERROR; H5E_BEGIN_TRY { bad_id = H5Gcreate2(fid1, "/A/L", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (bad_id >= 0) TEST_ERROR; @@ -2834,7 +2835,7 @@ test_acc_perm(hid_t fapl) { bad_id = H5Gcreate2(fid1, "/A/L", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (bad_id >= 0) TEST_ERROR; @@ -2879,7 +2880,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_acc_perm() */ @@ -3097,7 +3098,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_mult_mount() */ @@ -3226,7 +3227,7 @@ test_nested_survive(hid_t fapl) { gidAMS = H5Gopen2(fid1, "A/M/S", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gidAMS >= 0) TEST_ERROR; @@ -3305,7 +3306,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_nested_survive() */ @@ -3436,7 +3437,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_close_parent() */ @@ -3733,7 +3734,7 @@ test_cut_graph(hid_t fapl) { gidK = H5Gopen2(gidQ, "/A/D/K", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gidK >= 0) TEST_ERROR; @@ -3756,7 +3757,7 @@ test_cut_graph(hid_t fapl) { gidO = H5Gopen2(gidM, "/B/H/O", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gidO >= 0) TEST_ERROR; @@ -3858,7 +3859,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_cut_graph() */ @@ -3965,7 +3966,7 @@ test_symlink(hid_t fapl) { gidL = H5Gopen2(fid1, "L", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (gidL >= 0) TEST_ERROR; @@ -4019,7 +4020,7 @@ error: H5Fclose(fid2); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_symlink() */ @@ -4119,7 +4120,7 @@ error: H5Fclose(fid2[i]); } } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_sharedacc() */ @@ -4273,7 +4274,7 @@ error: H5Fclose(fid2); H5Fclose(fid3); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_sharedclose() */ @@ -4423,7 +4424,7 @@ error: H5Fclose(fid2); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_multisharedclose() */ diff --git a/test/mtime.c b/test/mtime.c index 1292348..11668c8 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -19,7 +19,7 @@ #include "h5test.h" #include "H5srcdir.h" -const char *FILENAME[] = {"mtime", NULL}; +static const char *FILENAME[] = {"mtime", NULL}; #define TESTFILE1 "tmtimeo.h5" #define MTIME1 1055531866 diff --git a/test/ntypes.c b/test/ntypes.c index c4b0fce..99ac151 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -16,7 +16,7 @@ #include "h5test.h" -const char *FILENAME[] = {"ntypes", NULL}; +static const char *FILENAME[] = {"ntypes", NULL}; #define DIM0 100 #define DIM1 200 @@ -286,7 +286,7 @@ error: H5Tclose(dtype); H5Sclose(space); } - H5E_END_TRY; + H5E_END_TRY free(ipoints2); free(icheck2); @@ -605,7 +605,7 @@ error: H5Tclose(dtype); H5Tclose(native_type); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -813,7 +813,7 @@ error: H5Tclose(native_type); H5Tclose(tid2); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1049,7 +1049,7 @@ error: H5Tclose(tid_m); H5Tclose(tid_m2); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1271,7 +1271,7 @@ error: H5Tclose(tid2); H5Tclose(tid_m); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1425,7 +1425,7 @@ error: H5Tclose(tid); H5Tclose(tid_m); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1608,7 +1608,7 @@ error: H5Tclose(tid3); H5Tclose(tid_m); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1752,7 +1752,7 @@ error: H5Tclose(tid); H5Tclose(tid_m); } - H5E_END_TRY; + H5E_END_TRY free(ipoints3); free(icheck3); @@ -1956,7 +1956,7 @@ error: H5Tclose(tid_m); H5Tclose(tid_m2); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_vl_type() */ @@ -2091,7 +2091,7 @@ error: H5Tclose(sid1); H5Tclose(tid1); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_vlstr_dtype() */ @@ -2208,7 +2208,7 @@ error: H5Tclose(tid1); H5Tclose(sid1); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_str_dtype() */ @@ -2376,7 +2376,7 @@ error: H5Tclose(native_type); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_refer_dtype() */ @@ -2585,7 +2585,7 @@ error: H5Dclose(dset2); H5Dclose(dset1); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_refer_dtype2() */ @@ -2679,7 +2679,7 @@ error: H5Dclose(dset); H5Dclose(dataset); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_opaque_dtype */ @@ -2830,7 +2830,7 @@ error: H5Dclose(dataset1); H5Dclose(dataset2); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_bitfield_dtype */ @@ -3037,7 +3037,7 @@ error: H5Fclose(fid1); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_ninteger() */ @@ -3112,7 +3112,7 @@ error: H5Fclose(file); h5_cleanup(FILENAME, fapl); } - H5E_END_TRY; + H5E_END_TRY nerrors = MAX(1, nerrors); printf("***** %d DATASET TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); diff --git a/test/objcopy.c b/test/objcopy.c index 125fa21..ab40284 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -57,8 +57,8 @@ #define H5O_TESTING #include "H5Opkg.h" /* Object header */ -const char *FILENAME[] = {"objcopy_src", "objcopy_dst", "objcopy_ext", "objcopy_src2", - "verbound_src", "verbound_dst", NULL}; +static const char *FILENAME[] = {"objcopy_src", "objcopy_dst", "objcopy_ext", "objcopy_src2", + "verbound_src", "verbound_dst", NULL}; /* Configuration, really a series of bit flags. Maximum value is all three * bit flags enabled. @@ -315,7 +315,7 @@ error: H5Dclose(did2); H5Aclose(aid); } - H5E_END_TRY; + H5E_END_TRY return (-1); } @@ -408,7 +408,7 @@ error: H5Dclose(dsetv_id); H5Aclose(aid); } - H5E_END_TRY; + H5E_END_TRY return (-1); } @@ -530,7 +530,7 @@ error: H5Dclose(dsetv_id); H5Pclose(pid); } - H5E_END_TRY; + H5E_END_TRY return (-1); } @@ -886,7 +886,7 @@ error: H5Tclose(tid2); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* end compare_attribute() */ @@ -970,7 +970,7 @@ error: H5Aclose(aid2); H5Aclose(aid); } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* end compare_std_attributes() */ @@ -1491,7 +1491,7 @@ error: H5Tclose(tid2); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* end compare_datasets() */ @@ -1691,7 +1691,7 @@ error: H5E_BEGIN_TRY { } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* end compare_groups() */ @@ -1837,7 +1837,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_named_datatype */ @@ -1944,7 +1944,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_named_datatype_vl */ @@ -2059,7 +2059,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_named_datatype_vl_vl */ @@ -2239,7 +2239,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_named_datatype_attr_self */ @@ -2373,7 +2373,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_simple */ @@ -2488,7 +2488,7 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src) { ret = H5Pset_libver_bounds(fapl_dst, low, high); } - H5E_END_TRY; + H5E_END_TRY if (ret < 0) /* Invalid low/high combinations */ continue; @@ -2509,7 +2509,7 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src) ret = H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* If copy failed, check if the failure is expected */ if (ret < 0) { @@ -2577,7 +2577,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_versionbounds */ @@ -2696,7 +2696,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_simple_samefile */ @@ -2834,7 +2834,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_simple_empty */ @@ -2986,7 +2986,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_compound */ @@ -3509,7 +3509,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_chunked */ @@ -4009,7 +4009,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_chunked_empty */ @@ -4387,7 +4387,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_chunked_sparse */ @@ -4801,7 +4801,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_compressed */ @@ -4983,7 +4983,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_no_edge_filt */ @@ -5142,7 +5142,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_compact */ @@ -5177,7 +5177,7 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t buf[i] = i; /* create an empty external file */ - HDfclose(fopen(FILE_EXT, "w")); + fclose(fopen(FILE_EXT, "w")); /* Initialize the filenames */ h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); @@ -5287,7 +5287,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_external */ @@ -5429,7 +5429,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_named_dtype */ @@ -5593,7 +5593,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_named_dtype_hier */ @@ -5758,7 +5758,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_named_dtype_hier_outside */ @@ -5934,7 +5934,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_multi_ohdr_chunks */ @@ -6102,7 +6102,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_attr_named_dtype */ @@ -6259,7 +6259,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_contig_vl */ @@ -6473,7 +6473,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_chunked_vl */ @@ -6641,7 +6641,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_compact_vl */ @@ -6779,7 +6779,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_simple_empty */ @@ -6959,7 +6959,7 @@ error: H5Tclose(tid2); H5Pclose(dxpl_id); } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* compare_attribute_compound_vlstr() */ @@ -7124,7 +7124,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_attribute_compound_vlstr() */ @@ -7311,7 +7311,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_compressed_vl */ @@ -7419,7 +7419,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_group_empty */ @@ -7575,7 +7575,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_root_group */ @@ -7731,7 +7731,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_group */ @@ -7897,7 +7897,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_group_deep */ @@ -8026,7 +8026,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_group_loop */ @@ -8176,7 +8176,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_group_wide_loop */ @@ -8498,7 +8498,7 @@ error: H5Fclose(fid_src); H5Pclose(plid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_group_links */ @@ -8657,7 +8657,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_soft_link */ @@ -8818,7 +8818,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_ext_link */ @@ -8919,7 +8919,7 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { ret = H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -8942,7 +8942,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_exist */ @@ -9040,7 +9040,7 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { ret = H5Ocopy(fid_src, NAME_DATASET_SUB_SUB, fid_dst, NAME_DATASET_SUB_SUB, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -9105,7 +9105,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_path */ @@ -9180,7 +9180,7 @@ error: H5Tclose(tid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_same_file_named_datatype */ @@ -9293,7 +9293,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_old_layout */ @@ -9475,7 +9475,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_compact_named_vl */ @@ -9645,7 +9645,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_contig_named_vl */ @@ -9842,7 +9842,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_chunked_named_vl */ @@ -10027,7 +10027,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_compressed_named_vl */ @@ -10216,7 +10216,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_compact_vl_vl */ @@ -10416,7 +10416,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_contig_vl_vl */ @@ -10648,7 +10648,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_chunked_vl_vl */ @@ -10852,7 +10852,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_compressed_vl_vl */ @@ -11034,7 +11034,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_contig_cmpd_vl */ @@ -11217,7 +11217,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_chunked_cmpd_vl */ @@ -11399,7 +11399,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_compact_cmpd_vl */ @@ -11587,7 +11587,7 @@ error: H5Fclose(fid2); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_null_ref */ @@ -11799,7 +11799,7 @@ error: H5Fclose(fid2); H5Fclose(fid3); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_null_ref_open */ @@ -11932,7 +11932,7 @@ error: H5Fclose(fid1); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_attr_crt_order */ @@ -12248,7 +12248,7 @@ error: H5Dclose(did); H5Pclose(ocpypl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_committed_datatype_merge */ @@ -12640,7 +12640,7 @@ error: H5Dclose(did); H5Pclose(ocpypl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_committed_datatype_merge_same_file */ @@ -12935,7 +12935,7 @@ error: H5Dclose(did); H5Pclose(ocpypl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_committed_dt_merge_sugg */ @@ -13162,7 +13162,7 @@ error: H5Gclose(gid); H5Pclose(ocpypl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_committed_dt_merge_attr */ @@ -13663,7 +13663,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_cdt_hier_merge */ @@ -13991,7 +13991,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_cdt_merge_cdt */ @@ -14304,7 +14304,7 @@ error: H5Tclose(tid); H5Pclose(ocpypl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_cdt_merge_suggs */ @@ -14678,7 +14678,7 @@ error: H5Dclose(did); H5Pclose(ocpypl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_cdt_merge_dset_suggs */ @@ -15304,7 +15304,7 @@ error: H5Sclose(sid); H5Pclose(ocpypl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_cdt_merge_all_suggs */ @@ -15774,7 +15774,7 @@ error: H5Dclose(did); H5Pclose(ocpypl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_set_mcdt_search_cb */ @@ -16127,7 +16127,7 @@ error: H5Dclose(did); H5Pclose(ocpypl_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_set_get_mcdt_search_cb */ @@ -16291,7 +16291,7 @@ error: H5Fclose(fid1); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_iterate */ @@ -16671,7 +16671,7 @@ error: H5Fclose(fid_src); H5Fclose(fid_ext); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_option */ @@ -17103,7 +17103,7 @@ error: H5Fclose(fid_dst); H5Fclose(fid_src); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_dataset_open */ diff --git a/test/objcopy_ref.c b/test/objcopy_ref.c index 027f30e..7a81aea 100644 --- a/test/objcopy_ref.c +++ b/test/objcopy_ref.c @@ -20,13 +20,13 @@ #define H5F_TESTING #include "H5Fpkg.h" /* File access */ -const char *FILENAME[] = {"objcopy_ref_src", - "objcopy_ref_dst", - "objcopy_ref_ext", - "objcopy_ref_src2", - "verbound_ref_src", - "verbound_ref_dst", - NULL}; +static const char *FILENAME[] = {"objcopy_ref_src", + "objcopy_ref_dst", + "objcopy_ref_ext", + "objcopy_ref_src2", + "verbound_ref_src", + "verbound_ref_dst", + NULL}; /* Configuration, really a series of bit flags. Maximum value is all three * bit flags enabled. @@ -229,7 +229,7 @@ error: H5Rdestroy(&ref[0]); H5Rdestroy(&ref[1]); } - H5E_END_TRY; + H5E_END_TRY return (-1); } @@ -326,7 +326,7 @@ error: H5Rdestroy(&ref[0]); H5Rdestroy(&ref[1]); } - H5E_END_TRY; + H5E_END_TRY return (-1); } @@ -454,7 +454,7 @@ error: H5Rdestroy(&ref[0]); H5Rdestroy(&ref[1]); } - H5E_END_TRY; + H5E_END_TRY return (-1); } @@ -679,7 +679,7 @@ error: H5Tclose(tid2); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* end compare_attribute() */ @@ -763,7 +763,7 @@ error: H5Aclose(aid2); H5Aclose(aid); } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* end compare_std_attributes() */ @@ -1212,7 +1212,7 @@ error: H5Tclose(tid2); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* end compare_datasets() */ @@ -1412,7 +1412,7 @@ error: H5E_BEGIN_TRY { } - H5E_END_TRY; + H5E_END_TRY return FALSE; } /* end compare_groups() */ @@ -1792,7 +1792,7 @@ error: H5Fclose(fid_src); H5Fclose(fid_ext); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_copy_option */ diff --git a/test/ohdr.c b/test/ohdr.c index 44cdbbe..95a4dc3 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -37,7 +37,7 @@ #define H5FD_TESTING #include "H5FDpkg.h" -const char *FILENAME[] = {"ohdr", "ohdr_min_a", "ohdr_min_b", NULL}; +static const char *FILENAME[] = {"ohdr", "ohdr_min_a", "ohdr_min_b", NULL}; /* used for object header size comparison */ #define EQ 1 @@ -165,7 +165,7 @@ error: H5O_close(&oh_locB, NULL); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_cont() */ @@ -303,7 +303,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* test_ohdr_cache() */ @@ -454,7 +454,7 @@ error: HDremove(FILE_OHDR_SWMR); free(wbuf); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* test_ohdr_swmr() */ @@ -493,7 +493,7 @@ test_ohdr_badness(hid_t fapl) */ fid = H5Fopen(CVE_2020_10810_FILENAME, H5F_ACC_RDWR, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) FAIL_PUTS_ERROR("should not have been able to open malformed file"); @@ -507,7 +507,7 @@ error: { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -612,7 +612,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) { did = H5Dopen2(loc_bogus, "Dataset3", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (did >= 0) { H5Dclose(did); TEST_ERROR; @@ -779,7 +779,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) { did = H5Dopen2(loc_bogus, "Dataset2", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (did >= 0) { H5Dclose(did); TEST_ERROR; @@ -794,7 +794,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) { did = H5Dopen2(loc_bogus, "Dataset3", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (did >= 0) { H5Dclose(did); TEST_ERROR; @@ -822,7 +822,7 @@ error: H5Sclose(sid); H5Aclose(aid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* test_unknown() */ @@ -1064,7 +1064,7 @@ error: (void)H5Aclose(aid); (void)H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY free(in_buf); free(out_buf); @@ -1295,7 +1295,7 @@ error: (void)H5Dclose(dset_F_N_id); (void)H5Dclose(dset_F_Y_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* test_minimized_dset_ohdr_size_comparisons */ @@ -1451,7 +1451,7 @@ error: (void)H5Dclose(dset_mZ_id); (void)H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* test_minimized_dset_ohdr_with_filter */ @@ -1673,7 +1673,7 @@ error: (void)H5Fclose(file_id); (void)H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* test_minimized_dset_ohdr_modification_times */ @@ -1807,7 +1807,7 @@ error: (void)H5Dclose(dset_1_id); (void)H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* test_minimized_dset_ohdr_fillvalue_backwards_compatability */ @@ -1868,7 +1868,7 @@ main(void) { ret = H5Pset_libver_bounds(fapl, low, high); } - H5E_END_TRY; + H5E_END_TRY if (ret < 0) /* Invalid low/high combinations */ continue; @@ -2064,7 +2064,7 @@ main(void) { ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; if (H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE) < 0) @@ -2157,7 +2157,7 @@ error: { H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/onion.c b/test/onion.c index 88faf2b..eb44a4f 100644 --- a/test/onion.c +++ b/test/onion.c @@ -90,18 +90,18 @@ static unsigned int flags_create_s = 0; */ /* twenty-six four-character words beginning with 'a' -> 104 bytes */ -const unsigned char *a_list_s = +static const unsigned char *a_list_s = (const unsigned char *)"abetableacedacesacheacidacneadzeafaragedagesaidsairsajarallyalum" "amokantsapesarcsareaartsasksaspsavidaxes"; uint64_t a_list_size_s = 104; /* fifty-three four-character words beginning with 'b' -> 212 bytes */ -const unsigned char *b_list_s = +static const unsigned char *b_list_s = (const unsigned char *)"badebailbaitbalebanebarebaskbeambeanbearbeenbeerbeltbentbestbide" "bikebilebindbirdbiteblipblueboarboatbobsbodyboilboldbollboltbond" "boneboobboorboosbootbradbragbratbraybrewbritbrowbuckbudsbunkbunt" "buoyburnburybustbuys"; -uint64_t b_list_size_s = 212; +static uint64_t b_list_size_s = 212; /* Allocate and populate filepaths with h5_fixname'd strings as appropriate. * Should be released with onion_filepaths_destroy() when done. @@ -733,7 +733,7 @@ test_fapl(void) { ret = H5Pset_fapl_onion(H5I_INVALID_HID, &info_in); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; @@ -742,7 +742,7 @@ test_fapl(void) { ret = H5Pset_fapl_onion(fapl_id, NULL); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; @@ -752,7 +752,7 @@ test_fapl(void) { ret = H5Pset_fapl_onion(fapl_id, &info_in); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; info_in.version--; @@ -763,7 +763,7 @@ test_fapl(void) { ret = H5Pset_fapl_onion(fapl_id, &info_in); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; @@ -773,7 +773,7 @@ test_fapl(void) { ret = H5Pset_fapl_onion(fapl_id, &info_in); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; info_in.page_size = ONION_TEST_PAGE_SIZE_1; @@ -784,7 +784,7 @@ test_fapl(void) { ret = H5Pset_fapl_onion(fapl_id, &info_in); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; @@ -794,7 +794,7 @@ test_fapl(void) { ret = H5Pset_fapl_onion(fapl_id, &info_in); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; info_in.backing_fapl_id = H5P_DEFAULT; @@ -809,7 +809,7 @@ test_fapl(void) { ret = H5Pget_fapl_onion(fapl_id, NULL); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; @@ -818,7 +818,7 @@ test_fapl(void) { ret = H5Pget_fapl_onion(H5I_INVALID_HID, &info_out); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; @@ -827,7 +827,7 @@ test_fapl(void) { ret = H5Pget_fapl_onion(fapl_id_sec2, &info_out); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; @@ -911,9 +911,10 @@ test_header_encode_decode(void) ptr = exp + H5FD_ONION_ENCODED_SIZE_HEADER - 4; UINT32ENCODE(ptr, checksum); - hdr.version = H5FD_ONION_HEADER_VERSION_CURR; - hdr.flags = 12; - hdr.origin_eof = 8589934609ull, hdr.page_size = 4096; + hdr.version = H5FD_ONION_HEADER_VERSION_CURR; + hdr.flags = 12; + hdr.origin_eof = 8589934609ull; + hdr.page_size = 4096; hdr.history_addr = 123456; hdr.history_size = 88; @@ -944,7 +945,7 @@ test_header_encode_decode(void) { size_ret = H5FD__onion_header_decode(exp, &hdr_out); } - H5E_END_TRY; + H5E_END_TRY if (0 != size_ret) TEST_ERROR; @@ -958,7 +959,7 @@ test_header_encode_decode(void) { size_ret = H5FD__onion_header_decode(exp, &hdr_out); } - H5E_END_TRY; + H5E_END_TRY if (0 != size_ret) TEST_ERROR; @@ -967,7 +968,7 @@ test_header_encode_decode(void) { size_ret = H5FD__onion_header_decode(exp, &hdr_out); } - H5E_END_TRY; + H5E_END_TRY if (0 != size_ret) TEST_ERROR; @@ -1058,7 +1059,7 @@ test_history_encode_decode_empty(void) { size_ret = H5FD__onion_history_decode(exp, &history_out); } - H5E_END_TRY; + H5E_END_TRY if (0 != size_ret) TEST_ERROR; @@ -1071,7 +1072,7 @@ test_history_encode_decode_empty(void) { size_ret = H5FD__onion_history_decode(exp, &history_out); } - H5E_END_TRY; + H5E_END_TRY if (0 != size_ret) TEST_ERROR; @@ -1080,7 +1081,7 @@ test_history_encode_decode_empty(void) { size_ret = H5FD__onion_history_decode(exp, &history_out); } - H5E_END_TRY; + H5E_END_TRY if (0 != size_ret) TEST_ERROR; @@ -1284,7 +1285,7 @@ test_revision_record_encode_decode(void) 0, 0, 0, 0, /* Bytes 080-083: checksum (populated below) */ /* ENTRY 1 */ 0, 0xF0, 0x2E, 0, 0, 0, 0, 0, /* Bytes 084-091: entry 1: logical offset */ - 0xA7, 0, 0, 0, 0, 0, 0, 0, /* Bytes 092-099: entry 1: physical address */ + 0xA7, 0, 0, 0, 0, 0, 0, 0, /* Bytes 092-099: entry 1: physical address */ 0, 0, 0, 0, /* Bytes 100-103: checksum (populated below) */ /* ENTRY 2 */ 0, 0x50, 0x15, 0, 0, 0x20, 0, 0, /* Bytes 104-111: entry 2: logical offset */ @@ -1420,7 +1421,7 @@ test_revision_record_encode_decode(void) { size_ret = H5FD__onion_revision_record_decode(exp, &r_out); } - H5E_END_TRY; + H5E_END_TRY if (0 != size_ret) TEST_ERROR; exp[2] = 'R'; /* reset */ @@ -1431,7 +1432,7 @@ test_revision_record_encode_decode(void) { size_ret = H5FD__onion_revision_record_decode(exp, &r_out); } - H5E_END_TRY; + H5E_END_TRY if (0 != size_ret) TEST_ERROR; @@ -1441,7 +1442,7 @@ test_revision_record_encode_decode(void) { size_ret = H5FD__onion_revision_record_decode(exp, &r_out); } - H5E_END_TRY; + H5E_END_TRY if (0 != size_ret) TEST_ERROR; exp[4] = H5FD_ONION_REVISION_RECORD_VERSION_CURR; /* reset */ @@ -1857,7 +1858,7 @@ verify_stored_onion_create_0_open(struct onion_filepaths *paths, H5FD_onion_fapl { err_ret = H5FDread(file, H5FD_MEM_DRAW, H5P_DEFAULT, 0, 1, act_buf); } - H5E_END_TRY; + H5E_END_TRY if (err_ret != FAIL) TEST_ERROR; @@ -1971,7 +1972,7 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) { vfile_raw = H5FDopen(paths->canon, H5F_ACC_RDONLY, fapl_id, HADDR_UNDEF); } - H5E_END_TRY; + H5E_END_TRY /* Check if onion history for onion-open created file */ if (NULL != vfile_raw) @@ -2007,7 +2008,7 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) { vfile_ro = H5FDopen(paths->canon, H5F_ACC_RDONLY, fapl_id, HADDR_UNDEF); } - H5E_END_TRY; + H5E_END_TRY /* check if onionization (creation) not complete; nothing to open */ if (vfile_ro != NULL) TEST_ERROR; @@ -2094,7 +2095,7 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) { vfile_raw = H5FDopen(paths->recovery, H5F_ACC_RDONLY, onion_info.backing_fapl_id, HADDR_UNDEF); } - H5E_END_TRY; + H5E_END_TRY if (NULL != vfile_raw) TEST_ERROR; @@ -2191,7 +2192,7 @@ error: { H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_create_oniontarget() */ @@ -2545,7 +2546,7 @@ error: H5Pclose(fapl_id); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_several_revisions_with_logical_gaps() */ @@ -2642,7 +2643,7 @@ error: { H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY free(buf_vfy); @@ -2853,7 +2854,7 @@ error: H5Pclose(fapl_id); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_page_aligned_history_create() */ @@ -3189,7 +3190,7 @@ error: H5Pclose(fapl_id); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY free(wdata); free(rdata); @@ -3448,7 +3449,7 @@ error: H5Pclose(fapl_id); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY free(wdata); free(rdata); @@ -3810,7 +3811,7 @@ error: H5Sclose(space); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_integration_create_delete_objects */ @@ -4085,7 +4086,7 @@ error: H5Pclose(fapl_id); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_integration_dset_extension */ @@ -4265,7 +4266,7 @@ error: H5Pclose(fapl_id); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -4647,7 +4648,7 @@ error: H5Pclose(fapl_id); H5Pclose(onion_info.backing_fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -4887,7 +4888,7 @@ error: H5Fclose(file_id); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY free(wdata); free(rdata); diff --git a/test/page_buffer.c b/test/page_buffer.c index 4bb8b87..6eed35f 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -56,7 +56,7 @@ static unsigned create_file(char *filename, hid_t fcpl, hid_t fapl); static unsigned open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size); #endif /* H5_HAVE_PARALLEL */ -const char *FILENAME[] = {"filepaged", NULL}; +static const char *FILENAME[] = {"filepaged", NULL}; #ifndef H5_HAVE_PARALLEL @@ -195,7 +195,7 @@ error: if (data) free(data); } - H5E_END_TRY; + H5E_END_TRY return (1); } /* create_file */ @@ -286,7 +286,7 @@ error: if (data) free(data); } - H5E_END_TRY; + H5E_END_TRY return 1; } #endif /* H5_HAVE_PARALLEL */ @@ -402,7 +402,7 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) { file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file_id >= 0) TEST_ERROR; @@ -423,7 +423,7 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) { file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file_id >= 0) TEST_ERROR; @@ -435,7 +435,7 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) { ret = H5Pset_page_buffer_size(fapl, 512, 50, 51); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -526,7 +526,7 @@ error: H5Pclose(fapl); H5Pclose(fcpl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_args */ @@ -788,7 +788,7 @@ error: if (data) free(data); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_raw_data_handling */ @@ -1027,7 +1027,7 @@ error: if (data) free(data); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_lru_processing */ @@ -1644,7 +1644,7 @@ error: if (data) free(data); } - H5E_END_TRY; + H5E_END_TRY return 1; @@ -1931,7 +1931,7 @@ error: if (data) free(data); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_stats_collection */ @@ -1989,7 +1989,7 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr) { file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file_id >= 0) TEST_ERROR; @@ -2021,7 +2021,7 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr) { file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file_id >= 0) TEST_ERROR; @@ -2044,7 +2044,7 @@ error: H5Pclose(fcpl); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return 1; @@ -2133,7 +2133,7 @@ error: { H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY if (api_ctx_pushed) H5CX_pop(FALSE); diff --git a/test/reserved.c b/test/reserved.c index 31a6bbd..1b29f8b 100644 --- a/test/reserved.c +++ b/test/reserved.c @@ -13,7 +13,7 @@ #include "h5test.h" #ifdef BROKEN -const char *FILENAME[] = {"rsrv_heap", "rsrv_ohdr", "rsrv_vlen", NULL}; +static const char *FILENAME[] = {"rsrv_heap", "rsrv_ohdr", "rsrv_vlen", NULL}; /*------------------------------------------------------------------------- * Function: rsrv_heap diff --git a/test/set_extent.c b/test/set_extent.c index 3515395..9f8e182 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -23,8 +23,8 @@ *------------------------------------------------------------------------- */ -const char *FILENAME[] = {"set_extent1", "set_extent2", "set_extent3", "set_extent4", - "set_extent5", "set_extent6", NULL}; +static const char *FILENAME[] = {"set_extent1", "set_extent2", "set_extent3", "set_extent4", + "set_extent5", "set_extent6", NULL}; #define NAME_BUF_SIZE 1024 #define EXT_FILE_NAME1 "ext1.bin" @@ -426,7 +426,7 @@ do_layouts(hid_t fapl) { ret = H5Pset_libver_bounds(new_fapl, low, high); } - H5E_END_TRY; + H5E_END_TRY if (ret < 0) /* Invalid low/high combinations */ { @@ -455,7 +455,7 @@ error: { H5Pclose(new_fapl); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -787,7 +787,7 @@ error: H5Pclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_rank1() */ @@ -1282,7 +1282,7 @@ error: H5Pclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1717,7 +1717,7 @@ error: H5Pclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1978,7 +1978,7 @@ test_external(hid_t fapl) TEST_ERROR; } } - H5E_END_TRY; + H5E_END_TRY /*------------------------------------------------------------------------- * close property list @@ -2007,7 +2007,7 @@ error: H5Pclose(dcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2093,7 +2093,7 @@ test_layouts(H5D_layout_t layout, hid_t fapl) { ret = H5Dset_extent(did, dims_e); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2142,7 +2142,7 @@ test_layouts(H5D_layout_t layout, hid_t fapl) { ret = H5Dset_extent(did, dims_s); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2215,7 +2215,7 @@ error: H5Pclose(dcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2426,7 +2426,7 @@ error: H5Dclose(dset); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY free(rbuf); free(wbuf); @@ -2718,7 +2718,7 @@ error: H5Tclose(type); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY free(rbuf); free(wbuf); diff --git a/test/stab.c b/test/stab.c index 2760cb7..6bdba65 100644 --- a/test/stab.c +++ b/test/stab.c @@ -18,7 +18,7 @@ #include "h5test.h" #include "H5Gpkg.h" /* Groups */ -const char *FILENAME[] = {"stab", NULL}; +static const char *FILENAME[] = {"stab", NULL}; #define NAME_BUF_SIZE 1024 @@ -170,7 +170,7 @@ error: H5Gclose(g3); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -252,7 +252,7 @@ error: free(name2); free(name1); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_long() */ @@ -322,7 +322,7 @@ error: H5Gclose(cwg); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_large() */ @@ -606,7 +606,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end lifecycle() */ @@ -766,7 +766,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (objname) free(objname); @@ -873,7 +873,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end read_old() */ @@ -1011,7 +1011,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end no_compact() */ @@ -1161,7 +1161,7 @@ error: H5Gclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end gcpl_on_root() */ @@ -1262,7 +1262,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end old_api() */ @@ -1353,7 +1353,7 @@ error: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end corrupt_stab_msg() */ diff --git a/test/swmr.c b/test/swmr.c index 54afb9d..0354744 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -48,10 +48,10 @@ #define H5O_TESTING #include "H5Opkg.h" /* Object headers */ -const char *FILENAME[] = {"swmr0", /* 0 */ - "swmr1", /* 1 */ - "swmr2", /* 2 */ - NULL}; +static const char *FILENAME[] = {"swmr0", /* 0 */ + "swmr1", /* 1 */ + "swmr2", /* 2 */ + NULL}; #define NAME_BUF_SIZE 1024 /* Length of file name */ @@ -170,7 +170,7 @@ test_metadata_read_attempts(hid_t in_fapl) { ret = H5Pset_metadata_read_attempts(fapl, 0); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -834,7 +834,7 @@ error: H5Fclose(fid1); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY return -1; @@ -1531,7 +1531,7 @@ error: H5Fclose(fid); H5Fclose(fid1); } - H5E_END_TRY; + H5E_END_TRY return -1; @@ -1662,7 +1662,7 @@ test_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (new_format) { if (ret < 0) TEST_ERROR; @@ -1879,7 +1879,7 @@ error: H5Sclose(sid2); H5Sclose(sid3); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_start_swmr_write() */ @@ -1990,7 +1990,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2016,7 +2016,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2043,7 +2043,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2072,7 +2072,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2091,7 +2091,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2110,7 +2110,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2143,7 +2143,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2156,7 +2156,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2204,7 +2204,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2231,7 +2231,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid2); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2260,7 +2260,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid2); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2290,7 +2290,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { bad_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, new_fapl); } - H5E_END_TRY; + H5E_END_TRY if (bad_fid >= 0) TEST_ERROR; @@ -2302,7 +2302,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { bad_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY if (bad_fid >= 0) TEST_ERROR; @@ -2317,7 +2317,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2335,7 +2335,7 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) { ret = H5Fstart_swmr_write(fid); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -2368,7 +2368,7 @@ error: */ H5Fclose(bad_fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_err_start_swmr_write() */ @@ -2491,7 +2491,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) FAIL_STACK_ERROR; /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* @@ -2501,7 +2501,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) */ /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -2523,7 +2523,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) /* Open the test file */ fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) exit(EXIT_FAILURE); @@ -2552,7 +2552,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) FAIL_STACK_ERROR; /* Check exit status of child process */ @@ -2574,13 +2574,13 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) */ /* Create 2 pipes */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; - if (HDpipe(in_pdf) < 0) + if (pipe(in_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -2745,7 +2745,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) FAIL_STACK_ERROR; /* Check exit status of child process */ @@ -2768,11 +2768,11 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) * will fail with H5Fstart_swmr_write() */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -2793,7 +2793,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) { fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) exit(EXIT_FAILURE); @@ -2822,7 +2822,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) FAIL_STACK_ERROR; /* Check exit status of child process */ @@ -2844,11 +2844,11 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -2869,7 +2869,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) { fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) exit(EXIT_FAILURE); @@ -2902,7 +2902,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) FAIL_STACK_ERROR; /* Check exit status of child process */ @@ -2924,11 +2924,11 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -2949,7 +2949,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) { fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) exit(EXIT_FAILURE); @@ -2982,7 +2982,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) FAIL_STACK_ERROR; /* Check exit status of child process */ @@ -3012,7 +3012,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; @@ -3177,7 +3177,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_start_swmr_write_stress_ohdr() */ @@ -3287,7 +3287,7 @@ error: H5Pclose(vds_dapl1); H5Pclose(vds_dapl2); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* tssw_persist_dapl_verify() */ @@ -3545,7 +3545,7 @@ error: H5Dclose(vdsid2); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_start_swmr_write_persist_dapl() */ @@ -3608,7 +3608,7 @@ test_object_flush_cb(hid_t in_fapl) { ret = H5Pset_object_flush_cb(fapl, NULL, &flush_ct); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -3812,7 +3812,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_object_flush_cb() */ @@ -3912,7 +3912,7 @@ test_append_flush_generic(void) { ret = H5Pset_append_flush(dapl, 0, NULL, NULL, &count); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -3921,7 +3921,7 @@ test_append_flush_generic(void) { ret = H5Pset_append_flush(dapl, H5S_MAX_RANK + 1, NULL, NULL, &count); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -3930,7 +3930,7 @@ test_append_flush_generic(void) { ret = H5Pset_append_flush(dapl, 2, NULL, NULL, &count); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -3943,7 +3943,7 @@ test_append_flush_generic(void) { ret = H5Pset_append_flush(dapl, 2, boundary, NULL, &count); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -3954,7 +3954,7 @@ test_append_flush_generic(void) { ret = H5Pset_append_flush(dapl, 2, boundary, append_cb, &count); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -3965,7 +3965,7 @@ test_append_flush_generic(void) { ret = H5Pset_append_flush(dapl, 2, boundary, append_cb, &count); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) TEST_ERROR; @@ -4011,7 +4011,7 @@ error: { H5Pclose(dapl); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_append_flush_generic() */ @@ -4132,7 +4132,7 @@ test_append_flush_dataset_chunked(hid_t in_fapl) { did2 = H5Dcreate2(fid, "dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl); } - H5E_END_TRY; + H5E_END_TRY if (did2 >= 0) TEST_ERROR; @@ -4146,7 +4146,7 @@ test_append_flush_dataset_chunked(hid_t in_fapl) { did2 = H5Dcreate2(fid, "dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl); } - H5E_END_TRY; + H5E_END_TRY if (did2 >= 0) TEST_ERROR; @@ -4161,7 +4161,7 @@ test_append_flush_dataset_chunked(hid_t in_fapl) { did2 = H5Dopen2(fid, "dataset2", dapl); } - H5E_END_TRY; + H5E_END_TRY if (did2 >= 0) TEST_ERROR; @@ -4240,7 +4240,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_append_flush_dataset_chunked() */ @@ -4447,7 +4447,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_append_flush_dataset_fixed() */ @@ -4689,7 +4689,7 @@ error: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_append_flush_dataset_multiple() */ @@ -4803,7 +4803,7 @@ test_file_lock_same(hid_t in_fapl) { fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid2 >= 0) TEST_ERROR; @@ -4857,7 +4857,7 @@ error: H5Fclose(fid); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_file_lock_same() */ @@ -4911,7 +4911,7 @@ test_file_lock_swmr_same(hid_t in_fapl) { fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_READ, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) TEST_ERROR; @@ -4922,7 +4922,7 @@ test_file_lock_swmr_same(hid_t in_fapl) { fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) TEST_ERROR; @@ -4933,7 +4933,7 @@ test_file_lock_swmr_same(hid_t in_fapl) { fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) TEST_ERROR; @@ -4944,7 +4944,7 @@ test_file_lock_swmr_same(hid_t in_fapl) { fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) TEST_ERROR; @@ -4962,7 +4962,7 @@ test_file_lock_swmr_same(hid_t in_fapl) { fid2 = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid2 >= 0) TEST_ERROR; @@ -5058,7 +5058,7 @@ test_file_lock_swmr_same(hid_t in_fapl) { fid2 = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (fid2 >= 0) TEST_ERROR; @@ -5076,7 +5076,7 @@ test_file_lock_swmr_same(hid_t in_fapl) { fid2 = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid2 >= 0) TEST_ERROR; @@ -5126,7 +5126,7 @@ test_file_lock_swmr_same(hid_t in_fapl) { fid2 = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid2 >= 0) TEST_ERROR; @@ -5144,7 +5144,7 @@ test_file_lock_swmr_same(hid_t in_fapl) { fid2 = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid2 >= 0) TEST_ERROR; @@ -5167,7 +5167,7 @@ error: H5Fclose(fid); H5Fclose(fid2); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_file_lock_swmr_same() */ @@ -5232,11 +5232,11 @@ test_file_lock_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -5258,7 +5258,7 @@ test_file_lock_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -5289,7 +5289,7 @@ test_file_lock_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -5309,11 +5309,11 @@ test_file_lock_concur(hid_t in_fapl) * Case 2: 1) RDWR 2) RDONLY : should fail */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -5335,7 +5335,7 @@ test_file_lock_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -5366,7 +5366,7 @@ test_file_lock_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -5387,11 +5387,11 @@ test_file_lock_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -5413,7 +5413,7 @@ test_file_lock_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -5444,7 +5444,7 @@ test_file_lock_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -5465,11 +5465,11 @@ test_file_lock_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -5491,7 +5491,7 @@ test_file_lock_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should succeed */ if (child_fid >= 0) { @@ -5527,7 +5527,7 @@ test_file_lock_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -5557,7 +5557,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; @@ -5629,11 +5629,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -5655,7 +5655,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -5686,7 +5686,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -5707,11 +5707,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -5733,7 +5733,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -5764,7 +5764,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -5785,11 +5785,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -5811,7 +5811,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -5842,7 +5842,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -5862,11 +5862,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) * Case 4: 1) RDWR|SWMR_WRITE 2) RDWR|SWMR_WRITE : should fail */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -5888,7 +5888,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -5919,7 +5919,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -5939,11 +5939,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) * Case 5: 1) RDWR|SWMR_WRITE 2) RDONLY|SWMR_READ : should succeed */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -5965,7 +5965,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should succeed */ if (child_fid >= 0) { @@ -5999,7 +5999,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -6019,11 +6019,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) * Case 6: 1) RDWR|SWMR_WRITE 2) RDONLY : should fail */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -6045,7 +6045,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -6076,7 +6076,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -6097,11 +6097,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -6123,7 +6123,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -6154,7 +6154,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -6175,11 +6175,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -6201,7 +6201,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -6232,7 +6232,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -6253,11 +6253,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -6279,7 +6279,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should succeed */ if (child_fid >= 0) { @@ -6313,7 +6313,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -6334,11 +6334,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -6391,7 +6391,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -6412,11 +6412,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -6438,7 +6438,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should fail */ if (child_fid == FAIL) @@ -6469,7 +6469,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -6490,11 +6490,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -6516,7 +6516,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) { child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); } - H5E_END_TRY; + H5E_END_TRY /* Should succeed */ if (child_fid >= 0) { @@ -6550,7 +6550,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) FAIL_STACK_ERROR; /* Check if child terminated normally */ @@ -6580,7 +6580,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; @@ -6669,11 +6669,11 @@ test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_overri */ /* Create 1 pipe */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) TEST_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) TEST_ERROR; if (childpid == 0) { @@ -6699,7 +6699,7 @@ test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_overri child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); ret = H5Fclose(child_fid); } - H5E_END_TRY; + H5E_END_TRY /* Close the pipe */ if (HDclose(out_pdf[0]) < 0) @@ -6729,7 +6729,7 @@ test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_overri TEST_ERROR; /* Wait for child process to complete */ - if (HDwaitpid(childpid, &child_status, child_wait_option) < 0) + if (waitpid(childpid, &child_status, child_wait_option) < 0) TEST_ERROR; /* Check exit status of the child */ @@ -6772,7 +6772,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; @@ -6826,7 +6826,7 @@ test_different_lock_flags(hid_t in_fapl) { fid3 = H5Fopen(filename, H5F_ACC_RDWR, fapl_id); } - H5E_END_TRY; + H5E_END_TRY if (H5I_INVALID_HID != fid3) FAIL_PUTS_ERROR("Should not have been able to open a file with different locking flags"); @@ -6852,7 +6852,7 @@ error: H5Fclose(fid2); H5Fclose(fid3); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_different_lock_flags() */ @@ -6897,7 +6897,7 @@ test_swmr_vfd_flag(void) { fid = H5Fcreate(filename, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE, H5P_DEFAULT, bad_fapl); } - H5E_END_TRY; + H5E_END_TRY if (fid >= 0) TEST_ERROR; @@ -6917,7 +6917,7 @@ error: H5Pclose(bad_fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_swmr_vfd_flag() */ @@ -7037,7 +7037,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* test_bug_refresh() */ @@ -7166,13 +7166,13 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format) FAIL_STACK_ERROR; /* Create 2 pipes */ - if (HDpipe(out_pdf) < 0) + if (pipe(out_pdf) < 0) FAIL_STACK_ERROR; - if (HDpipe(in_pdf) < 0) + if (pipe(in_pdf) < 0) FAIL_STACK_ERROR; /* Fork child process */ - if ((childpid = HDfork()) < 0) + if ((childpid = fork()) < 0) FAIL_STACK_ERROR; if (childpid == 0) { /* Child process */ @@ -7347,7 +7347,7 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format) FAIL_STACK_ERROR; /* Wait for child process to complete */ - if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) FAIL_STACK_ERROR; /* Check exit status of child process */ @@ -7382,7 +7382,7 @@ error: H5Pclose(fapl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; @@ -7714,7 +7714,7 @@ error: H5Fclose(fid2); H5Fclose(fid3); } - H5E_END_TRY; + H5E_END_TRY return 1; @@ -7728,12 +7728,15 @@ error: int main(void) { - int nerrors = 0; /* The # of errors */ - hid_t fapl = -1; /* File access property list ID */ - char *driver = NULL; /* VFD string (from env variable) */ - char *lock_env_var = NULL; /* file locking env var pointer */ - hbool_t use_file_locking; /* read from env var */ - hbool_t file_locking_enabled = FALSE; /* Checks if the file system supports locks */ + int nerrors = 0; /* The # of errors */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + char *driver = NULL; /* VFD string (from env variable) */ + char *lock_env_var = NULL; /* file locking env var pointer */ + hbool_t use_file_locking; /* read from env var */ + hbool_t file_locking_enabled = FALSE; /* Checks if the file system supports locks */ + + /* Testing setup */ + h5_reset(); /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. @@ -7742,7 +7745,7 @@ main(void) if (!H5FD__supports_swmr_test(driver)) { printf("This VFD does not support SWMR I/O\n"); return EXIT_SUCCESS; - } /* end if */ + } /* Check the environment variable that determines if we care * about file locking. File locking should be used unless explicitly @@ -7761,9 +7764,6 @@ main(void) return EXIT_FAILURE; } - /* Set up */ - h5_reset(); - /* Get file access property list */ fapl = h5_fileaccess(); @@ -7822,7 +7822,7 @@ main(void) */ nerrors += test_file_lock_swmr_same(fapl); nerrors += test_file_lock_swmr_concur(fapl); - } /* end if */ + } /* Tests SWMR VFD compatibility flag. * Only needs to run when the VFD is the default (sec2). diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index 1b21a70..8fd907a 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -303,7 +303,7 @@ main(int argc, char *argv[]) switch (argv[u][1]) { /* # of records to write between flushing file */ case 'f': - flush_count = HDatol(argv[u + 1]); + flush_count = atol(argv[u + 1]); if (flush_count < 0) usage(); u += 2; @@ -333,7 +333,7 @@ main(int argc, char *argv[]) } /* end if */ else { /* Get the number of records to append */ - nops = HDatol(argv[u]); + nops = atol(argv[u]); if (nops <= 0) usage(); diff --git a/test/swmr_reader.c b/test/swmr_reader.c index 9e4e322..08c6307 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -455,7 +455,7 @@ main(int argc, char *argv[]) } /* end if */ else { /* Get the number of records to append */ - nseconds = HDatol(argv[u]); + nseconds = atol(argv[u]); if (nseconds <= 0) usage(); diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 5a4eccd..9a39356 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -438,7 +438,7 @@ main(int argc, char *argv[]) } /* end if */ else { /* Get the number of records to append */ - nseconds = HDatol(argv[u]); + nseconds = atol(argv[u]); if (nseconds <= 0) usage(); diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index 9e29d71..f0d531d 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -238,7 +238,7 @@ main(int argc, char *argv[]) switch (argv[u][1]) { /* # of records to write between flushing file */ case 'f': - flush_count = HDatol(argv[u + 1]); + flush_count = atol(argv[u + 1]); if (flush_count < 0) usage(); u += 2; @@ -271,7 +271,7 @@ main(int argc, char *argv[]) } /* end if */ else { /* Get the number of records to append */ - nshrinks = HDatol(argv[u]); + nshrinks = atol(argv[u]); if (nshrinks <= 0) usage(); diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index 0205db3..5a2f464 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -385,7 +385,7 @@ main(int argc, char *argv[]) } /* end if */ else { /* Get the number of records to read */ - nrecords = HDatol(argv[u]); + nrecords = atol(argv[u]); if (nrecords <= 0) usage(); diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index 79889b1..edef5c6 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -335,7 +335,7 @@ main(int argc, char *argv[]) switch (argv[u][1]) { /* # of records to write between flushing file */ case 'f': - flush_count = HDatol(argv[u + 1]); + flush_count = atol(argv[u + 1]); if (flush_count < 0) usage(); u += 2; @@ -354,7 +354,7 @@ main(int argc, char *argv[]) } /* end if */ else { /* Get the number of records to append */ - nrecords = HDatol(argv[u]); + nrecords = atol(argv[u]); if (nrecords <= 0) usage(); diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index 78953d8..2bea7d4 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -391,7 +391,7 @@ main(int argc, char *argv[]) /* # of records to write between flushing file */ case 'f': - flush_count = HDatol(argv[u + 1]); + flush_count = atol(argv[u + 1]); if (flush_count < 0) usage(); u += 2; @@ -421,7 +421,7 @@ main(int argc, char *argv[]) } /* end if */ else { /* Get the number of records to append */ - nrecords = HDatol(argv[u]); + nrecords = atol(argv[u]); if (nrecords <= 0) usage(); diff --git a/test/swmr_writer.c b/test/swmr_writer.c index 2fd559d..8397c43 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -297,7 +297,7 @@ main(int argc, char *argv[]) switch (argv[u][1]) { /* # of records to write between flushing file */ case 'f': - flush_count = HDatol(argv[u + 1]); + flush_count = atol(argv[u + 1]); if (flush_count < 0) usage(); u += 2; @@ -330,7 +330,7 @@ main(int argc, char *argv[]) } /* end if */ else { /* Get the number of records to append */ - nrecords = HDatol(argv[u]); + nrecords = atol(argv[u]); if (nrecords <= 0) usage(); diff --git a/test/unlink.c b/test/unlink.c index fd9c2bd..df5b5b3 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -22,9 +22,9 @@ #include "h5test.h" #include "H5Gpkg.h" /* Groups */ -const char *FILENAME[] = {"unlink", "new_move_a", "new_move_b", "lunlink", - "filespace", "slashes", "resurrect_set", "resurrect_type", - "resurrect_group", "unlink_chunked", "full_group", NULL}; +static const char *FILENAME[] = {"unlink", "new_move_a", "new_move_b", "lunlink", + "filespace", "slashes", "resurrect_set", "resurrect_type", + "resurrect_group", "unlink_chunked", "full_group", NULL}; /* Macros for test_create_unlink() & test_filespace */ #define GROUPNAME "group" @@ -112,7 +112,7 @@ test_one(hid_t file) { status = H5Ldelete(grp, ".", H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) FAIL_PUTS_ERROR(" Unlinking object w/o a name should have failed."); if (H5Gclose(grp) < 0) @@ -131,7 +131,7 @@ error: H5Gclose(work); H5Gclose(grp); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_one() */ @@ -235,7 +235,7 @@ error: H5Gclose(work); H5Gclose(grp); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -277,7 +277,7 @@ error: { H5Gclose(work); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_symlink() */ @@ -338,7 +338,7 @@ error: H5Gclose(foo); H5Gclose(inner); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_rename() */ @@ -392,7 +392,7 @@ test_new_move(hid_t fapl) FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Move a group across files. Should fail. */ H5E_BEGIN_TRY @@ -400,7 +400,7 @@ test_new_move(hid_t fapl) if (H5Lmove(grp_1, "group_move", file_b, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) != FAIL) TEST_ERROR; } - H5E_END_TRY; + H5E_END_TRY /* Move a group across groups in the same file. */ if (H5Lmove(grp_1, "group_move", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0) @@ -436,7 +436,7 @@ error: H5Fclose(file_a); H5Fclose(file_b); } - H5E_END_TRY; + H5E_END_TRY return 1; } @@ -1219,7 +1219,7 @@ test_filespace(hid_t fapl) { dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (dataset >= 0) { H5Dclose(dataset); TEST_ERROR; @@ -1261,7 +1261,7 @@ test_filespace(hid_t fapl) { group = H5Gcreate2(file, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (group >= 0) { H5Gclose(group); TEST_ERROR; @@ -1311,7 +1311,7 @@ test_filespace(hid_t fapl) { status = H5Tcommit2(file, TYPENAME, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (status >= 0) TEST_ERROR; if (H5Tclose(type) < 0) @@ -1366,7 +1366,7 @@ test_filespace(hid_t fapl) { attr = H5Acreate2(dataset, ATTRNAME, H5T_NATIVE_INT, attr_space, H5P_DEFAULT, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (attr >= 0) { H5Aclose(attr); TEST_ERROR; @@ -1748,7 +1748,7 @@ error: { H5Gclose(gids[n]); } - H5E_END_TRY; + H5E_END_TRY } /* end if */ free(gids); } /* end if */ @@ -1756,7 +1756,7 @@ error: { H5Gclose(rootid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_unlink_rightleaf() */ @@ -1835,7 +1835,7 @@ error: { H5Gclose(gids[n]); } - H5E_END_TRY; + H5E_END_TRY } /* end if */ free(gids); } /* end if */ @@ -1843,7 +1843,7 @@ error: { H5Gclose(rootid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_unlink_rightnode() */ @@ -2208,7 +2208,7 @@ error: { H5Gclose(gids[n]); } - H5E_END_TRY; + H5E_END_TRY } /* end if */ free(gids); } /* end if */ @@ -2216,7 +2216,7 @@ error: { H5Gclose(rootid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_unlink_middlenode() */ @@ -2297,7 +2297,7 @@ error: H5Dclose(d); H5Fclose(f); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_resurrect_dataset() */ @@ -2374,7 +2374,7 @@ error: H5Tclose(type); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_resurrect_datatype() */ @@ -2449,7 +2449,7 @@ error: H5Gclose(group); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_resurrect_group() */ @@ -2544,7 +2544,7 @@ error: H5Dclose(dset_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_unlink_chunked_dataset() */ @@ -2702,7 +2702,7 @@ error: H5Gclose(gid); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_full_group_compact() */ @@ -2877,7 +2877,7 @@ error: H5Pclose(gcpl); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_full_group_dense() */ diff --git a/test/unregister.c b/test/unregister.c index aca5f1f..d225881 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -16,7 +16,7 @@ #include "H5CXprivate.h" /* API Contexts */ -const char *FILENAME[] = {"unregister_filter_1", "unregister_filter_2", NULL}; +static const char *FILENAME[] = {"unregister_filter_1", "unregister_filter_2", NULL}; #define GROUP_NAME "test_group" #define DSET_NAME "test_dataset" @@ -33,7 +33,7 @@ static size_t do_nothing(unsigned int flags, size_t cd_nelmts, const unsigned in size_t *buf_size, void **buf); /* Dummy filter for test_unregister_filters only */ -const H5Z_class2_t H5Z_DUMMY[1] = {{ +static const H5Z_class2_t H5Z_DUMMY[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_DUMMY, /* Filter ID number */ 1, 1, /* Encoding and decoding enabled */ @@ -149,7 +149,7 @@ test_unregister_filters(hid_t fapl_id) { ret = H5Zunregister(H5Z_FILTER_DUMMY); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf(" Line %d: Should not be able to unregister filter\n", __LINE__); @@ -200,7 +200,7 @@ test_unregister_filters(hid_t fapl_id) { ret = H5Zunregister(H5Z_FILTER_DUMMY); } - H5E_END_TRY; + H5E_END_TRY if (ret >= 0) { H5_FAILED(); printf(" Line %d: Should not be able to unregister filter\n", __LINE__); @@ -255,7 +255,7 @@ error: H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); free(buf_data); diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 5b54e9b..4f64a66 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -167,7 +167,7 @@ main(int argc, char *argv[]) /* Fork process */ /* ============ */ if (UC_opts.launch == UC_READWRITE) { - if ((childpid = HDfork()) < 0) { + if ((childpid = fork()) < 0) { HDperror("fork"); Hgoto_error(1); } @@ -240,7 +240,7 @@ main(int argc, char *argv[]) /* If readwrite, collect exit code of child process */ /* ================================================ */ if (UC_opts.launch == UC_READWRITE) { - if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) { + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) { HDperror("waitpid"); Hgoto_error(1); } diff --git a/test/use_append_chunk_mirror.c b/test/use_append_chunk_mirror.c index 80ba2aa..0620c68 100644 --- a/test/use_append_chunk_mirror.c +++ b/test/use_append_chunk_mirror.c @@ -258,7 +258,7 @@ main(int argc, char *argv[]) /* Fork process */ /* ============ */ if (UC_opts.launch == UC_READWRITE) { - if ((childpid = HDfork()) < 0) { + if ((childpid = fork()) < 0) { HDperror("fork"); Hgoto_error(1); } @@ -353,7 +353,7 @@ main(int argc, char *argv[]) /* If readwrite, collect exit code of child process */ /* ================================================ */ if (UC_opts.launch == UC_READWRITE) { - if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) { + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) { HDperror("waitpid"); Hgoto_error(1); } diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c index e09e222..15f2f2a 100644 --- a/test/use_append_mchunks.c +++ b/test/use_append_mchunks.c @@ -161,7 +161,7 @@ main(int argc, char *argv[]) /* Fork process */ /* ============ */ if (UC_opts.launch == UC_READWRITE) { - if ((childpid = HDfork()) < 0) { + if ((childpid = fork()) < 0) { HDperror("fork"); Hgoto_error(1); } @@ -235,7 +235,7 @@ main(int argc, char *argv[]) /* If readwrite, collect exit code of child process */ /* ================================================ */ if (UC_opts.launch == UC_READWRITE) { - if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) { + if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) { HDperror("waitpid"); Hgoto_error(1); } diff --git a/test/use_common.c b/test/use_common.c index 68b7d00..e77ec77 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -94,7 +94,7 @@ parse_option(int argc, char *const argv[], options_t *opts) } /* end switch (reader/writer-only mode toggle) */ break; case 'n': /* number of planes to write/read */ - if ((opts->nplanes = HDstrtoul(optarg, NULL, 0)) <= 0) { + if ((opts->nplanes = strtoul(optarg, NULL, 0)) <= 0) { fprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg); usage(opts->progname); Hgoto_error(-1); @@ -110,7 +110,7 @@ parse_option(int argc, char *const argv[], options_t *opts) opts->use_swmr = (hbool_t)use_swmr; break; case 'y': /* Number of planes per chunk */ - if ((opts->chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) { + if ((opts->chunkplanes = strtoul(optarg, NULL, 0)) <= 0) { fprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg); usage(opts->progname); @@ -118,7 +118,7 @@ parse_option(int argc, char *const argv[], options_t *opts) } break; case 'z': /* size of chunk=(z,z) */ - if ((opts->chunksize = HDstrtoull(optarg, NULL, 0)) <= 0) { + if ((opts->chunksize = strtoull(optarg, NULL, 0)) <= 0) { fprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg); usage(opts->progname); Hgoto_error(-1); diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c index cf60e56..d11f71c 100644 --- a/test/use_disable_mdc_flushes.c +++ b/test/use_disable_mdc_flushes.c @@ -27,7 +27,7 @@ #include "H5Dpkg.h" /* Global Variable definitions */ -const char *progname_g = "use_disable_mdc_flushes"; /* program name */ +static const char *progname_g = "use_disable_mdc_flushes"; /* program name */ /* these two definitions must match each other */ #define UC_DATATYPE H5T_NATIVE_SHORT /* use case HDF5 data type */ @@ -40,14 +40,14 @@ const char *progname_g = "use_disable_mdc_flushes"; /* program name */ goto done; \ } -char *filename_g; -hsize_t nplanes_g; -int use_swmr_g; -int chunkplanes_g; -int chunksize_g; -hsize_t dims_g[UC_RANK]; -hsize_t max_dims_g[UC_RANK]; -hsize_t chunkdims_g[UC_RANK]; +static char *filename_g; +static hsize_t nplanes_g; +static int use_swmr_g; +static int chunkplanes_g; +static int chunksize_g; +static hsize_t dims_g[UC_RANK]; +static hsize_t max_dims_g[UC_RANK]; +static hsize_t chunkdims_g[UC_RANK]; static void usage(const char *prog); static int parse_option(int argc, char *const argv[]); diff --git a/test/vds.c b/test/vds.c index c3f1655..48cd522 100644 --- a/test/vds.c +++ b/test/vds.c @@ -26,9 +26,9 @@ typedef enum { TEST_API_NTESTS } test_api_config_t; -const char *FILENAME[] = {"vds_virt_0", "vds_virt_1", "vds_src_0", "vds_src_1", "vds%%_src", - "vds_dapl", "vds_virt_2", "vds_virt_3", "vds_src_2", "vds_src_3", - "vds%%_src2", "vds_dapl2", NULL}; +static const char *FILENAME[] = {"vds_virt_0", "vds_virt_1", "vds_src_0", "vds_src_1", "vds%%_src", + "vds_dapl", "vds_virt_2", "vds_virt_3", "vds_src_2", "vds_src_3", + "vds%%_src2", "vds_dapl2", NULL}; /* Define to enable verbose test output */ /* #define VDS_TEST_VERBOSE 1 */ @@ -507,7 +507,7 @@ error: H5Fclose(file); H5Dclose(dset); } - H5E_END_TRY; + H5E_END_TRY if (plist_buf) free(plist_buf); @@ -1161,7 +1161,7 @@ error: H5Pclose(dcpl); H5Pclose(ex_dcpl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_api() */ @@ -1431,7 +1431,7 @@ error: H5Pclose(dapl); H5Pclose(dcpl); } - H5E_END_TRY; + H5E_END_TRY if (HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) TEST_ERROR_SUPPRESSED; @@ -4364,7 +4364,7 @@ error: H5Sclose(memspace); H5Pclose(dcpl); } - H5E_END_TRY; + H5E_END_TRY free(srcfilename); free(srcfilename_map); @@ -7378,7 +7378,7 @@ error: H5Pclose(srcdcpl); H5Pclose(dapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_unlim() */ @@ -11084,7 +11084,7 @@ error: H5Pclose(dcpl); H5Pclose(dapl); } - H5E_END_TRY; + H5E_END_TRY free(srcfilename); free(srcfilename_map); @@ -12121,7 +12121,7 @@ error: H5Pclose(dcpl); H5Pclose(srcdcpl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_all() */ @@ -12273,7 +12273,7 @@ error: H5Sclose(src_sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_dapl_values() */ diff --git a/test/vds_env.c b/test/vds_env.c index a48a872..256455e 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -15,7 +15,7 @@ */ #include "h5test.h" -const char *FILENAME[] = {"vds_env_virt_0", "vds_env_virt_3", "vds_env_src_2", "vds_env%%_src2", NULL}; +static const char *FILENAME[] = {"vds_env_virt_0", "vds_env_virt_3", "vds_env_src_2", "vds_env%%_src2", NULL}; /* I/O test config flags */ #define TEST_IO_CLOSE_SRC 0x01u @@ -304,7 +304,7 @@ error: H5Pclose(dapl); H5Pclose(dcpl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* end test_vds_prefix2 */ diff --git a/test/vfd.c b/test/vfd.c index d542b9b..06a6ed4 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -44,23 +44,23 @@ #define DSET2_DIM 4 #endif /* H5_HAVE_DIRECT */ -const char *FILENAME[] = {"sec2_file", /*0*/ - "core_file", /*1*/ - "family_file", /*2*/ - "new_family_v16", /*3*/ - "multi_file", /*4*/ - "direct_file", /*5*/ - "log_file", /*6*/ - "stdio_file", /*7*/ - "windows_file", /*8*/ - "new_multi_file_v16", /*9*/ - "ro_s3_file", /*10*/ - "splitter_rw_file", /*11*/ - "splitter_wo_file", /*12*/ - "splitter.log", /*13*/ - "ctl_file", /*14*/ - "ctl_splitter_wo_file", /*15*/ - NULL}; +static const char *FILENAME[] = {"sec2_file", /*0*/ + "core_file", /*1*/ + "family_file", /*2*/ + "new_family_v16", /*3*/ + "multi_file", /*4*/ + "direct_file", /*5*/ + "log_file", /*6*/ + "stdio_file", /*7*/ + "windows_file", /*8*/ + "new_multi_file_v16", /*9*/ + "ro_s3_file", /*10*/ + "splitter_rw_file", /*11*/ + "splitter_wo_file", /*12*/ + "splitter.log", /*13*/ + "ctl_file", /*14*/ + "ctl_splitter_wo_file", /*15*/ + NULL}; #define LOG_FILENAME "log_vfd_out.log" @@ -75,12 +75,14 @@ const char *FILENAME[] = {"sec2_file", /*0*/ */ static int __k; #define HEXPRINT(size, buf) \ - for (__k = 0; __k < (size); __k++) { \ - if (__k % 16 == 0) { \ - printf("\n%04x", __k); \ + do { \ + for (__k = 0; __k < (size); __k++) { \ + if (__k % 16 == 0) { \ + printf("\n%04x", __k); \ + } \ + printf((__k % 4 == 0) ? " %02X" : " %02X", (unsigned char)(buf)[__k]); \ } \ - printf((__k % 4 == 0) ? " %02X" : " %02X", (unsigned char)(buf)[__k]); \ - } /* end #define HEXPRINT() */ + } while (0) /* end #define HEXPRINT() */ /* Macro SET_SIZE() * @@ -284,7 +286,7 @@ error: H5Pclose(fapl_id_out); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_sec2() */ @@ -667,7 +669,7 @@ error: H5Pclose(fapl_id); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (data_w) free(data_w); @@ -735,7 +737,7 @@ test_direct(void) { file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); } - H5E_END_TRY; + H5E_END_TRY if (file < 0) { H5Pclose(fapl); SKIPPED(); @@ -774,10 +776,10 @@ test_direct(void) /* Allocate aligned memory for data set 1. For data set 1, everything is aligned including * memory address, size of data, and file address. */ - if (0 != HDposix_memalign(&proto_points, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + if (0 != posix_memalign(&proto_points, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; points = proto_points; - if (0 != HDposix_memalign(&proto_check, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + if (0 != posix_memalign(&proto_check, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; check = proto_check; @@ -891,7 +893,7 @@ error: H5Dclose(dset2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY if (proto_points) free(proto_points); @@ -935,7 +937,7 @@ test_family_opens(char *fname, hid_t fa_pl) { file = H5Fopen(first_name, H5F_ACC_RDWR, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (file >= 0) TEST_ERROR; @@ -944,7 +946,7 @@ test_family_opens(char *fname, hid_t fa_pl) { file = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (file >= 0) TEST_ERROR; @@ -956,7 +958,7 @@ test_family_opens(char *fname, hid_t fa_pl) { file = H5Fopen(fname, H5F_ACC_RDWR, fa_pl); } - H5E_END_TRY; + H5E_END_TRY if (file >= 0) TEST_ERROR; @@ -975,7 +977,7 @@ test_family_opens(char *fname, hid_t fa_pl) { file = H5Fopen(wrong_name, H5F_ACC_RDWR, fa_pl); } - H5E_END_TRY; + H5E_END_TRY if (file >= 0) TEST_ERROR; @@ -1175,7 +1177,7 @@ error: H5Pclose(fapl2); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY free(buf); free(buf_data); @@ -1286,7 +1288,7 @@ error: H5Fclose(file); H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_family_compat() */ @@ -1400,7 +1402,7 @@ error: H5Pclose(fapl_id); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY free(buf); free(buf_data); @@ -1440,7 +1442,7 @@ test_multi_opens(char *fname) { fid = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY return (fid >= 0 ? FAIL : SUCCEED); } /* end test_multi_opens() */ @@ -1686,7 +1688,7 @@ error: H5Fclose(file); H5Aclose(attr); } - H5E_END_TRY; + H5E_END_TRY free(buf); free(buf_data); @@ -1875,7 +1877,7 @@ error: H5Pclose(fapl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY free(buf); free(buf_data); @@ -1918,7 +1920,7 @@ test_log(void) { ret = H5Pset_fapl_log(H5I_INVALID_HID, LOG_FILENAME, 0, 0); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) TEST_ERROR; @@ -2002,7 +2004,7 @@ error: H5Pclose(fapl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2106,7 +2108,7 @@ error: H5Pclose(fapl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2226,7 +2228,7 @@ error: H5Pclose(fapl); H5Fclose(file); } - H5E_END_TRY; + H5E_END_TRY return -1; #endif /* H5_HAVE_WINDOWS */ @@ -2321,7 +2323,7 @@ error: H5Pclose(fapl_id_out); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; #endif /* H5_HAVE_ROS3_VFD */ } /* end test_ros3() */ @@ -2336,7 +2338,7 @@ error: * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #define SPLITTER_TEST_FAULT(mesg) \ - { \ + do { \ H5_FAILED(); \ AT(); \ fprintf(stderr, mesg); \ @@ -2344,7 +2346,7 @@ error: fflush(stderr); \ ret_value = -1; \ goto done; \ - } + } while (0) /*------------------------------------------------------------------------- * Function: compare_splitter_config_info @@ -2570,11 +2572,11 @@ done: H5Pclose(fapl_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY } if (logfile != NULL) - HDfclose(logfile); + fclose(logfile); free(vfd_config); free(filename_rw); @@ -2624,7 +2626,7 @@ driver_is_splitter_compatible(hid_t fapl_id) { ret = H5Pset_fapl_splitter(split_fapl_id, vfd_config); } - H5E_END_TRY; + H5E_END_TRY if (SUCCEED == ret) { ret_value = -1; } @@ -2643,7 +2645,7 @@ error: { H5Pclose(split_fapl_id); } - H5E_END_TRY; + H5E_END_TRY free(vfd_config); @@ -2707,7 +2709,7 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id) { file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); } - H5E_END_TRY; + H5E_END_TRY if (file_id >= 0) { SPLITTER_TEST_FAULT("R/O open on nonexistent files unexpectedly successful\n"); } @@ -2723,7 +2725,7 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id) { file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); } - H5E_END_TRY; + H5E_END_TRY if (file_id >= 0) { SPLITTER_TEST_FAULT("R/O open with extant W/O file unexpectedly successful\n"); } @@ -2740,7 +2742,7 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id) { file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); } - H5E_END_TRY; + H5E_END_TRY if (file_id >= 0) { SPLITTER_TEST_FAULT("R/O open with extant R/W file unexpectedly successful\n"); } @@ -2778,7 +2780,7 @@ done: H5Pclose(fapl_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY } free(vfd_config); @@ -2917,7 +2919,7 @@ done: H5Sclose(space_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY } /* end if error */ return ret_value; } /* end splitter_create_single_file_at() */ @@ -2978,7 +2980,7 @@ done: { H5Dclose(dset_id); } - H5E_END_TRY; + H5E_END_TRY } return ret_value; } /* end splitter_compare_expected_data() */ @@ -3079,7 +3081,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); } - H5E_END_TRY; + H5E_END_TRY if (file_id != H5I_INVALID_HID) { SPLITTER_TEST_FAULT("open with both nonexistent files unexpectedly succeeded\n"); } @@ -3103,7 +3105,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); } - H5E_END_TRY; + H5E_END_TRY if (file_id != H5I_INVALID_HID) { SPLITTER_TEST_FAULT("open with nonexistent R/W file unexpectedly succeeded\n"); } @@ -3131,7 +3133,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); } - H5E_END_TRY; + H5E_END_TRY if (file_id != H5I_INVALID_HID) { SPLITTER_TEST_FAULT("open with nonexistent W/O unexpectedly succeeded\n"); } @@ -3269,7 +3271,7 @@ done: H5Pclose(fapl_id); H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY } free(vfd_config); @@ -3300,7 +3302,7 @@ file_exists(const char *filename, hid_t fapl_id) { file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id); } - H5E_END_TRY; + H5E_END_TRY if (file_id != H5I_INVALID_HID) { ret_value = 1; if (H5Fclose(file_id) < 0) { @@ -3315,7 +3317,7 @@ error: { H5Fclose(file_id); } - H5E_END_TRY; + H5E_END_TRY return ret_value; } /* end file_exists() */ @@ -3648,7 +3650,7 @@ run_ctl_test(uint64_t op_code, uint64_t flags, ctl_test_opc_type opc_type, hid_t { ctl_result = H5FDctl(file_drv_ptr, op_code, flags, NULL, NULL); } - H5E_END_TRY; + H5E_END_TRY } else ctl_result = H5FDctl(file_drv_ptr, op_code, flags, NULL, NULL); @@ -3675,7 +3677,7 @@ error: { H5FDclose(file_drv_ptr); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -3974,7 +3976,7 @@ error: H5Pclose(sub_fapl_id); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -4877,7 +4879,7 @@ error: H5Pclose(fapl_id); H5FDclose(lf); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_vector_io() */ @@ -4889,10 +4891,6 @@ error: * * Return: Success: TRUE * Failure: FALSE - * - * Programmer: Neil Fortner - * 7/1/21 - * *------------------------------------------------------------------------- */ /* Array dimensions, used for all selection I/O tests. Currently both must be @@ -4904,23 +4902,32 @@ static herr_t test_selection_io_write(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t mem_spaces[], hid_t file_spaces[], haddr_t offsets[], size_t element_sizes[], int *wbufs[]) { - int i; - int j; + const void **bufs; /* Avoids cast/const warnings */ + int i; + int j; + + if (NULL == (bufs = calloc(count, sizeof(void *)))) + TEST_ERROR; /* Update write buffer */ - for (i = 0; i < (int)count; i++) + for (i = 0; i < (int)count; i++) { if (wbufs[i] && (i == 0 || wbufs[i] != wbufs[i - 1])) for (j = 0; j < SEL_IO_DIM0 * SEL_IO_DIM1; j++) wbufs[i][j] += 2 * SEL_IO_DIM0 * SEL_IO_DIM1; + bufs[i] = wbufs[i]; + } /* Issue write call */ if (H5FDwrite_selection(lf, type, H5P_DEFAULT, count, mem_spaces, file_spaces, offsets, element_sizes, - (const void **)wbufs) < 0) + bufs) < 0) TEST_ERROR; + free(bufs); + return 0; error: + free(bufs); return -1; } /* end test_selection_io_write() */ @@ -5847,7 +5854,7 @@ error: H5Sclose(file_spaces[i]); } } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end test_selection_io() */ diff --git a/test/vfd_plugin.c b/test/vfd_plugin.c index 2b7ed38..28aa769 100644 --- a/test/vfd_plugin.c +++ b/test/vfd_plugin.c @@ -82,7 +82,7 @@ error: { H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -149,7 +149,7 @@ error: { H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -261,7 +261,7 @@ error: { H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -322,7 +322,7 @@ error: { H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } diff --git a/test/vol.c b/test/vol.c index b2b26da..d571e50 100644 --- a/test/vol.c +++ b/test/vol.c @@ -28,7 +28,7 @@ #include "H5VLpkg.h" /* Virtual Object Layer */ /* Filename */ -const char *FILENAME[] = {"vol_test_file", NULL}; +static const char *FILENAME[] = {"vol_test_file", NULL}; #define NATIVE_VOL_TEST_GROUP_NAME "test_group" #define NATIVE_VOL_TEST_DATASET_NAME "test_dataset" @@ -708,7 +708,7 @@ test_vol_registration(void) { vol_id = H5VLregister_connector(&fake_vol_g, lapl_id); } - H5E_END_TRY; + H5E_END_TRY if (H5I_INVALID_HID != vol_id) FAIL_PUTS_ERROR("should not be able to register a connector with an incorrect property list"); if (H5Pclose(lapl_id) < 0) @@ -723,7 +723,7 @@ test_vol_registration(void) { vol_id = H5VLregister_connector(bad_fake_vol_class, H5P_DEFAULT); } - H5E_END_TRY; + H5E_END_TRY if (H5I_INVALID_HID != vol_id) FAIL_PUTS_ERROR("should not be able to register a connector with an incompatible version #"); free(bad_fake_vol_class); @@ -790,7 +790,7 @@ test_vol_registration(void) { ret = H5VLunregister_connector(native_id); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to unregister the native VOL connector"); @@ -804,7 +804,7 @@ error: H5Pclose(lapl_id); H5Pclose(vipl_id); } - H5E_END_TRY; + H5E_END_TRY if (bad_fake_vol_class) free(bad_fake_vol_class); @@ -1030,7 +1030,7 @@ error: H5Pclose(fapl_id2); H5Pclose(fcpl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -1137,7 +1137,7 @@ error: H5Pclose(fapl_id); H5Pclose(gcpl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -1325,7 +1325,7 @@ error: H5Pclose(dapl_id); H5Pclose(dcpl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -1438,7 +1438,7 @@ error: H5Aclose(aid); H5Aclose(aid_name); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -1518,7 +1518,7 @@ error: H5Pclose(fapl_id); H5Gclose(gid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -1597,7 +1597,7 @@ error: H5Fclose(gid); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -1694,7 +1694,7 @@ error: H5Tclose(tid); H5Tclose(tid_anon); } - H5E_END_TRY; + H5E_END_TRY return FAIL; @@ -1797,7 +1797,7 @@ exercise_reg_opt_oper(hid_t fake_vol_id, hid_t reg_opt_vol_id, H5VL_subclass_t s ret = (*reg_opt_op.obj_op)(__FILE__, __func__, __LINE__, obj_id, &vol_cb_args, H5P_DEFAULT, H5ES_NONE); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to perform an optional operation with a NULL callback"); if ((-1) != fake_obj) @@ -1956,7 +1956,7 @@ test_register_opt_operation(void) { ret = H5VLregister_opt_operation(H5VL_SUBCLS_NONE, "fail", &op_val); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'NONE' VOL subclass"); if ((-1) != op_val) @@ -1965,7 +1965,7 @@ test_register_opt_operation(void) { ret = H5VLregister_opt_operation(H5VL_SUBCLS_INFO, "fail2", &op_val); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'INFO' VOL subclass"); if ((-1) != op_val) @@ -1974,7 +1974,7 @@ test_register_opt_operation(void) { ret = H5VLregister_opt_operation(H5VL_SUBCLS_WRAP, "fail3", &op_val); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'WRAP' VOL subclass"); if ((-1) != op_val) @@ -1983,7 +1983,7 @@ test_register_opt_operation(void) { ret = H5VLregister_opt_operation(H5VL_SUBCLS_BLOB, "fail4", &op_val); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'BLOB' VOL subclass"); if ((-1) != op_val) @@ -1992,7 +1992,7 @@ test_register_opt_operation(void) { ret = H5VLregister_opt_operation(H5VL_SUBCLS_TOKEN, "fail5", &op_val); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'TOKEN' VOL subclass"); if ((-1) != op_val) @@ -2003,7 +2003,7 @@ test_register_opt_operation(void) { ret = H5VLregister_opt_operation(H5VL_SUBCLS_FILE, "fail6", NULL); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to register an optional operation with a NULL 'op_val'"); @@ -2012,7 +2012,7 @@ test_register_opt_operation(void) { ret = H5VLfind_opt_operation(H5VL_SUBCLS_DATASET, "fail", &op_val); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to find a non-existent optional operation"); @@ -2021,7 +2021,7 @@ test_register_opt_operation(void) { ret = H5VLunregister_opt_operation(H5VL_SUBCLS_DATASET, "fail"); } - H5E_END_TRY; + H5E_END_TRY if (FAIL != ret) FAIL_PUTS_ERROR("should not be able to unregister a non-existent optional operation"); @@ -2054,7 +2054,7 @@ error: H5VLunregister_connector(fake_vol_id); H5VLunregister_connector(reg_opt_vol_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_register_opt_operation() */ @@ -2208,7 +2208,7 @@ error: H5Pclose(fapl_id); H5VLunregister_connector(vol_id); } - H5E_END_TRY; + H5E_END_TRY free(conn_env_str); return FAIL; @@ -2313,7 +2313,7 @@ error: H5VLunregister_connector(vol_id); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_vol_cap_flags() */ @@ -2383,7 +2383,7 @@ error: H5Fclose(file_id); H5Pclose(fapl_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_get_vol_name() */ diff --git a/test/vol_plugin.c b/test/vol_plugin.c index b5c0756..acf4dfc 100644 --- a/test/vol_plugin.c +++ b/test/vol_plugin.c @@ -75,7 +75,7 @@ error: { H5VLunregister_connector(vol_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_registration_by_value() */ @@ -132,7 +132,7 @@ error: { H5VLunregister_connector(vol_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_registration_by_name() */ @@ -237,7 +237,7 @@ error: for (i = 0; i < N_REGISTRATIONS; i++) H5VLunregister_connector(vol_ids[i]); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_multiple_registration() */ @@ -313,7 +313,7 @@ error: H5VLclose(vol_id_out); H5VLunregister_connector(vol_id); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } /* end test_getters() */ -- cgit v0.12