diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2021-04-01 20:14:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-01 20:14:21 (GMT) |
commit | 87d18137ceed7eae1ca7009dda6f4cf2841ff195 (patch) | |
tree | 291983f4bc5f9230bf53564e8555272319d382aa /test/vfd.c | |
parent | df75d35cc5295b03dc305ca7e5495fece5737d30 (diff) | |
download | hdf5-87d18137ceed7eae1ca7009dda6f4cf2841ff195.zip hdf5-87d18137ceed7eae1ca7009dda6f4cf2841ff195.tar.gz hdf5-87d18137ceed7eae1ca7009dda6f4cf2841ff195.tar.bz2 |
Hdf5 merge issue 487 v110 (#533)
* Cleans up a couple of MSVC warnings in testhdf5 (#475)
* Fixes a few testhdf5 warnings raised in Visual Studio
Visual Studio is grumpier about treating pointers like integers than
gcc.
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Fix typos and grammar errors. (#476)
* Suppresses the tcheck_version test's abort dialog on Windows (#477)
* Suppresses the tcheck_version test's abort dialog on Windows
Windows raises a modal abort/retry/ignore dialog box when CRT
calls abort(). This change installs a report hook that suppresses
the dialog so that the CMake tests don't time out waiting for a
nonexistent user to click a dialog box.
* Committing clang-format changes
* Removes __cdecl from callback
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Committing clang-format changes
Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org>
Diffstat (limited to 'test/vfd.c')
-rw-r--r-- | test/vfd.c | 85 |
1 files changed, 68 insertions, 17 deletions
@@ -636,7 +636,10 @@ test_direct(void) if (H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE) < 0) TEST_ERROR; - H5E_BEGIN_TRY { file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); } + H5E_BEGIN_TRY + { + file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + } H5E_END_TRY; if (file < 0) { H5Pclose(fapl); @@ -836,13 +839,19 @@ test_family_opens(char *fname, hid_t fa_pl) /* Case 1: reopen file with 1st member file name and default property list */ HDsnprintf(first_name, sizeof(first_name), fname, 0); - H5E_BEGIN_TRY { file = H5Fopen(first_name, H5F_ACC_RDWR, H5P_DEFAULT); } + H5E_BEGIN_TRY + { + file = H5Fopen(first_name, H5F_ACC_RDWR, H5P_DEFAULT); + } H5E_END_TRY; if (file >= 0) TEST_ERROR /* Case 2: reopen file with correct name template but default property list */ - H5E_BEGIN_TRY { file = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); } + H5E_BEGIN_TRY + { + file = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); + } H5E_END_TRY; if (file >= 0) TEST_ERROR @@ -851,7 +860,10 @@ test_family_opens(char *fname, hid_t fa_pl) if (H5Pset_fapl_family(fa_pl, (hsize_t)128, H5P_DEFAULT) < 0) TEST_ERROR; - H5E_BEGIN_TRY { file = H5Fopen(fname, H5F_ACC_RDWR, fa_pl); } + H5E_BEGIN_TRY + { + file = H5Fopen(fname, H5F_ACC_RDWR, fa_pl); + } H5E_END_TRY; if (file >= 0) TEST_ERROR @@ -867,7 +879,10 @@ test_family_opens(char *fname, hid_t fa_pl) if (H5Pset_fapl_family(fa_pl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) TEST_ERROR; - H5E_BEGIN_TRY { file = H5Fopen(wrong_name, H5F_ACC_RDWR, fa_pl); } + H5E_BEGIN_TRY + { + file = H5Fopen(wrong_name, H5F_ACC_RDWR, fa_pl); + } H5E_END_TRY; if (file >= 0) TEST_ERROR @@ -1341,7 +1356,10 @@ test_multi_opens(char *fname) HDsnprintf(super_name, sizeof(super_name), "%%s-%c.h5", 's'); HDsnprintf(sf_name, sizeof(sf_name), super_name, fname); - H5E_BEGIN_TRY { fid = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT); } + H5E_BEGIN_TRY + { + fid = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT); + } H5E_END_TRY; return (fid >= 0 ? FAIL : SUCCEED); @@ -2531,7 +2549,10 @@ driver_is_splitter_compatible(hid_t fapl_id) HDstrncpy(vfd_config->wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX); vfd_config->log_file_path[0] = '\0'; - H5E_BEGIN_TRY { ret = H5Pset_fapl_splitter(split_fapl_id, vfd_config); } + H5E_BEGIN_TRY + { + ret = H5Pset_fapl_splitter(split_fapl_id, vfd_config); + } H5E_END_TRY; if (SUCCEED == ret) { ret_value = -1; @@ -2547,7 +2568,10 @@ driver_is_splitter_compatible(hid_t fapl_id) return ret_value; error: - H5E_BEGIN_TRY { H5Pclose(split_fapl_id); } + H5E_BEGIN_TRY + { + H5Pclose(split_fapl_id); + } H5E_END_TRY; HDfree(vfd_config); @@ -2608,7 +2632,10 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id) * Should fail. */ - H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); } + H5E_BEGIN_TRY + { + file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); + } H5E_END_TRY; if (file_id >= 0) { SPLITTER_TEST_FAULT("R/O open on nonexistent files unexpectedly successful\n"); @@ -2621,7 +2648,10 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id) if (splitter_create_single_file_at(vfd_config->wo_path, vfd_config->wo_fapl_id, data) < 0) { SPLITTER_TEST_FAULT("can't write W/O file\n"); } - H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); } + H5E_BEGIN_TRY + { + file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); + } H5E_END_TRY; if (file_id >= 0) { SPLITTER_TEST_FAULT("R/O open with extant W/O file unexpectedly successful\n"); @@ -2635,7 +2665,10 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id) if (splitter_create_single_file_at(filename_rw, vfd_config->rw_fapl_id, data) < 0) { SPLITTER_TEST_FAULT("can't create R/W file\n"); } - H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); } + H5E_BEGIN_TRY + { + file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); + } H5E_END_TRY; if (file_id >= 0) { SPLITTER_TEST_FAULT("R/O open with extant R/W file unexpectedly successful\n"); @@ -2870,7 +2903,10 @@ splitter_compare_expected_data(hid_t file_id, const struct splitter_dataset_def done: if (ret_value < 0) { - H5E_BEGIN_TRY { H5Dclose(dset_id); } + H5E_BEGIN_TRY + { + H5Dclose(dset_id); + } H5E_END_TRY; } return ret_value; @@ -2968,7 +3004,10 @@ splitter_tentative_open_test(hid_t child_fapl_id) * Should fail. */ - H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); } + H5E_BEGIN_TRY + { + file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); + } H5E_END_TRY; if (file_id != H5I_INVALID_HID) { SPLITTER_TEST_FAULT("open with both nonexistent files unexpectedly succeeded\n"); @@ -2989,7 +3028,10 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } - H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); } + H5E_BEGIN_TRY + { + file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); + } H5E_END_TRY; if (file_id != H5I_INVALID_HID) { SPLITTER_TEST_FAULT("open with nonexistent R/W file unexpectedly succeeded\n"); @@ -3014,7 +3056,10 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (h5_duplicate_file_by_bytes(filename_tmp, filename_rw) < 0) { SPLITTER_TEST_FAULT("Can't create R/W file copy.\n"); } - H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); } + H5E_BEGIN_TRY + { + file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); + } H5E_END_TRY; if (file_id != H5I_INVALID_HID) { SPLITTER_TEST_FAULT("open with nonexistent W/O unexpectedly succeeded\n"); @@ -3180,7 +3225,10 @@ file_exists(const char *filename, hid_t fapl_id) hid_t file_id = H5I_INVALID_HID; int ret_value = 0; - H5E_BEGIN_TRY { file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id); } + H5E_BEGIN_TRY + { + file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id); + } H5E_END_TRY; if (file_id != H5I_INVALID_HID) { ret_value = 1; @@ -3192,7 +3240,10 @@ file_exists(const char *filename, hid_t fapl_id) return ret_value; error: - H5E_BEGIN_TRY { H5Fclose(file_id); } + H5E_BEGIN_TRY + { + H5Fclose(file_id); + } H5E_END_TRY; return ret_value; } /* end file_exists() */ |