]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fix coverity false-positives for tests 3390/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 14 Jan 2015 20:39:28 +0000 (15:39 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 14 Jan 2015 20:39:28 +0000 (15:39 -0500)
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 <dillaman@redhat.com>
src/test/librbd/test_ImageWatcher.cc
src/test/librbd/test_fixture.cc

index 2b8b945bdab732886eff26648a2ad7f229a9f807..a3f4b2a1981443bf3bc9dcab9c4a24f0b4c6c153 100644 (file)
@@ -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;
index f099949b86bbdfb68ed5a83abdf02a5ee8eeb9ab..0c584b0e230f93679c74584e57eda7e8cddc175b 100644 (file)
@@ -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() {