]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Added a couple of ASSERTS for avoiding coverity to complain about the possibility...
authorSebastien Ponce <sebastien.ponce@cern.ch>
Thu, 26 Jun 2014 08:37:36 +0000 (10:37 +0200)
committerSebastien Ponce <sebastien.ponce@cern.ch>
Thu, 26 Jun 2014 15:40:08 +0000 (17:40 +0200)
Signed-off-by: Sebastien Ponce <sebastien.ponce@cern.ch>
src/test/libradosstriper/io.cc
src/test/libradosstriper/striping.cc

index 0850c71903b904ebbc67590859f74fd53287b0cd..1386fcce45daef4cc67a16b5e04320abc47536cc 100644 (file)
@@ -338,7 +338,7 @@ TEST_F(StriperTest, XattrIter) {
     const char *name;
     const char *val;
     size_t len;
-    ASSERT_EQ(0, rados_getxattrs_next(iter, &name, &val, &len));
+    ASSERT_EQ(0, rados_striper_getxattrs_next(iter, &name, &val, &len));
     if (name == NULL) {
       break;
     }
@@ -355,7 +355,7 @@ TEST_F(StriperTest, XattrIter) {
       ASSERT_EQ(0, 1) << "Unexpected attribute : " << name;;
     }
   }
-  rados_getxattrs_end(iter);
+  rados_striper_getxattrs_end(iter);
 }
 
 TEST_F(StriperTestPP, XattrListPP) {
index c65f0498de585cc5cefc7de784fbd504d4a50a2b..81b458d088f2f138ddbaef1a13b1533b490efb29 100644 (file)
@@ -40,10 +40,12 @@ protected:
     ASSERT_LT(0, ioctx.getxattr(firstOid, "striper.layout.stripe_unit", xattrbl));
     std::string s_xattr(xattrbl.c_str(), xattrbl.length()); // adds 0 byte at the end
     uint64_t stripe_unit = strtoll(s_xattr.c_str(), NULL, 10);
+    ASSERT_LT(0, stripe_unit);
     ASSERT_EQ(stripe_unit, exp_stripe_unit);
     ASSERT_LT(0, ioctx.getxattr(firstOid, "striper.layout.stripe_count", xattrbl));
     s_xattr = std::string(xattrbl.c_str(), xattrbl.length()); // adds 0 byte at the end
     uint64_t stripe_count = strtoll(s_xattr.c_str(), NULL, 10);
+    ASSERT_LT(0, stripe_count);
     ASSERT_EQ(stripe_count, exp_stripe_count);
     ASSERT_LT(0, ioctx.getxattr(firstOid, "striper.layout.object_size", xattrbl));
     s_xattr = std::string(xattrbl.c_str(), xattrbl.length()); // adds 0 byte at the end