From 3424baed03c88f2c2874cfb8bc700d147104354a Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 14 Jan 2015 15:39:28 -0500 Subject: [PATCH] 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 --- src/test/librbd/test_ImageWatcher.cc | 2 +- src/test/librbd/test_fixture.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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() { -- 2.47.3