diff options
author | Sean McBride <sean@rogue-research.com> | 2021-03-10 18:42:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 18:42:35 (GMT) |
commit | d7b40604ef43c0617ba93369983657d77d9e976a (patch) | |
tree | ae6eef7cd8a34f3667b585ca37c290fb0cc97fce /c++/test | |
parent | a7a013782f0af93f511142b5d167c2bc8ca8505d (diff) | |
download | hdf5-d7b40604ef43c0617ba93369983657d77d9e976a.zip hdf5-d7b40604ef43c0617ba93369983657d77d9e976a.tar.gz hdf5-d7b40604ef43c0617ba93369983657d77d9e976a.tar.bz2 |
Fixed all clang-tidy bugprone-suspicious-string-compare warnings (#451)
* Fixed all clang-tidy bugprone-suspicious-string-compare warnings
This change was generated entirely by clang-tidy itself.
* Reformat code with clang v10.0.1.
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Diffstat (limited to 'c++/test')
-rw-r--r-- | c++/test/tattr.cpp | 2 | ||||
-rw-r--r-- | c++/test/tcompound.cpp | 2 | ||||
-rw-r--r-- | c++/test/th5s.cpp | 2 | ||||
-rw-r--r-- | c++/test/tlinks.cpp | 2 | ||||
-rw-r--r-- | c++/test/tvlstr.cpp | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index e659e8e..adaa237 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -771,7 +771,7 @@ test_attr_compound_read() hsize_t ii, jj; for (ii = 0; ii < ATTR4_DIM1; ii++) for (jj = 0; jj < ATTR4_DIM2; jj++) - if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct))) { + if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct)) != 0) { TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].i=%d, " "read_data4[%llu][%llu].i=%d\n", __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i); diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 4c5e3e0..82c21e8 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -487,7 +487,7 @@ test_compound_5() int_array.close(); /* Check results */ - if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim != dst[1].tdim || + if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) != 0 || src[1].tdim != dst[1].tdim || src[1].coll_ids[0] != dst[1].coll_ids[0] || src[1].coll_ids[1] != dst[1].coll_ids[1] || src[1].coll_ids[2] != dst[1].coll_ids[2] || src[1].coll_ids[3] != dst[1].coll_ids[3]) { H5_FAILED(); diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index a005170..9952e68 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -512,7 +512,7 @@ test_h5s_compound_scalar_read() dataset.read(&rdata, type); // Verify read data - if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct))) { + if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct)) != 0) { cerr << "scalar data different: space4_data.c1=" << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; cerr << "scalar data different: space4_data.u=" << space4_data.u << ", read_data4.u=" << rdata.u diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 22e69da..e8dad5b 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -589,7 +589,7 @@ visit_obj_cb(H5Object &obj, const H5std_string name, const H5O_info2_t *oinfo, v ovisit_ud_t *op_data = static_cast<ovisit_ud_t *>(_op_data); // Check for correct object information - if (strcmp(op_data->info[op_data->idx].path, name.c_str())) + if (strcmp(op_data->info[op_data->idx].path, name.c_str()) != 0) return (H5_ITER_ERROR); if (op_data->info[op_data->idx].type != oinfo->type) return (H5_ITER_ERROR); diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 780d1b9..b371518 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -861,7 +861,7 @@ read_scalar_dset(H5File &file, DataType &type, DataSpace &space, char *name, cha dset.read(&data_read, type, space, space); dset.close(); - if (HDstrcmp(data, data_read)) + if (HDstrcmp(data, data_read) != 0) TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read); HDfree(data_read); |