diff options
author | Jos Collin <jcollin@redhat.com> | 2017-04-12 11:18:43 +0200 |
---|---|---|
committer | Jos Collin <jcollin@redhat.com> | 2017-04-12 13:57:27 +0200 |
commit | 12df9a3a18c23fc32c34d7998c898d3386e73e79 (patch) | |
tree | c0253f6e84ce85ae5e04707a825b0377f9b400f8 /src/test/cls_lock | |
parent | Merge pull request #14361 from ShiqiCooperation/master (diff) | |
download | ceph-12df9a3a18c23fc32c34d7998c898d3386e73e79.tar.xz ceph-12df9a3a18c23fc32c34d7998c898d3386e73e79.zip |
test: add explicit braces to avoid ambiguous ‘else’ and to silence warnings
The following warning appears during make for several files in the test submodule:
warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
Fixed the review comment too.
Signed-off-by: Jos Collin <jcollin@redhat.com>
Diffstat (limited to 'src/test/cls_lock')
-rw-r--r-- | src/test/cls_lock/test_cls_lock.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/cls_lock/test_cls_lock.cc b/src/test/cls_lock/test_cls_lock.cc index 29dc0e04dda..0aeed8245e7 100644 --- a/src/test/cls_lock/test_cls_lock.cc +++ b/src/test/cls_lock/test_cls_lock.cc @@ -42,11 +42,13 @@ void lock_info(IoCtx *ioctx, string& oid, string& name, map<locker_id_t, locker_ cout << " tag: " << tag << std::endl; cout << " lockers:" << std::endl; - if (assert_type) + if (assert_type) { ASSERT_EQ(*assert_type, lock_type); + } - if (assert_tag) + if (assert_tag) { ASSERT_EQ(*assert_tag, tag); + } map<locker_id_t, locker_info_t>::iterator liter; for (liter = lockers.begin(); liter != lockers.end(); ++liter) { |