From: Jason Dillaman Date: Wed, 14 Jan 2015 20:39:28 +0000 (-0500) Subject: librbd: fix coverity false-positives for tests X-Git-Tag: v0.93~271^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3390%2Fhead;p=ceph.git librbd: fix coverity false-positives for tests Coverity flagged two variables as uninitialized prior to use. Explicitly initialize the variables in the constructors to remove the false-positives. Signed-off-by: Jason Dillaman --- diff --git a/src/test/librbd/test_ImageWatcher.cc b/src/test/librbd/test_ImageWatcher.cc index 2b8b945bdab..a3f4b2a1981 100644 --- a/src/test/librbd/test_ImageWatcher.cc +++ b/src/test/librbd/test_ImageWatcher.cc @@ -44,7 +44,7 @@ public: class WatchCtx : public librados::WatchCtx2 { public: - WatchCtx(TestImageWatcher &parent) : m_parent(parent) {} + WatchCtx(TestImageWatcher &parent) : m_parent(parent), m_handle(0) {} int watch(const librbd::ImageCtx &ictx) { m_header_oid = ictx.header_oid; diff --git a/src/test/librbd/test_fixture.cc b/src/test/librbd/test_fixture.cc index f099949b86b..0c584b0e230 100644 --- a/src/test/librbd/test_fixture.cc +++ b/src/test/librbd/test_fixture.cc @@ -40,7 +40,7 @@ std::string TestFixture::_pool_name; librados::Rados TestFixture::_rados; uint64_t TestFixture::_image_number = 0; -TestFixture::TestFixture() { +TestFixture::TestFixture() : m_image_size(0) { } void TestFixture::SetUpTestCase() {