]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librgw: normalize obj_rec::sync calls, fix signedness of refcnt asserts
authorMatt Benjamin <mbenjamin@redhat.com>
Mon, 11 Jan 2016 16:39:25 +0000 (11:39 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Feb 2016 17:07:50 +0000 (12:07 -0500)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/test/librgw_file_nfsns.cc

index 3e15c0ab0150198f947b33c01ca51946777e5be5..fd5f8838b739547bbecebb9c5c188ba349945a46 100644 (file)
@@ -248,13 +248,13 @@ TEST(LibRGW, SETUP_DIRS1) {
                          &st, &sdir.fh);
            ASSERT_EQ(rc, 0);
          }
-       } else {
-         sdir.sync();
-         ASSERT_TRUE(sdir.rgw_fh->is_dir());
        }
 
-       if (sdir.fh)
-         ovec.push_back(sdir);
+       ASSERT_NE(sdir.fh, nullptr); // suppress !lookup && !create case
+
+       sdir.sync();
+       ASSERT_TRUE(sdir.rgw_fh->is_dir());
+       ovec.push_back(sdir);
 
        /* child file */
        std::string sfname{"sfile_"};
@@ -340,10 +340,10 @@ TEST(LibRGW, RELEASE_DIRS1) {
                    << " refs: " << obj.rgw_fh->get_refcnt()
                    << std::endl;
        }
-       ASSERT_EQ(obj.rgw_fh->get_refcnt(), 2);
+       ASSERT_EQ(obj.rgw_fh->get_refcnt(), 2UL);
        rc = rgw_fh_rele(fs, obj.fh, 0 /* flags */);
        ASSERT_EQ(rc, 0);
-       ASSERT_EQ(obj.rgw_fh->get_refcnt(), 1);
+       ASSERT_EQ(obj.rgw_fh->get_refcnt(), 1UL);
        /* try-discard handle */
        /* clear obj_rec vec */
       }