diff options
author | Sean McBride <sean@rogue-research.com> | 2023-06-16 04:49:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 04:49:02 (GMT) |
commit | 68eba3da69e659fab69bbef5901ce42e82cea1dc (patch) | |
tree | f36805f798df6c04092c14dc6803d2cb82f6eff2 /c++/test | |
parent | 10093f7c4345061bdbebc12888debbf08fe85a5b (diff) | |
download | hdf5-68eba3da69e659fab69bbef5901ce42e82cea1dc.zip hdf5-68eba3da69e659fab69bbef5901ce42e82cea1dc.tar.gz hdf5-68eba3da69e659fab69bbef5901ce42e82cea1dc.tar.bz2 |
Many clang -Wextra-semi-stmt fixes (#2537)
* Adds semicolons to function-like macros
* Adds a do..while(0) loop to some macros
* Removes semicolons when inappropriate, especially H5E_TRY_BEGIN/END
Diffstat (limited to 'c++/test')
-rw-r--r-- | c++/test/h5cpputil.h | 8 | ||||
-rw-r--r-- | c++/test/tlinks.cpp | 24 |
2 files changed, 16 insertions, 16 deletions
diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index a5477b6..392382d 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -28,15 +28,15 @@ using std::cerr; using std::endl; #define MESSAGE(V, A) \ - { \ + do { \ if (HDGetTestVerbosity() > (V)) \ print_func A; \ - } + } while (0) #define SUBTEST(TEST) \ - { \ + do { \ printf(" Subtest: %-52s", TEST); \ fflush(stdout); \ - } + } while (0) int check_values(hsize_t i, hsize_t j, int apoint, int acheck); void check_values(const char *value, const char *msg, int line, const char *file_name); diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index ebb457a..7017217 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -67,9 +67,9 @@ test_basic_links(hid_t fapl_id, hbool_t new_format) try { if (new_format) - SUBTEST("Link creation (w/new group format)") + SUBTEST("Link creation (w/new group format)"); else - SUBTEST("Link creation") + SUBTEST("Link creation"); h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); @@ -174,9 +174,9 @@ test_lcpl(hid_t fapl_id, hbool_t new_format) hsize_t dims[2]; if (new_format) - SUBTEST("Link creation property lists (w/new group format)") + SUBTEST("Link creation property lists (w/new group format)"); else - SUBTEST("Link creation property lists") + SUBTEST("Link creation property lists"); try { FileAccPropList fapl(fapl_id); @@ -254,9 +254,9 @@ test_move(hid_t fapl_id, hbool_t new_format) char filename[1024]; if (new_format) - SUBTEST("Group::moveLink (w/new group format)") + SUBTEST("Group::moveLink (w/new group format)"); else - SUBTEST("Group::moveLink") + SUBTEST("Group::moveLink"); try { FileAccPropList fapl(fapl_id); @@ -399,9 +399,9 @@ test_copy(hid_t fapl_id, hbool_t new_format) char filename[1024]; if (new_format) - SUBTEST("Group::copyLink (w/new group format)") + SUBTEST("Group::copyLink (w/new group format)"); else - SUBTEST("Group::copyLink") + SUBTEST("Group::copyLink"); try { // Create two new files @@ -537,9 +537,9 @@ test_num_links(hid_t fapl_id, hbool_t new_format) char filename[NAME_BUF_SIZE]; if (new_format) - SUBTEST("Setting number of links (w/new group format)") + SUBTEST("Setting number of links (w/new group format)"); else - SUBTEST("Setting number of links") + SUBTEST("Setting number of links"); try { // Use the file access template id to create a file access prop. list. @@ -622,9 +622,9 @@ test_visit(hid_t fapl_id, hbool_t new_format) char filename[NAME_BUF_SIZE]; if (new_format) - SUBTEST("H5Object::visit (w/new group format)") + SUBTEST("H5Object::visit (w/new group format)"); else - SUBTEST("H5Object::visit") + SUBTEST("H5Object::visit"); try { // Use the file access template id to create a file access prop. list |