]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_rados_api_misc: fix TMAPPUT sorting test
authorSage Weil <sage@inktank.com>
Wed, 28 Nov 2012 00:52:30 +0000 (16:52 -0800)
committerSage Weil <sage@inktank.com>
Wed, 28 Nov 2012 00:55:25 +0000 (16:55 -0800)
Several things wrong here.

Signed-off-by: Sage Weil <sage@inktank.com>
src/test/librados/misc.cc

index 50c837014910f04eb15dde0584e776898b3fc970..0868fac3173b8e3379f313d672f209e7079f7c92 100644 (file)
@@ -235,12 +235,13 @@ TEST(LibRadosMisc, TmapUpdateMisorderedPutPP) {
   ::encode(string("aval"), bl);
   ::encode(string("c"), bl);
   ::encode(string("cval"), bl);
+  bufferlist orig = bl;  // tmap_put steals bl content
   ASSERT_EQ(0, ioctx.tmap_put("foo", bl));
 
   // check
   bufferlist newbl;
-  ASSERT_EQ(0, ioctx.read("foo", bl, 0, 0));
-  ASSERT_EQ(bl.contents_equal(newbl), false);
+  ioctx.read("foo", newbl, orig.length(), 0);
+  ASSERT_EQ(orig.contents_equal(newbl), false);
 
   ioctx.close();
   ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster));