From: amitkuma Date: Tue, 8 Aug 2017 18:09:18 +0000 (+0530) Subject: rados: Initializing members of librados/TestCase.h X-Git-Tag: v13.0.0~89^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=644fd94a61fb9c95c90b9843d3daa68811d08a41;p=ceph.git rados: Initializing members of librados/TestCase.h Fixes the coverity issues: ** 1409698 Uninitialized pointer field 2. uninit_member: Non-static class member cluster is not initialized in this constructor nor in any functions that it calls. 4. uninit_member: Non-static class member ioctx is not initialized in this constructor nor in any functions that it calls. CID 1409698 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR) 6. uninit_member: Non-static class member alignment is not initialized in this constructor nor in any functions that it calls. ** 1409699 Uninitialized pointer field 2. uninit_member: Non-static class member cluster is not initialized in this constructor nor in any functions that it calls. CID 1409699 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR) 4. uninit_member: Non-static class member ioctx is not initialized in this constructor nor in any functions that it calls. ** 1409701 Uninitialized pointer field 2. uninit_member: Non-static class member cluster is not initialized in this constructor nor in any functions that it calls. CID 1409701 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR) 4. uninit_member: Non-static class member ioctx is not initialized in this constructor nor in any functions that it calls. ** 1409703 Uninitialized pointer field 2. uninit_member: Non-static class member cluster is not initialized in this constructor nor in any functions that it calls. 4. uninit_member: Non-static class member ioctx is not initialized in this constructor nor in any functions that it calls. CID 1409703 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR) 6. uninit_member: Non-static class member alignment is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Amit Kumar amitkuma@redhat.com --- diff --git a/src/test/librados/TestCase.h b/src/test/librados/TestCase.h index ac84bba0864..71281595b50 100644 --- a/src/test/librados/TestCase.h +++ b/src/test/librados/TestCase.h @@ -32,8 +32,8 @@ protected: void SetUp() override; void TearDown() override; - rados_t cluster; - rados_ioctx_t ioctx; + rados_t cluster = nullptr; + rados_ioctx_t ioctx = nullptr; bool cleanup; }; @@ -94,9 +94,9 @@ protected: void SetUp() override; void TearDown() override; - rados_t cluster; - rados_ioctx_t ioctx; - uint64_t alignment; + rados_t cluster = nullptr; + rados_ioctx_t ioctx = nullptr; + uint64_t alignment = 0; bool cleanup; }; @@ -148,8 +148,8 @@ protected: void SetUp() override; void TearDown() override; - rados_t cluster; - rados_ioctx_t ioctx; + rados_t cluster = nullptr; + rados_ioctx_t ioctx = nullptr; std::string nspace; bool cleanup; }; @@ -207,11 +207,11 @@ protected: void SetUp() override; void TearDown() override; - rados_t cluster; - rados_ioctx_t ioctx; + rados_t cluster = nullptr; + rados_ioctx_t ioctx = nullptr; bool cleanup; std::string nspace; - uint64_t alignment; + uint64_t alignment = 0; }; class RadosTestECPP : public RadosTestPP {