]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
unittest_bufferlist: fix ptr move test
authorSage Weil <sage@redhat.com>
Thu, 11 Feb 2016 14:25:15 +0000 (09:25 -0500)
committerSage Weil <sage@redhat.com>
Tue, 1 Mar 2016 13:47:28 +0000 (08:47 -0500)
Do not assume there is a trailing null the terminate the string.

Signed-off-by: Sage Weil <sage@redhat.com>
src/test/bufferlist.cc

index a91f5710b9697ac2496804a3071412aee1ebb86b..8316373970bf974cd12d450207fae85b134f028f 100644 (file)
@@ -457,7 +457,7 @@ TEST(BufferPtr, constructors) {
     bufferptr ptr(std::move(original));
     EXPECT_TRUE(ptr.have_raw());
     EXPECT_FALSE(original.have_raw());
-    EXPECT_EQ(str.compare(0, str.size(), ptr.c_str()), 0);
+    EXPECT_EQ(str.compare(0, str.size(), ptr.c_str(), ptr.length()), 0);
     EXPECT_EQ(1, ptr.raw_nref());
   }
 }