diff options
author | Quincey Koziol <koziol@lbl.gov> | 2021-03-17 15:25:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-17 15:25:39 (GMT) |
commit | c6e4e535469beaa3418b34863d455c8f17ade3f5 (patch) | |
tree | 11c5cf08959881ee6cff2df81b1d9f873ddd3dcf /test/vfd.c | |
parent | f6d919a2ab0034a1ee76ca2d5f59f4d8114c4952 (diff) | |
download | hdf5-c6e4e535469beaa3418b34863d455c8f17ade3f5.zip hdf5-c6e4e535469beaa3418b34863d455c8f17ade3f5.tar.gz hdf5-c6e4e535469beaa3418b34863d455c8f17ade3f5.tar.bz2 |
Update clang config (#473)
* Update clang config to put H5E_BEGIN_TRY / H5E_END_TRY on separate lines, empty C++ methods on separate lines, understand that ALL_MEMBERS / UNIQUE_MEMBERS are foreach macros, and properly skip the 'config' directory in the find command without emiting a warning
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
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); @@ -2529,7 +2547,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; @@ -2545,7 +2566,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); @@ -2606,7 +2630,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"); @@ -2619,7 +2646,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"); @@ -2633,7 +2663,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"); @@ -2868,7 +2901,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; @@ -2966,7 +3002,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"); @@ -2987,7 +3026,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"); @@ -3012,7 +3054,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"); @@ -3178,7 +3223,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; @@ -3190,7 +3238,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() */ |